- Revision
- 105789
- Author
- [email protected]
- Date
- 2012-01-24 13:09:28 -0800 (Tue, 24 Jan 2012)
Log Message
check-webkit-style of the chromium test_expectations.txt file takes too long
https://bugs.webkit.org/show_bug.cgi?id=76745
Patch by Ojan Vafai <[email protected]> on 2012-01-20
Reviewed by Dimitri Glazkov.
When in lint mode, have TestExpectations test all configurations instead
of looping over each configuration. This also has the benefit of making
the error output considerably more concise.
Also, got rid of the double-printing of errors when linting through check-webkit-style.
* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager.lint):
* Scripts/webkitpy/layout_tests/models/test_expectations.py:
(TestExpectations._report_errors):
(TestExpectations._add_expectations):
* Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py:
(test_parse_error_nonfatal):
(test_error_on_different_platform):
* Scripts/webkitpy/style/checkers/test_expectations.py:
(TestExpectationsChecker.check_test_expectations):
(TestExpectationsChecker.check):
* Scripts/webkitpy/style/checkers/test_expectations_unittest.py:
(TestExpectationsTestCase.test_determine_port_from_exepectations_path):
(TestExpectationsTestCase.assert_lines_lint):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (105788 => 105789)
--- trunk/Tools/ChangeLog 2012-01-24 21:08:23 UTC (rev 105788)
+++ trunk/Tools/ChangeLog 2012-01-24 21:09:28 UTC (rev 105789)
@@ -40,6 +40,36 @@
* Scripts/webkitpy/common/net/file_uploader.py:
(FileUploader.upload_as_multipart_form_data):
+2012-01-24 Vincent Scheib <[email protected]>
+
+ [Chromium] Add Pointer Lock test hooks and mock implementation to DumpRenderTree
+ https://bugs.webkit.org/show_bug.cgi?id=76411
+
+ Reviewed by Adam Barth.
+
+ Breaking up https://bugs.webkit.org/show_bug.cgi?id=75762
+ into a series of patches, this change adds a trivial
+ pointer lock implementation to the Chromium port's DumpRenderTree
+ and exposes LayoutTestController hooks to force failure conditions.
+
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::didLosePointerLock):
+ (LayoutTestController::setPointerLockWillFailAsynchronously):
+ (LayoutTestController::setPointerLockWillFailSynchronously):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::requestPointerLock):
+ (WebViewHost::requestPointerUnlock):
+ (WebViewHost::isPointerLocked):
+ (WebViewHost::didCompletePointerLock):
+ (WebViewHost::didNotCompletePointerLock):
+ (WebViewHost::didLosePointerLock):
+ (WebViewHost::reset):
+ * DumpRenderTree/chromium/WebViewHost.h:
+ (WebViewHost::setPointerLockWillFailAsynchronously):
+ (WebViewHost::setPointerLockWillFailSynchronously):
+
2012-01-24 Mario Sanchez Prada <[email protected]>
Unreviewed, skip WK2 API test timing out on some GTK bots.
Modified: trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp (105788 => 105789)
--- trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp 2012-01-24 21:08:23 UTC (rev 105788)
+++ trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp 2012-01-24 21:09:28 UTC (rev 105789)
@@ -97,6 +97,9 @@
bindMethod("clearAllDatabases", &LayoutTestController::clearAllDatabases);
bindMethod("closeWebInspector", &LayoutTestController::closeWebInspector);
bindMethod("counterValueForElementById", &LayoutTestController::counterValueForElementById);
+#if ENABLE(POINTER_LOCK)
+ bindMethod("didLosePointerLock", &LayoutTestController::didLosePointerLock);
+#endif
bindMethod("disableImageLoading", &LayoutTestController::disableImageLoading);
bindMethod("display", &LayoutTestController::display);
bindMethod("displayInvalidatedRegion", &LayoutTestController::displayInvalidatedRegion);
@@ -182,6 +185,10 @@
bindMethod("setMockGeolocationPosition", &LayoutTestController::setMockGeolocationPosition);
bindMethod("setPageVisibility", &LayoutTestController::setPageVisibility);
bindMethod("setPluginsEnabled", &LayoutTestController::setPluginsEnabled);
+#if ENABLE(POINTER_LOCK)
+ bindMethod("setPointerLockWillFailAsynchronously", &LayoutTestController::setPointerLockWillFailAsynchronously);
+ bindMethod("setPointerLockWillFailSynchronously", &LayoutTestController::setPointerLockWillFailSynchronously);
+#endif
bindMethod("setPopupBlockingEnabled", &LayoutTestController::setPopupBlockingEnabled);
bindMethod("setPOSIXLocale", &LayoutTestController::setPOSIXLocale);
bindMethod("setPrinting", &LayoutTestController::setPrinting);
@@ -2178,3 +2185,23 @@
setShouldDumpAsAudio(true);
}
+
+#if ENABLE(POINTER_LOCK)
+void LayoutTestController::didLosePointerLock(const CppArgumentList&, CppVariant* result)
+{
+ m_shell->webViewHost()->didLosePointerLock();
+ result->setNull();
+}
+
+void LayoutTestController::setPointerLockWillFailAsynchronously(const CppArgumentList&, CppVariant* result)
+{
+ m_shell->webViewHost()->setPointerLockWillFailAsynchronously();
+ result->setNull();
+}
+
+void LayoutTestController::setPointerLockWillFailSynchronously(const CppArgumentList&, CppVariant* result)
+{
+ m_shell->webViewHost()->setPointerLockWillFailSynchronously();
+ result->setNull();
+}
+#endif
Modified: trunk/Tools/DumpRenderTree/chromium/LayoutTestController.h (105788 => 105789)
--- trunk/Tools/DumpRenderTree/chromium/LayoutTestController.h 2012-01-24 21:08:23 UTC (rev 105788)
+++ trunk/Tools/DumpRenderTree/chromium/LayoutTestController.h 2012-01-24 21:09:28 UTC (rev 105789)
@@ -430,6 +430,12 @@
void enableFixedLayoutMode(const CppArgumentList&, CppVariant*);
void setFixedLayoutSize(const CppArgumentList&, CppVariant*);
+#if ENABLE(POINTER_LOCK)
+ void didLosePointerLock(const CppArgumentList&, CppVariant*);
+ void setPointerLockWillFailSynchronously(const CppArgumentList&, CppVariant*);
+ void setPointerLockWillFailAsynchronously(const CppArgumentList&, CppVariant*);
+#endif
+
void workerThreadCount(CppVariant*);
public:
Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp (105788 => 105789)
--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp 2012-01-24 21:08:23 UTC (rev 105788)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp 2012-01-24 21:09:28 UTC (rev 105789)
@@ -771,6 +771,57 @@
return info;
}
+#if ENABLE(POINTER_LOCK)
+bool WebViewHost::requestPointerLock()
+{
+ switch (m_pointerLockPlannedResult) {
+ case PointerLockWillSucceed:
+ postDelayedTask(new HostMethodTask(this, &WebViewHost::didAcquirePointerLock), 0);
+ return true;
+ case PointerLockWillFailAsync:
+ ASSERT(!m_pointerLocked);
+ postDelayedTask(new HostMethodTask(this, &WebViewHost::didNotAcquirePointerLock), 0);
+ return true;
+ case PointerLockWillFailSync:
+ ASSERT(!m_pointerLocked);
+ return false;
+ default:
+ ASSERT_NOT_REACHED();
+ return false;
+ }
+}
+
+void WebViewHost::requestPointerUnlock()
+{
+ postDelayedTask(new HostMethodTask(this, &WebViewHost::didLosePointerLock), 0);
+}
+
+bool WebViewHost::isPointerLocked()
+{
+ return m_pointerLocked;
+}
+
+void WebViewHost::didAcquirePointerLock()
+{
+ m_pointerLocked = true;
+ webWidget()->didAcquirePointerLock();
+}
+
+void WebViewHost::didNotAcquirePointerLock()
+{
+ ASSERT(!m_pointerLocked);
+ m_pointerLocked = false;
+ webWidget()->didNotAcquirePointerLock();
+}
+
+void WebViewHost::didLosePointerLock()
+{
+ ASSERT(m_pointerLocked);
+ m_pointerLocked = false;
+ webWidget()->didLosePointerLock();
+}
+#endif
+
void WebViewHost::show(WebNavigationPolicy)
{
m_hasWindow = true;
@@ -1302,6 +1353,10 @@
m_requestReturnNull = false;
m_isPainting = false;
m_canvas.clear();
+#if ENABLE(POINTER_LOCK)
+ m_pointerLocked = false;
+ m_pointerLockPlannedResult = PointerLockWillSucceed;
+#endif
m_navigationController = adoptPtr(new TestNavigationController(this));
Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.h (105788 => 105789)
--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.h 2012-01-24 21:08:23 UTC (rev 105788)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.h 2012-01-24 21:09:28 UTC (rev 105789)
@@ -110,6 +110,12 @@
WebKit::WebSpeechInputControllerMock* speechInputControllerMock() { return m_speechInputControllerMock.get(); }
+#if ENABLE(POINTER_LOCK)
+ void didLosePointerLock();
+ void setPointerLockWillFailAsynchronously() { m_pointerLockPlannedResult = PointerLockWillFailAsync; }
+ void setPointerLockWillFailSynchronously() { m_pointerLockPlannedResult = PointerLockWillFailSync; }
+#endif
+
// NavigationHost
virtual bool navigate(const TestNavigationEntry&, bool reload);
@@ -180,6 +186,11 @@
virtual WebKit::WebRect rootWindowRect();
virtual WebKit::WebRect windowResizerRect();
virtual WebKit::WebScreenInfo screenInfo();
+#if ENABLE(POINTER_LOCK)
+ virtual bool requestPointerLock();
+ virtual void requestPointerUnlock();
+ virtual bool isPointerLocked();
+#endif
// WebKit::WebFrameClient
virtual WebKit::WebPlugin* createPlugin(WebKit::WebFrame*, const WebKit::WebPluginParams&);
@@ -288,6 +299,11 @@
void resetScrollRect();
void discardBackingStore();
+#if ENABLE(POINTER_LOCK)
+ void didAcquirePointerLock();
+ void didNotAcquirePointerLock();
+#endif
+
WebKit::WebUserMediaClientMock* userMediaClientMock();
webkit_support::MediaStreamUtil* mediaStreamUtil();
webkit_support::TestMediaStreamClient* testMediaStreamClient();
@@ -378,6 +394,15 @@
TaskList m_taskList;
Vector<WebKit::WebWidget*> m_popupmenus;
+
+#if ENABLE(POINTER_LOCK)
+ bool m_pointerLocked;
+ enum {
+ PointerLockWillSucceed,
+ PointerLockWillFailAsync,
+ PointerLockWillFailSync
+ } m_pointerLockPlannedResult;
+#endif
};
#endif // WebViewHost_h