- Revision
- 144635
- Author
- [email protected]
- Date
- 2013-03-04 09:04:36 -0800 (Mon, 04 Mar 2013)
Log Message
[chromium] pass all focus handling methods through the WebTestDelegate
https://bugs.webkit.org/show_bug.cgi?id=111328
Reviewed by Nico Weber.
In content_shell, the focus handling is asynchronous. To allow for
switching the focus synchronously between WebViews, we need to intercept
didFocus and didBlur and forward it to the WebTestDelegate.
* DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h:
(WebTestDelegate):
(WebTestRunner::WebTestDelegate::setFocus):
* DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h:
(WebTestRunner::WebTestProxy::didFocus):
(WebTestRunner::WebTestProxy::didBlur):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
(WebTestRunner::TestRunner::setWindowIsKey):
* DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp:
(WebTestRunner::WebTestProxyBase::didFocus):
(WebTestRunner):
(WebTestRunner::WebTestProxyBase::didBlur):
* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::didFocus):
(WebViewHost::didBlur):
(WebViewHost::setFocus):
* DumpRenderTree/chromium/WebViewHost.h:
(WebViewHost):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (144634 => 144635)
--- trunk/Tools/ChangeLog 2013-03-04 16:50:01 UTC (rev 144634)
+++ trunk/Tools/ChangeLog 2013-03-04 17:04:36 UTC (rev 144635)
@@ -1,3 +1,33 @@
+2013-03-04 Jochen Eisinger <[email protected]>
+
+ [chromium] pass all focus handling methods through the WebTestDelegate
+ https://bugs.webkit.org/show_bug.cgi?id=111328
+
+ Reviewed by Nico Weber.
+
+ In content_shell, the focus handling is asynchronous. To allow for
+ switching the focus synchronously between WebViews, we need to intercept
+ didFocus and didBlur and forward it to the WebTestDelegate.
+
+ * DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h:
+ (WebTestDelegate):
+ (WebTestRunner::WebTestDelegate::setFocus):
+ * DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h:
+ (WebTestRunner::WebTestProxy::didFocus):
+ (WebTestRunner::WebTestProxy::didBlur):
+ * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
+ (WebTestRunner::TestRunner::setWindowIsKey):
+ * DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp:
+ (WebTestRunner::WebTestProxyBase::didFocus):
+ (WebTestRunner):
+ (WebTestRunner::WebTestProxyBase::didBlur):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::didFocus):
+ (WebViewHost::didBlur):
+ (WebViewHost::setFocus):
+ * DumpRenderTree/chromium/WebViewHost.h:
+ (WebViewHost):
+
2013-03-04 Claudio Saavedra <[email protected]>
[GTK] No need to manually add system paths to jhbuildrc
Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h (144634 => 144635)
--- trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h 2013-03-04 16:50:01 UTC (rev 144634)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h 2013-03-04 17:04:36 UTC (rev 144635)
@@ -110,8 +110,10 @@
// Controls the device scale factor of the main WebView for hidpi tests.
virtual void setDeviceScaleFactor(float) = 0;
- // Controls whether or not the main WebView should be focused.
- virtual void setFocus(bool) = 0;
+ // Controls which WebView should be focused.
+ virtual void setFocus(WebTestProxyBase*, bool enable) { setFocus(enable); }
+ // FIXME: remove deprecated method.
+ virtual void setFocus(bool) { }
// Controls whether all cookies should be accepted or writing cookies in a
// third-party context is blocked.
Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h (144634 => 144635)
--- trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h 2013-03-04 16:50:01 UTC (rev 144634)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h 2013-03-04 17:04:36 UTC (rev 144635)
@@ -162,6 +162,8 @@
bool requestPointerLock();
void requestPointerUnlock();
bool isPointerLocked();
+ void didFocus();
+ void didBlur();
void willPerformClientRedirect(WebKit::WebFrame*, const WebKit::WebURL& from, const WebKit::WebURL& to, double interval, double fire_time);
void didCancelClientRedirect(WebKit::WebFrame*);
@@ -419,6 +421,16 @@
{
return WebTestProxyBase::isPointerLocked();
}
+ virtual void didFocus()
+ {
+ WebTestProxyBase::didFocus();
+ Base::didFocus();
+ }
+ virtual void didBlur()
+ {
+ WebTestProxyBase::didBlur();
+ Base::didBlur();
+ }
// WebFrameClient implementation.
virtual void willPerformClientRedirect(WebKit::WebFrame* frame, const WebKit::WebURL& from, const WebKit::WebURL& to, double interval, double fireTime)
Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp (144634 => 144635)
--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp 2013-03-04 16:50:01 UTC (rev 144634)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp 2013-03-04 17:04:36 UTC (rev 144635)
@@ -1770,7 +1770,7 @@
void TestRunner::setWindowIsKey(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool())
- m_delegate->setFocus(arguments[0].value.boolValue);
+ m_delegate->setFocus(m_proxy, arguments[0].value.boolValue);
result->setNull();
}
Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp (144634 => 144635)
--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp 2013-03-04 16:50:01 UTC (rev 144634)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp 2013-03-04 17:04:36 UTC (rev 144635)
@@ -1066,6 +1066,16 @@
return m_testInterfaces->testRunner()->isPointerLocked();
}
+void WebTestProxyBase::didFocus()
+{
+ m_delegate->setFocus(this, true);
+}
+
+void WebTestProxyBase::didBlur()
+{
+ m_delegate->setFocus(this, false);
+}
+
void WebTestProxyBase::willPerformClientRedirect(WebFrame* frame, const WebURL&, const WebURL& to, double, double)
{
if (m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp (144634 => 144635)
--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp 2013-03-04 16:50:01 UTC (rev 144634)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp 2013-03-04 17:04:36 UTC (rev 144635)
@@ -302,12 +302,10 @@
void WebViewHost::didFocus()
{
- m_shell->setFocus(webWidget(), true);
}
void WebViewHost::didBlur()
{
- m_shell->setFocus(webWidget(), false);
}
WebScreenInfo WebViewHost::screenInfo()
@@ -622,9 +620,12 @@
updateViewportSize();
}
-void WebViewHost::setFocus(bool focused)
+void WebViewHost::setFocus(WebTestProxyBase* proxy, bool focused)
{
- m_shell->setFocus(m_shell->webView(), focused);
+ for (size_t i = 0; i < m_shell->windowList().size(); ++i) {
+ if (m_shell->windowList()[i]->proxy() == proxy)
+ m_shell->setFocus(m_shell->windowList()[i]->webWidget(), focused);
+ }
}
void WebViewHost::setAcceptAllCookies(bool acceptCookies)
Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.h (144634 => 144635)
--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.h 2013-03-04 16:50:01 UTC (rev 144634)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.h 2013-03-04 17:04:36 UTC (rev 144635)
@@ -106,7 +106,7 @@
virtual void clearAllDatabases() OVERRIDE;
virtual void setDatabaseQuota(int) OVERRIDE;
virtual void setDeviceScaleFactor(float) OVERRIDE;
- virtual void setFocus(bool) OVERRIDE;
+ virtual void setFocus(WebTestRunner::WebTestProxyBase*, bool) OVERRIDE;
virtual void setAcceptAllCookies(bool) OVERRIDE;
virtual std::string pathToLocalResource(const std::string& url) OVERRIDE;
virtual void setLocale(const std::string&) OVERRIDE;