Diff
Modified: trunk/Tools/ChangeLog (139626 => 139627)
--- trunk/Tools/ChangeLog 2013-01-14 18:57:23 UTC (rev 139626)
+++ trunk/Tools/ChangeLog 2013-01-14 19:04:39 UTC (rev 139627)
@@ -1,3 +1,41 @@
+2013-01-14 Jochen Eisinger <[email protected]>
+
+ [chromium] move remaining methods to dump WebViewClient callbacks to TestRunner library
+ https://bugs.webkit.org/show_bug.cgi?id=106785
+
+ Reviewed by Adam Barth.
+
+ * DumpRenderTree/chromium/DRTTestRunner.cpp:
+ (DRTTestRunner::DRTTestRunner):
+ (DRTTestRunner::reset):
+ * DumpRenderTree/chromium/DRTTestRunner.h:
+ (DRTTestRunner):
+ * DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h:
+ (WebTestProxyBase):
+ (WebTestRunner::WebTestProxy::setStatusText):
+ (WebTestRunner::WebTestProxy::didStopLoading):
+ * DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h:
+ (WebTestRunner::WebTestRunner::shouldDumpStatusCallbacks):
+ (WebTestRunner::WebTestRunner::shouldDumpProgressFinishedCallback):
+ * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
+ (WebTestRunner::TestRunner::TestRunner):
+ (WebTestRunner::TestRunner::reset):
+ (WebTestRunner::TestRunner::shouldDumpStatusCallbacks):
+ (WebTestRunner):
+ (WebTestRunner::TestRunner::shouldDumpProgressFinishedCallback):
+ (WebTestRunner::TestRunner::dumpWindowStatusChanges):
+ (WebTestRunner::TestRunner::dumpProgressFinishedCallback):
+ * DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
+ (TestRunner):
+ * DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp:
+ (WebTestRunner::WebTestProxyBase::setStatusText):
+ (WebTestRunner):
+ (WebTestRunner::WebTestProxyBase::didStopLoading):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::didStopLoading):
+ * DumpRenderTree/chromium/WebViewHost.h:
+ (WebViewHost):
+
2013-01-14 Andrey Lushnikov <[email protected]>
Web Inspector: devtools front-end doesn't have focus in TestShell
Modified: trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp (139626 => 139627)
--- trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp 2013-01-14 18:57:23 UTC (rev 139626)
+++ trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp 2013-01-14 19:04:39 UTC (rev 139627)
@@ -115,9 +115,7 @@
bindMethod("display", &DRTTestRunner::display);
bindMethod("displayInvalidatedRegion", &DRTTestRunner::displayInvalidatedRegion);
bindMethod("dumpBackForwardList", &DRTTestRunner::dumpBackForwardList);
- bindMethod("dumpProgressFinishedCallback", &DRTTestRunner::dumpProgressFinishedCallback);
bindMethod("dumpSelectionRect", &DRTTestRunner::dumpSelectionRect);
- bindMethod("dumpStatusCallbacks", &DRTTestRunner::dumpWindowStatusChanges);
#if ENABLE(NOTIFICATIONS)
bindMethod("grantWebNotificationPermission", &DRTTestRunner::grantWebNotificationPermission);
#endif
@@ -227,18 +225,6 @@
result->setNull();
}
-void DRTTestRunner::dumpProgressFinishedCallback(const CppArgumentList&, CppVariant* result)
-{
- m_dumpProgressFinishedCallback = true;
- result->setNull();
-}
-
-void DRTTestRunner::dumpWindowStatusChanges(const CppArgumentList&, CppVariant* result)
-{
- m_dumpWindowStatusChanges = true;
- result->setNull();
-}
-
void DRTTestRunner::waitUntilDone(const CppArgumentList&, CppVariant* result)
{
if (!webkit_support::BeingDebugged())
@@ -423,9 +409,7 @@
TestRunner::reset();
if (m_shell)
m_shell->webViewHost()->setDeviceScaleFactor(1);
- m_dumpProgressFinishedCallback = false;
m_dumpBackForwardList = false;
- m_dumpWindowStatusChanges = false;
m_dumpSelectionRect = false;
m_waitUntilDone = false;
m_testRepaint = false;
Modified: trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h (139626 => 139627)
--- trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h 2013-01-14 18:57:23 UTC (rev 139626)
+++ trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h 2013-01-14 19:04:39 UTC (rev 139627)
@@ -75,20 +75,10 @@
virtual ~DRTTestRunner();
- // This function sets a flag that tells the test_shell to print a line of
- // descriptive text for the progress finished callback. It takes no
- // arguments, and ignores any that may be present.
- void dumpProgressFinishedCallback(const CppArgumentList&, CppVariant*);
-
// This function sets a flag that tells the test_shell to print out a text
// representation of the back/forward list. It ignores all arguments.
void dumpBackForwardList(const CppArgumentList&, CppVariant*);
- // This function sets a flag that tells the test_shell to dump all calls
- // to window.status().
- // It takes no arguments, and ignores any that may be present.
- void dumpWindowStatusChanges(const CppArgumentList&, CppVariant*);
-
// Functions for dealing with windows. By default we block all new windows.
void windowCount(const CppArgumentList&, CppVariant*);
void setCloseRemainingWindowsWhenComplete(const CppArgumentList&, CppVariant*);
@@ -202,9 +192,6 @@
// The following methods are not exposed to _javascript_.
void setWorkQueueFrozen(bool frozen) { m_workQueue.setFrozen(frozen); }
- bool shouldDumpProgressFinishedCallback() { return m_dumpProgressFinishedCallback; }
- void setShouldDumpProgressFinishedCallback(bool value) { m_dumpProgressFinishedCallback = value; }
- bool shouldDumpStatusCallbacks() { return m_dumpWindowStatusChanges; }
bool shouldDumpSelectionRect() { return m_dumpSelectionRect; }
bool shouldDumpBackForwardList() { return m_dumpBackForwardList; }
bool deferMainResourceDataLoad() { return m_deferMainResourceDataLoad; }
@@ -300,17 +287,10 @@
// taking possible transforms of the selection rect into account.
bool m_dumpSelectionRect;
- // If true, the test_shell will output a descriptive line for the progress
- // finished callback.
- bool m_dumpProgressFinishedCallback;
-
// If true, the test_shell will produce a dump of the back forward list as
// well.
bool m_dumpBackForwardList;
- // If true, the test_shell will dump all changes to window.status.
- bool m_dumpWindowStatusChanges;
-
// When reset is called, go through and close all but the main test shell
// window. By default, set to true but toggled to false using
// setCloseRemainingWindowsWhenComplete().
Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h (139626 => 139627)
--- trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h 2013-01-14 18:57:23 UTC (rev 139626)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h 2013-01-14 19:04:39 UTC (rev 139627)
@@ -107,6 +107,9 @@
void registerIntentService(WebKit::WebFrame*, const WebKit::WebIntentServiceInfo&);
void dispatchIntent(WebKit::WebFrame* source, const WebKit::WebIntentRequest&);
WebKit::WebView* createView(WebKit::WebFrame* creator, const WebKit::WebURLRequest&, const WebKit::WebWindowFeatures&, const WebKit::WebString& frameName, WebKit::WebNavigationPolicy);
+ void setStatusText(const WebKit::WebString&);
+ void didStopLoading();
+
void willPerformClientRedirect(WebKit::WebFrame*, const WebKit::WebURL& from, const WebKit::WebURL& to, double interval, double fire_time);
void didCancelClientRedirect(WebKit::WebFrame*);
void didStartProvisionalLoad(WebKit::WebFrame*);
@@ -265,6 +268,16 @@
WebTestProxyBase::createView(creator, request, features, frameName, policy);
return Base::createView(creator, request, features, frameName, policy);
}
+ virtual void setStatusText(const WebKit::WebString& text)
+ {
+ WebTestProxyBase::setStatusText(text);
+ Base::setStatusText(text);
+ }
+ virtual void didStopLoading()
+ {
+ WebTestProxyBase::didStopLoading();
+ Base::didStopLoading();
+ }
// 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/public/WebTestRunner.h (139626 => 139627)
--- trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h 2013-01-14 18:57:23 UTC (rev 139626)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h 2013-01-14 19:04:39 UTC (rev 139627)
@@ -63,6 +63,8 @@
virtual bool shouldDumpResourceRequestCallbacks() const { return false; }
virtual bool shouldDumpResourceResponseMIMETypes() const { return false; }
virtual WebKit::WebPermissionClient* webPermissions() const { return 0; }
+ virtual bool shouldDumpStatusCallbacks() const { return false; }
+ virtual bool shouldDumpProgressFinishedCallback() const { return false; }
};
}
Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp (139626 => 139627)
--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp 2013-01-14 18:57:23 UTC (rev 139626)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp 2013-01-14 19:04:39 UTC (rev 139627)
@@ -160,6 +160,8 @@
bindMethod("setPluginsAllowed", &TestRunner::setPluginsAllowed);
bindMethod("setAllowDisplayOfInsecureContent", &TestRunner::setAllowDisplayOfInsecureContent);
bindMethod("setAllowRunningOfInsecureContent", &TestRunner::setAllowRunningOfInsecureContent);
+ bindMethod("dumpStatusCallbacks", &TestRunner::dumpWindowStatusChanges);
+ bindMethod("dumpProgressFinishedCallback", &TestRunner::dumpProgressFinishedCallback);
// The following methods interact with the WebTestProxy.
bindMethod("sendWebIntentResponse", &TestRunner::sendWebIntentResponse);
@@ -250,6 +252,8 @@
m_dumpResourceLoadCallbacks = false;
m_dumpResourceRequestCallbacks = false;
m_dumpResourceResponseMIMETypes = false;
+ m_dumpWindowStatusChanges = false;
+ m_dumpProgressFinishedCallback = false;
m_globalFlag.set(false);
m_platformName.set("chromium");
@@ -364,6 +368,16 @@
return m_webPermissions.get();
}
+bool TestRunner::shouldDumpStatusCallbacks() const
+{
+ return m_dumpWindowStatusChanges;
+}
+
+bool TestRunner::shouldDumpProgressFinishedCallback() const
+{
+ return m_dumpProgressFinishedCallback;
+}
+
void TestRunner::dumpPermissionClientCallbacks(const CppArgumentList&, CppVariant* result)
{
m_webPermissions->setDumpCallbacks(true);
@@ -414,6 +428,18 @@
result->setNull();
}
+void TestRunner::dumpWindowStatusChanges(const CppArgumentList&, CppVariant* result)
+{
+ m_dumpWindowStatusChanges = true;
+ result->setNull();
+}
+
+void TestRunner::dumpProgressFinishedCallback(const CppArgumentList&, CppVariant* result)
+{
+ m_dumpProgressFinishedCallback = true;
+ result->setNull();
+}
+
void TestRunner::setTabKeyCyclesThroughElements(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool())
Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h (139626 => 139627)
--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h 2013-01-14 18:57:23 UTC (rev 139626)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h 2013-01-14 19:04:39 UTC (rev 139627)
@@ -81,6 +81,8 @@
virtual bool shouldDumpResourceRequestCallbacks() const OVERRIDE;
virtual bool shouldDumpResourceResponseMIMETypes() const OVERRIDE;
virtual WebKit::WebPermissionClient* webPermissions() const OVERRIDE;
+ virtual bool shouldDumpStatusCallbacks() const OVERRIDE;
+ virtual bool shouldDumpProgressFinishedCallback() const OVERRIDE;
protected:
// FIXME: make these private once the move from DRTTestRunner to TestRunner
@@ -278,6 +280,16 @@
void setAllowRunningOfInsecureContent(const CppArgumentList&, CppVariant*);
void dumpPermissionClientCallbacks(const CppArgumentList&, CppVariant*);
+ // This function sets a flag that tells the test_shell to dump all calls
+ // to window.status().
+ // It takes no arguments, and ignores any that may be present.
+ void dumpWindowStatusChanges(const CppArgumentList&, CppVariant*);
+
+ // This function sets a flag that tells the test_shell to print a line of
+ // descriptive text for the progress finished callback. It takes no
+ // arguments, and ignores any that may be present.
+ void dumpProgressFinishedCallback(const CppArgumentList&, CppVariant*);
+
///////////////////////////////////////////////////////////////////////////
// Methods interacting with the WebTestProxy
@@ -390,6 +402,13 @@
// was loaded.
bool m_dumpResourceResponseMIMETypes;
+ // If true, the test_shell will dump all changes to window.status.
+ bool m_dumpWindowStatusChanges;
+
+ // If true, the test_shell will output a descriptive line for the progress
+ // finished callback.
+ bool m_dumpProgressFinishedCallback;
+
// WAV audio data is stored here.
WebKit::WebArrayBufferView m_audioData;
Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp (139626 => 139627)
--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp 2013-01-14 18:57:23 UTC (rev 139626)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp 2013-01-14 19:04:39 UTC (rev 139627)
@@ -507,6 +507,19 @@
return 0;
}
+void WebTestProxyBase::setStatusText(const WebString& text)
+{
+ if (!m_testInterfaces->testRunner() || !m_testInterfaces->testRunner()->shouldDumpStatusCallbacks())
+ return;
+ m_delegate->printMessage(string("UI DELEGATE STATUS CALLBACK: setStatusText:") + text.utf8().data() + "\n");
+}
+
+void WebTestProxyBase::didStopLoading()
+{
+ if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpProgressFinishedCallback())
+ m_delegate->printMessage("postProgressFinishedNotification\n");
+}
+
void WebTestProxyBase::willPerformClientRedirect(WebFrame* frame, const WebURL&, const WebURL& to, double, double)
{
if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp (139626 => 139627)
--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp 2013-01-14 18:57:23 UTC (rev 139626)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp 2013-01-14 19:04:39 UTC (rev 139627)
@@ -248,8 +248,6 @@
void WebViewHost::didStopLoading()
{
- if (testRunner()->shouldDumpProgressFinishedCallback())
- fputs("postProgressFinishedNotification\n", stdout);
m_shell->setIsLoading(false);
}
@@ -427,14 +425,6 @@
m_lastContextMenuData = adoptPtr(new WebContextMenuData(contextMenuData));
}
-void WebViewHost::setStatusText(const WebString& text)
-{
- if (!testRunner()->shouldDumpStatusCallbacks())
- return;
- // When running tests, write to stdout.
- printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", text.utf8().data());
-}
-
void WebViewHost::didUpdateLayout()
{
#if OS(MAC_OS_X)
Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.h (139626 => 139627)
--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.h 2013-01-14 18:57:23 UTC (rev 139626)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.h 2013-01-14 19:04:39 UTC (rev 139627)
@@ -191,7 +191,6 @@
virtual bool runModalPromptDialog(WebKit::WebFrame*, const WebKit::WebString& message, const WebKit::WebString& defaultValue, WebKit::WebString* actualValue);
virtual bool runModalBeforeUnloadDialog(WebKit::WebFrame*, const WebKit::WebString&);
virtual void showContextMenu(WebKit::WebFrame*, const WebKit::WebContextMenuData&);
- virtual void setStatusText(const WebKit::WebString&);
virtual void didUpdateLayout();
virtual void navigateBackForwardSoon(int offset);
virtual int historyBackListCount();