Diff
Modified: trunk/Tools/ChangeLog (139230 => 139231)
--- trunk/Tools/ChangeLog 2013-01-09 20:53:45 UTC (rev 139230)
+++ trunk/Tools/ChangeLog 2013-01-09 21:07:15 UTC (rev 139231)
@@ -1,3 +1,26 @@
+2013-01-09 Dan Carney <dcar...@google.com>
+
+ [chromium] move dumpcreateview methods to testrunner library
+ https://bugs.webkit.org/show_bug.cgi?id=106434
+
+ Reviewed by Adam Barth.
+
+ * DumpRenderTree/chromium/DRTTestRunner.cpp:
+ (DRTTestRunner::DRTTestRunner):
+ (DRTTestRunner::reset):
+ * DumpRenderTree/chromium/DRTTestRunner.h:
+ (DRTTestRunner):
+ * DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h:
+ (WebTestRunner::WebTestRunner::shouldDumpCreateView):
+ * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
+ (WebTestRunner::TestRunner::TestRunner):
+ (WebTestRunner::TestRunner::reset):
+ (WebTestRunner::TestRunner::shouldDumpCreateView):
+ (WebTestRunner):
+ (WebTestRunner::TestRunner::dumpCreateView):
+ * DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
+ (TestRunner):
+
2013-01-09 Csaba Osztrogonác <o...@webkit.org>
webkitpy cleanup: Merge additional_comment_text into comment_text
Modified: trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp (139230 => 139231)
--- trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp 2013-01-09 20:53:45 UTC (rev 139230)
+++ trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp 2013-01-09 21:07:15 UTC (rev 139231)
@@ -125,7 +125,6 @@
bindMethod("dumpSelectionRect", &DRTTestRunner::dumpSelectionRect);
bindMethod("dumpStatusCallbacks", &DRTTestRunner::dumpWindowStatusChanges);
bindMethod("dumpPermissionClientCallbacks", &DRTTestRunner::dumpPermissionClientCallbacks);
- bindMethod("dumpCreateView", &DRTTestRunner::dumpCreateView);
bindMethod("enableAutoResizeMode", &DRTTestRunner::enableAutoResizeMode);
bindMethod("evaluateInWebInspector", &DRTTestRunner::evaluateInWebInspector);
#if ENABLE(NOTIFICATIONS)
@@ -145,7 +144,6 @@
bindMethod("setAllowDisplayOfInsecureContent", &DRTTestRunner::setAllowDisplayOfInsecureContent);
bindMethod("setAllowRunningOfInsecureContent", &DRTTestRunner::setAllowRunningOfInsecureContent);
bindMethod("setAlwaysAcceptCookies", &DRTTestRunner::setAlwaysAcceptCookies);
- bindMethod("setCanOpenWindows", &DRTTestRunner::setCanOpenWindows);
bindMethod("setCloseRemainingWindowsWhenComplete", &DRTTestRunner::setCloseRemainingWindowsWhenComplete);
bindMethod("setCustomPolicyDelegate", &DRTTestRunner::setCustomPolicyDelegate);
bindMethod("setDatabaseQuota", &DRTTestRunner::setDatabaseQuota);
@@ -283,12 +281,6 @@
result->setNull();
}
-void DRTTestRunner::dumpCreateView(const CppArgumentList&, CppVariant* result)
-{
- m_dumpCreateView = true;
- result->setNull();
-}
-
void DRTTestRunner::waitUntilDone(const CppArgumentList&, CppVariant* result)
{
if (!webkit_support::BeingDebugged())
@@ -473,7 +465,6 @@
TestRunner::reset();
if (m_shell)
m_shell->webViewHost()->setDeviceScaleFactor(1);
- m_dumpCreateView = false;
m_dumpProgressFinishedCallback = false;
m_dumpResourceLoadCallbacks = false;
m_dumpResourceRequestCallbacks = false;
@@ -483,7 +474,6 @@
m_dumpSelectionRect = false;
m_dumpPermissionClientCallbacks = false;
m_waitUntilDone = false;
- m_canOpenWindows = false;
m_testRepaint = false;
m_sweepHorizontally = false;
m_deferMainResourceDataLoad = true;
@@ -526,12 +516,6 @@
m_waitUntilDone = false;
}
-void DRTTestRunner::setCanOpenWindows(const CppArgumentList&, CppVariant* result)
-{
- m_canOpenWindows = true;
- result->setNull();
-}
-
void DRTTestRunner::windowCount(const CppArgumentList&, CppVariant* result)
{
result->set(static_cast<int>(m_shell->windowCount()));
Modified: trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h (139230 => 139231)
--- trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h 2013-01-09 20:53:45 UTC (rev 139230)
+++ trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h 2013-01-09 21:07:15 UTC (rev 139231)
@@ -104,14 +104,8 @@
// 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 dump all calls to
- // WebViewClient::createView().
- // It takes no arguments, and ignores any that may be present.
- void dumpCreateView(const CppArgumentList&, CppVariant*);
-
// Functions for dealing with windows. By default we block all new windows.
void windowCount(const CppArgumentList&, CppVariant*);
- void setCanOpenWindows(const CppArgumentList&, CppVariant*);
void setCloseRemainingWindowsWhenComplete(const CppArgumentList&, CppVariant*);
// By default, tests end when page load is complete. These methods are used
@@ -258,8 +252,6 @@
bool shouldDumpSelectionRect() { return m_dumpSelectionRect; }
bool shouldDumpBackForwardList() { return m_dumpBackForwardList; }
bool shouldDumpPermissionClientCallbacks() { return m_dumpPermissionClientCallbacks; }
- bool shouldDumpCreateView() { return m_dumpCreateView; }
- bool canOpenWindows() { return m_canOpenWindows; }
bool deferMainResourceDataLoad() { return m_deferMainResourceDataLoad; }
void setShowDebugLayerTree(bool value) { m_showDebugLayerTree = value; }
void setTitleTextDirection(WebKit::WebTextDirection dir)
@@ -380,15 +372,6 @@
// callback is invoked. Currently only implemented for allowImage.
bool m_dumpPermissionClientCallbacks;
- // If true, output a descriptive line each time WebViewClient::createView
- // is invoked.
- bool m_dumpCreateView;
-
- // If true, new windows can be opened via _javascript_ or by plugins. By
- // default, set to false and can be toggled to true using
- // setCanOpenWindows().
- bool m_canOpenWindows;
-
// 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 (139230 => 139231)
--- trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h 2013-01-09 20:53:45 UTC (rev 139230)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h 2013-01-09 21:07:15 UTC (rev 139231)
@@ -52,9 +52,12 @@
class WebSerializedScriptValue;
class WebString;
class WebURL;
+class WebURLRequest;
+class WebView;
struct WebPoint;
struct WebSize;
struct WebURLError;
+struct WebWindowFeatures;
}
namespace WebTestRunner {
@@ -97,6 +100,7 @@
void didEndEditing();
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 willPerformClientRedirect(WebKit::WebFrame*, const WebKit::WebURL& from, const WebKit::WebURL& to, double interval, double fire_time);
void didCancelClientRedirect(WebKit::WebFrame*);
void didStartProvisionalLoad(WebKit::WebFrame*);
@@ -243,6 +247,11 @@
WebTestProxyBase::dispatchIntent(source, request);
Base::dispatchIntent(source, request);
}
+ virtual WebKit::WebView* createView(WebKit::WebFrame* creator, const WebKit::WebURLRequest& request, const WebKit::WebWindowFeatures& features, const WebKit::WebString& frameName, WebKit::WebNavigationPolicy policy)
+ {
+ WebTestProxyBase::createView(creator, request, features, frameName, policy);
+ return Base::createView(creator, request, features, frameName, policy);
+ }
// 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 (139230 => 139231)
--- trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h 2013-01-09 20:53:45 UTC (rev 139230)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h 2013-01-09 21:07:15 UTC (rev 139231)
@@ -56,6 +56,8 @@
virtual bool shouldDumpUserGestureInFrameLoadCallbacks() const { return false; }
virtual bool stopProvisionalFrameLoads() const { return false; }
virtual bool shouldDumpTitleChanges() const { return false; }
+ virtual bool shouldDumpCreateView() const { return false; }
+ virtual bool canOpenWindows() const { return false; }
};
}
Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp (139230 => 139231)
--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp 2013-01-09 20:53:45 UTC (rev 139230)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp 2013-01-09 21:07:15 UTC (rev 139231)
@@ -142,6 +142,8 @@
bindMethod("dumpUserGestureInFrameLoadCallbacks", &TestRunner::dumpUserGestureInFrameLoadCallbacks);
bindMethod("setStopProvisionalFrameLoads", &TestRunner::setStopProvisionalFrameLoads);
bindMethod("dumpTitleChanges", &TestRunner::dumpTitleChanges);
+ bindMethod("dumpCreateView", &TestRunner::dumpCreateView);
+ bindMethod("setCanOpenWindows", &TestRunner::setCanOpenWindows);
// The following methods interact with the WebTestProxy.
bindMethod("sendWebIntentResponse", &TestRunner::sendWebIntentResponse);
@@ -216,6 +218,8 @@
m_dumpUserGestureInFrameLoadCallbacks = false;
m_stopProvisionalFrameLoads = false;
m_dumpTitleChanges = false;
+ m_dumpCreateView = false;
+ m_canOpenWindows = false;
m_globalFlag.set(false);
m_platformName.set("chromium");
@@ -298,6 +302,16 @@
return m_dumpTitleChanges;
}
+bool TestRunner::shouldDumpCreateView() const
+{
+ return m_dumpCreateView;
+}
+
+bool TestRunner::canOpenWindows() const
+{
+ return m_canOpenWindows;
+}
+
void TestRunner::setTabKeyCyclesThroughElements(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool())
@@ -1063,6 +1077,18 @@
result->setNull();
}
+void TestRunner::dumpCreateView(const CppArgumentList&, CppVariant* result)
+{
+ m_dumpCreateView = true;
+ result->setNull();
+}
+
+void TestRunner::setCanOpenWindows(const CppArgumentList&, CppVariant* result)
+{
+ m_canOpenWindows = true;
+ result->setNull();
+}
+
void TestRunner::workerThreadCount(CppVariant* result)
{
result->set(static_cast<int>(WebWorkerInfo::dedicatedWorkerCount()));
Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h (139230 => 139231)
--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h 2013-01-09 20:53:45 UTC (rev 139230)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h 2013-01-09 21:07:15 UTC (rev 139231)
@@ -74,6 +74,8 @@
virtual bool shouldDumpUserGestureInFrameLoadCallbacks() const OVERRIDE;
virtual bool stopProvisionalFrameLoads() const OVERRIDE;
virtual bool shouldDumpTitleChanges() const OVERRIDE;
+ virtual bool shouldDumpCreateView() const OVERRIDE;
+ virtual bool canOpenWindows() const OVERRIDE;
protected:
// FIXME: make these private once the move from DRTTestRunner to TestRunner
@@ -232,6 +234,13 @@
void dumpTitleChanges(const CppArgumentList&, CppVariant*);
+ // This function sets a flag that tells the test_shell to dump all calls to
+ // WebViewClient::createView().
+ // It takes no arguments, and ignores any that may be present.
+ void dumpCreateView(const CppArgumentList&, CppVariant*);
+
+ void setCanOpenWindows(const CppArgumentList&, CppVariant*);
+
///////////////////////////////////////////////////////////////////////////
// Methods interacting with the WebTestProxy
@@ -313,6 +322,15 @@
// If true, output a message when the page title is changed.
bool m_dumpTitleChanges;
+ // If true, output a descriptive line each time WebViewClient::createView
+ // is invoked.
+ bool m_dumpCreateView;
+
+ // If true, new windows can be opened via _javascript_ or by plugins. By
+ // default, set to false and can be toggled to true using
+ // setCanOpenWindows().
+ bool m_canOpenWindows;
+
// WAV audio data is stored here.
WebKit::WebArrayBufferView m_audioData;
Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp (139230 => 139231)
--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp 2013-01-09 20:53:45 UTC (rev 139230)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp 2013-01-09 21:07:15 UTC (rev 139231)
@@ -47,6 +47,7 @@
#include "WebTestRunner.h"
#include "WebView.h"
#include "platform/WebCString.h"
+#include "platform/WebURLRequest.h"
#include <wtf/StringExtras.h>
using namespace WebKit;
@@ -140,8 +141,15 @@
delegate->printMessage(string("Frame with user gesture \"") + (isUserGesture ? "true" : "false") + "\"" + msg);
}
+string URLDescription(const GURL& url)
+{
+ if (url.SchemeIs("file"))
+ return url.ExtractFileName();
+ return url.possibly_invalid_spec();
}
+}
+
WebTestProxyBase::WebTestProxyBase()
: m_testInterfaces(0)
, m_delegate(0)
@@ -452,6 +460,15 @@
m_delegate->printMessage(string("Have suggestion ") + suggestions[i].spec().data() + "\n");
}
+WebView* WebTestProxyBase::createView(WebFrame*, const WebURLRequest& request, const WebWindowFeatures&, const WebString&, WebNavigationPolicy)
+{
+ if (!m_testInterfaces->testRunner() || !m_testInterfaces->testRunner()->canOpenWindows())
+ return 0;
+ if (m_testInterfaces->testRunner()->shouldDumpCreateView())
+ m_delegate->printMessage(string("createView(") + URLDescription(request.url()) + ")\n");
+ return 0;
+}
+
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 (139230 => 139231)
--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp 2013-01-09 20:53:45 UTC (rev 139230)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp 2013-01-09 21:07:15 UTC (rev 139231)
@@ -203,12 +203,10 @@
// WebViewClient -------------------------------------------------------------
-WebView* WebViewHost::createView(WebFrame* creator, const WebURLRequest& request, const WebWindowFeatures&, const WebString&, WebNavigationPolicy)
+WebView* WebViewHost::createView(WebFrame* creator, const WebURLRequest&, const WebWindowFeatures&, const WebString&, WebNavigationPolicy)
{
if (!testRunner()->canOpenWindows())
return 0;
- if (testRunner()->shouldDumpCreateView())
- fprintf(stdout, "createView(%s)\n", URLDescription(request.url()).c_str());
creator->consumeUserGesture();
return m_shell->createNewWindow(WebURL())->webView();
}