Changeset 139231 in webkit
- Timestamp:
- Jan 9, 2013 1:07:15 PM (11 years ago)
- Location:
- trunk/Tools
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r139224 r139231 1 2013-01-09 Dan Carney <dcarney@google.com> 2 3 [chromium] move dumpcreateview methods to testrunner library 4 https://bugs.webkit.org/show_bug.cgi?id=106434 5 6 Reviewed by Adam Barth. 7 8 * DumpRenderTree/chromium/DRTTestRunner.cpp: 9 (DRTTestRunner::DRTTestRunner): 10 (DRTTestRunner::reset): 11 * DumpRenderTree/chromium/DRTTestRunner.h: 12 (DRTTestRunner): 13 * DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h: 14 (WebTestRunner::WebTestRunner::shouldDumpCreateView): 15 * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp: 16 (WebTestRunner::TestRunner::TestRunner): 17 (WebTestRunner::TestRunner::reset): 18 (WebTestRunner::TestRunner::shouldDumpCreateView): 19 (WebTestRunner): 20 (WebTestRunner::TestRunner::dumpCreateView): 21 * DumpRenderTree/chromium/TestRunner/src/TestRunner.h: 22 (TestRunner): 23 1 24 2013-01-09 Csaba Osztrogonác <ossy@webkit.org> 2 25 -
trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp
r139090 r139231 126 126 bindMethod("dumpStatusCallbacks", &DRTTestRunner::dumpWindowStatusChanges); 127 127 bindMethod("dumpPermissionClientCallbacks", &DRTTestRunner::dumpPermissionClientCallbacks); 128 bindMethod("dumpCreateView", &DRTTestRunner::dumpCreateView);129 128 bindMethod("enableAutoResizeMode", &DRTTestRunner::enableAutoResizeMode); 130 129 bindMethod("evaluateInWebInspector", &DRTTestRunner::evaluateInWebInspector); … … 146 145 bindMethod("setAllowRunningOfInsecureContent", &DRTTestRunner::setAllowRunningOfInsecureContent); 147 146 bindMethod("setAlwaysAcceptCookies", &DRTTestRunner::setAlwaysAcceptCookies); 148 bindMethod("setCanOpenWindows", &DRTTestRunner::setCanOpenWindows);149 147 bindMethod("setCloseRemainingWindowsWhenComplete", &DRTTestRunner::setCloseRemainingWindowsWhenComplete); 150 148 bindMethod("setCustomPolicyDelegate", &DRTTestRunner::setCustomPolicyDelegate); … … 281 279 { 282 280 m_dumpPermissionClientCallbacks = true; 283 result->setNull();284 }285 286 void DRTTestRunner::dumpCreateView(const CppArgumentList&, CppVariant* result)287 {288 m_dumpCreateView = true;289 281 result->setNull(); 290 282 } … … 474 466 if (m_shell) 475 467 m_shell->webViewHost()->setDeviceScaleFactor(1); 476 m_dumpCreateView = false;477 468 m_dumpProgressFinishedCallback = false; 478 469 m_dumpResourceLoadCallbacks = false; … … 484 475 m_dumpPermissionClientCallbacks = false; 485 476 m_waitUntilDone = false; 486 m_canOpenWindows = false;487 477 m_testRepaint = false; 488 478 m_sweepHorizontally = false; … … 525 515 m_shell->testFinished(); 526 516 m_waitUntilDone = false; 527 }528 529 void DRTTestRunner::setCanOpenWindows(const CppArgumentList&, CppVariant* result)530 {531 m_canOpenWindows = true;532 result->setNull();533 517 } 534 518 -
trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h
r139090 r139231 105 105 void dumpWindowStatusChanges(const CppArgumentList&, CppVariant*); 106 106 107 // This function sets a flag that tells the test_shell to dump all calls to108 // WebViewClient::createView().109 // It takes no arguments, and ignores any that may be present.110 void dumpCreateView(const CppArgumentList&, CppVariant*);111 112 107 // Functions for dealing with windows. By default we block all new windows. 113 108 void windowCount(const CppArgumentList&, CppVariant*); 114 void setCanOpenWindows(const CppArgumentList&, CppVariant*);115 109 void setCloseRemainingWindowsWhenComplete(const CppArgumentList&, CppVariant*); 116 110 … … 259 253 bool shouldDumpBackForwardList() { return m_dumpBackForwardList; } 260 254 bool shouldDumpPermissionClientCallbacks() { return m_dumpPermissionClientCallbacks; } 261 bool shouldDumpCreateView() { return m_dumpCreateView; }262 bool canOpenWindows() { return m_canOpenWindows; }263 255 bool deferMainResourceDataLoad() { return m_deferMainResourceDataLoad; } 264 256 void setShowDebugLayerTree(bool value) { m_showDebugLayerTree = value; } … … 381 373 bool m_dumpPermissionClientCallbacks; 382 374 383 // If true, output a descriptive line each time WebViewClient::createView384 // is invoked.385 bool m_dumpCreateView;386 387 // If true, new windows can be opened via javascript or by plugins. By388 // default, set to false and can be toggled to true using389 // setCanOpenWindows().390 bool m_canOpenWindows;391 392 375 // When reset is called, go through and close all but the main test shell 393 376 // window. By default, set to true but toggled to false using -
trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h
r139090 r139231 53 53 class WebString; 54 54 class WebURL; 55 class WebURLRequest; 56 class WebView; 55 57 struct WebPoint; 56 58 struct WebSize; 57 59 struct WebURLError; 60 struct WebWindowFeatures; 58 61 } 59 62 … … 98 101 void registerIntentService(WebKit::WebFrame*, const WebKit::WebIntentServiceInfo&); 99 102 void dispatchIntent(WebKit::WebFrame* source, const WebKit::WebIntentRequest&); 103 WebKit::WebView* createView(WebKit::WebFrame* creator, const WebKit::WebURLRequest&, const WebKit::WebWindowFeatures&, const WebKit::WebString& frameName, WebKit::WebNavigationPolicy); 100 104 void willPerformClientRedirect(WebKit::WebFrame*, const WebKit::WebURL& from, const WebKit::WebURL& to, double interval, double fire_time); 101 105 void didCancelClientRedirect(WebKit::WebFrame*); … … 244 248 Base::dispatchIntent(source, request); 245 249 } 250 virtual WebKit::WebView* createView(WebKit::WebFrame* creator, const WebKit::WebURLRequest& request, const WebKit::WebWindowFeatures& features, const WebKit::WebString& frameName, WebKit::WebNavigationPolicy policy) 251 { 252 WebTestProxyBase::createView(creator, request, features, frameName, policy); 253 return Base::createView(creator, request, features, frameName, policy); 254 } 246 255 247 256 // WebFrameClient implementation. -
trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h
r139090 r139231 57 57 virtual bool stopProvisionalFrameLoads() const { return false; } 58 58 virtual bool shouldDumpTitleChanges() const { return false; } 59 virtual bool shouldDumpCreateView() const { return false; } 60 virtual bool canOpenWindows() const { return false; } 59 61 }; 60 62 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp
r139090 r139231 143 143 bindMethod("setStopProvisionalFrameLoads", &TestRunner::setStopProvisionalFrameLoads); 144 144 bindMethod("dumpTitleChanges", &TestRunner::dumpTitleChanges); 145 bindMethod("dumpCreateView", &TestRunner::dumpCreateView); 146 bindMethod("setCanOpenWindows", &TestRunner::setCanOpenWindows); 145 147 146 148 // The following methods interact with the WebTestProxy. … … 217 219 m_stopProvisionalFrameLoads = false; 218 220 m_dumpTitleChanges = false; 221 m_dumpCreateView = false; 222 m_canOpenWindows = false; 219 223 220 224 m_globalFlag.set(false); … … 297 301 { 298 302 return m_dumpTitleChanges; 303 } 304 305 bool TestRunner::shouldDumpCreateView() const 306 { 307 return m_dumpCreateView; 308 } 309 310 bool TestRunner::canOpenWindows() const 311 { 312 return m_canOpenWindows; 299 313 } 300 314 … … 1064 1078 } 1065 1079 1080 void TestRunner::dumpCreateView(const CppArgumentList&, CppVariant* result) 1081 { 1082 m_dumpCreateView = true; 1083 result->setNull(); 1084 } 1085 1086 void TestRunner::setCanOpenWindows(const CppArgumentList&, CppVariant* result) 1087 { 1088 m_canOpenWindows = true; 1089 result->setNull(); 1090 } 1091 1066 1092 void TestRunner::workerThreadCount(CppVariant* result) 1067 1093 { -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h
r139090 r139231 75 75 virtual bool stopProvisionalFrameLoads() const OVERRIDE; 76 76 virtual bool shouldDumpTitleChanges() const OVERRIDE; 77 virtual bool shouldDumpCreateView() const OVERRIDE; 78 virtual bool canOpenWindows() const OVERRIDE; 77 79 78 80 protected: … … 233 235 void dumpTitleChanges(const CppArgumentList&, CppVariant*); 234 236 237 // This function sets a flag that tells the test_shell to dump all calls to 238 // WebViewClient::createView(). 239 // It takes no arguments, and ignores any that may be present. 240 void dumpCreateView(const CppArgumentList&, CppVariant*); 241 242 void setCanOpenWindows(const CppArgumentList&, CppVariant*); 243 235 244 /////////////////////////////////////////////////////////////////////////// 236 245 // Methods interacting with the WebTestProxy … … 314 323 bool m_dumpTitleChanges; 315 324 325 // If true, output a descriptive line each time WebViewClient::createView 326 // is invoked. 327 bool m_dumpCreateView; 328 329 // If true, new windows can be opened via javascript or by plugins. By 330 // default, set to false and can be toggled to true using 331 // setCanOpenWindows(). 332 bool m_canOpenWindows; 333 316 334 // WAV audio data is stored here. 317 335 WebKit::WebArrayBufferView m_audioData; -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp
r139090 r139231 48 48 #include "WebView.h" 49 49 #include "platform/WebCString.h" 50 #include "platform/WebURLRequest.h" 50 51 #include <wtf/StringExtras.h> 51 52 … … 141 142 } 142 143 144 string URLDescription(const GURL& url) 145 { 146 if (url.SchemeIs("file")) 147 return url.ExtractFileName(); 148 return url.possibly_invalid_spec(); 149 } 150 143 151 } 144 152 … … 453 461 } 454 462 463 WebView* WebTestProxyBase::createView(WebFrame*, const WebURLRequest& request, const WebWindowFeatures&, const WebString&, WebNavigationPolicy) 464 { 465 if (!m_testInterfaces->testRunner() || !m_testInterfaces->testRunner()->canOpenWindows()) 466 return 0; 467 if (m_testInterfaces->testRunner()->shouldDumpCreateView()) 468 m_delegate->printMessage(string("createView(") + URLDescription(request.url()) + ")\n"); 469 return 0; 470 } 471 455 472 void WebTestProxyBase::willPerformClientRedirect(WebFrame* frame, const WebURL&, const WebURL& to, double, double) 456 473 { -
trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp
r139090 r139231 204 204 // WebViewClient ------------------------------------------------------------- 205 205 206 WebView* WebViewHost::createView(WebFrame* creator, const WebURLRequest& request, const WebWindowFeatures&, const WebString&, WebNavigationPolicy)206 WebView* WebViewHost::createView(WebFrame* creator, const WebURLRequest&, const WebWindowFeatures&, const WebString&, WebNavigationPolicy) 207 207 { 208 208 if (!testRunner()->canOpenWindows()) 209 209 return 0; 210 if (testRunner()->shouldDumpCreateView())211 fprintf(stdout, "createView(%s)\n", URLDescription(request.url()).c_str());212 210 creator->consumeUserGesture(); 213 211 return m_shell->createNewWindow(WebURL())->webView();
Note: See TracChangeset
for help on using the changeset viewer.