Changeset 140889 in webkit
- Timestamp:
- Jan 25, 2013 5:32:15 PM (11 years ago)
- Location:
- trunk/Tools
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r140808 r140889 1 2013-01-25 Jochen Eisinger <jochen@chromium.org> 2 3 [chromium] move tracking of the top loading frame to TestRunner library 4 https://bugs.webkit.org/show_bug.cgi?id=107948 5 6 Reviewed by Adam Barth. 7 8 * DumpRenderTree/chromium/DRTTestRunner.cpp: 9 (DRTTestRunner::WorkQueue::processWorkSoon): 10 (DRTTestRunner::WorkQueue::processWork): 11 (DRTTestRunner::completeNotifyDone): 12 * DumpRenderTree/chromium/DRTTestRunner.h: 13 (DRTTestRunner): 14 * DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h: 15 (WebTestProxyBase): 16 * DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h: 17 (WebTestRunner::WebTestRunner::setTopLoadingFrame): 18 (WebTestRunner::WebTestRunner::topLoadingFrame): 19 * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp: 20 (WebTestRunner::TestRunner::TestRunner): 21 (WebTestRunner::TestRunner::reset): 22 (WebTestRunner::TestRunner::setTopLoadingFrame): 23 (WebTestRunner): 24 (WebTestRunner::TestRunner::topLoadingFrame): 25 * DumpRenderTree/chromium/TestRunner/src/TestRunner.h: 26 (TestRunner): 27 (WebTestRunner::TestRunner::locationChangeDone): 28 * DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp: 29 (WebTestRunner::WebTestProxyBase::didStartProvisionalLoad): 30 (WebTestRunner::WebTestProxyBase::didFailProvisionalLoad): 31 (WebTestRunner::WebTestProxyBase::didFailLoad): 32 (WebTestRunner::WebTestProxyBase::didFinishLoad): 33 (WebTestRunner::WebTestProxyBase::locationChangeDone): 34 (WebTestRunner): 35 * DumpRenderTree/chromium/WebViewHost.cpp: 36 (WebViewHost::reset): 37 (WebViewHost::updateURL): 38 * DumpRenderTree/chromium/WebViewHost.h: 39 (WebViewHost): 40 1 41 2013-01-25 Sheriff Bot <webkit.review.bot@gmail.com> 2 42 -
trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp
r140565 r140889 121 121 void DRTTestRunner::WorkQueue::processWorkSoon() 122 122 { 123 if (m_controller-> m_shell->webViewHost()->topLoadingFrame())123 if (m_controller->topLoadingFrame()) 124 124 return; 125 125 … … 142 142 } 143 143 144 if (!m_controller->m_waitUntilDone && ! shell->webViewHost()->topLoadingFrame())144 if (!m_controller->m_waitUntilDone && !m_controller->topLoadingFrame()) 145 145 shell->testFinished(); 146 146 } … … 181 181 void DRTTestRunner::completeNotifyDone(bool isTimeout) 182 182 { 183 if (m_waitUntilDone && ! m_shell->webViewHost()->topLoadingFrame() && m_workQueue.isEmpty()) {183 if (m_waitUntilDone && !topLoadingFrame() && m_workQueue.isEmpty()) { 184 184 if (isTimeout) 185 185 m_shell->testTimedOut(); -
trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h
r140565 r140889 111 111 112 112 // Called by the webview delegate when the toplevel frame load is done. 113 v oid locationChangeDone();113 virtual void locationChangeDone(); 114 114 115 115 // Called by the webview delegate when the policy delegate runs if the -
trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h
r140668 r140889 149 149 150 150 private: 151 void locationChangeDone(WebKit::WebFrame*); 152 151 153 WebTestInterfaces* m_testInterfaces; 152 154 WebTestDelegate* m_delegate; -
trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h
r140318 r140889 81 81 virtual bool shouldBlockRedirects() const { return false; } 82 82 virtual bool willSendRequestShouldReturnNull() const { return false; } 83 virtual void setTopLoadingFrame(WebKit::WebFrame*, bool) { } 84 virtual WebKit::WebFrame* topLoadingFrame() const { return 0; } 83 85 }; 84 86 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp
r140565 r140889 107 107 , m_delegate(0) 108 108 , m_webView(0) 109 , m_topLoadingFrame(0) 109 110 , m_intentClient(adoptPtr(new EmptyWebDeliveredIntentClient)) 110 111 , m_webPermissions(adoptPtr(new WebPermissions)) … … 302 303 m_webView->disableAutoResizeMode(); 303 304 } 305 m_topLoadingFrame = 0; 304 306 WebSecurityPolicy::resetOriginAccessWhitelists(); 305 307 #if OS(LINUX) || OS(ANDROID) … … 521 523 { 522 524 return m_willSendRequestShouldReturnNull; 525 } 526 527 void TestRunner::setTopLoadingFrame(WebFrame* frame, bool clear) 528 { 529 if (frame->top()->view() != m_webView) 530 return; 531 if (clear) { 532 m_topLoadingFrame = 0; 533 locationChangeDone(); 534 } else if (!m_topLoadingFrame) 535 m_topLoadingFrame = frame; 536 } 537 538 WebFrame* TestRunner::topLoadingFrame() const 539 { 540 return m_topLoadingFrame; 523 541 } 524 542 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h
r140565 r140889 99 99 virtual bool shouldBlockRedirects() const OVERRIDE; 100 100 virtual bool willSendRequestShouldReturnNull() const OVERRIDE; 101 virtual void setTopLoadingFrame(WebKit::WebFrame*, bool) OVERRIDE; 102 virtual WebKit::WebFrame* topLoadingFrame() const OVERRIDE; 101 103 102 104 protected: … … 108 110 109 111 void printErrorMessage(const std::string&); 112 113 // In the Mac code, this is called to trigger the end of a test after the 114 // page has finished loading. From here, we can generate the dump for the 115 // test. 116 virtual void locationChangeDone() { } 110 117 111 118 private: … … 551 558 WebKit::WebView* m_webView; 552 559 560 // This is non-0 IFF a load is in progress. 561 WebKit::WebFrame* m_topLoadingFrame; 562 553 563 // Mock object for testing delivering web intents. 554 564 OwnPtr<WebKit::WebDeliveredIntentClient> m_intentClient; -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp
r140668 r140889 588 588 void WebTestProxyBase::didStartProvisionalLoad(WebFrame* frame) 589 589 { 590 if (m_testInterfaces->testRunner() && !m_testInterfaces->testRunner()->topLoadingFrame()) 591 m_testInterfaces->testRunner()->setTopLoadingFrame(frame, false); 592 590 593 if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) { 591 594 printFrameDescription(m_delegate, frame); … … 617 620 m_delegate->printMessage(" - didFailProvisionalLoadWithError\n"); 618 621 } 622 locationChangeDone(frame); 619 623 } 620 624 … … 673 677 m_delegate->printMessage(" - didFailLoadWithError\n"); 674 678 } 679 locationChangeDone(frame); 675 680 } 676 681 … … 681 686 m_delegate->printMessage(" - didFinishLoadForFrame\n"); 682 687 } 688 locationChangeDone(frame); 683 689 } 684 690 … … 880 886 } 881 887 882 } 888 void WebTestProxyBase::locationChangeDone(WebFrame* frame) 889 { 890 if (!m_testInterfaces->testRunner()) 891 return; 892 if (frame != m_testInterfaces->testRunner()->topLoadingFrame()) 893 return; 894 m_testInterfaces->testRunner()->setTopLoadingFrame(frame, true); 895 } 896 897 } -
trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp
r140808 r140889 689 689 } 690 690 691 void WebViewHost::didStartProvisionalLoad(WebFrame* frame)692 {693 if (!m_topLoadingFrame)694 m_topLoadingFrame = frame;695 696 updateAddressBar(frame->view());697 }698 699 void WebViewHost::didReceiveServerRedirectForProvisionalLoad(WebFrame* frame)700 {701 updateAddressBar(frame->view());702 }703 704 void WebViewHost::didFailProvisionalLoad(WebFrame* frame, const WebURLError& error)705 {706 locationChangeDone(frame);707 708 // Don't display an error page if we're running layout tests, because709 // DumpRenderTree doesn't.710 }711 712 691 void WebViewHost::didCommitProvisionalLoad(WebFrame* frame, bool isNewNavigation) 713 692 { … … 723 702 { 724 703 setPageTitle(title); 725 }726 727 void WebViewHost::didFailLoad(WebFrame* frame, const WebURLError& error)728 {729 locationChangeDone(frame);730 }731 732 void WebViewHost::didFinishLoad(WebFrame* frame)733 {734 updateAddressBar(frame->view());735 locationChangeDone(frame);736 704 } 737 705 … … 1155 1123 m_policyDelegateIsPermissive = false; 1156 1124 m_policyDelegateShouldNotifyDone = false; 1157 m_topLoadingFrame = 0;1158 1125 m_pageId = -1; 1159 1126 m_lastPageIdUpdated = -1; … … 1289 1256 } 1290 1257 1291 void WebViewHost::updateAddressBar(WebView* webView)1292 {1293 WebFrame* mainFrame = webView->mainFrame();1294 WebDataSource* dataSource = mainFrame->dataSource();1295 if (!dataSource)1296 dataSource = mainFrame->provisionalDataSource();1297 if (!dataSource)1298 return;1299 1300 setAddressBarURL(dataSource->request().url());1301 }1302 1303 void WebViewHost::locationChangeDone(WebFrame* frame)1304 {1305 if (frame != m_topLoadingFrame)1306 return;1307 m_topLoadingFrame = 0;1308 testRunner()->locationChangeDone();1309 }1310 1311 1258 void WebViewHost::updateForCommittedLoad(WebFrame* frame, bool isNewNavigation) 1312 1259 { … … 1353 1300 1354 1301 navigationController()->didNavigateToEntry(entry.get()); 1355 updateAddressBar(frame->view());1356 1302 m_lastPageIdUpdated = max(m_lastPageIdUpdated, m_pageId); 1357 1303 } … … 1400 1346 1401 1347 void WebViewHost::setPageTitle(const WebString&) 1402 {1403 // Nothing to do in layout test.1404 }1405 1406 void WebViewHost::setAddressBarURL(const WebURL&)1407 1348 { 1408 1349 // Nothing to do in layout test. -
trunk/Tools/DumpRenderTree/chromium/WebViewHost.h
r140717 r140889 89 89 void waitForPolicyDelegate(); 90 90 void setCustomPolicyDelegate(bool, bool); 91 WebKit::WebFrame* topLoadingFrame() { return m_topLoadingFrame; }92 91 void setPendingExtraData(PassOwnPtr<TestShellExtraData>); 93 92 … … 261 260 virtual void unableToImplementPolicyWithError(WebKit::WebFrame*, const WebKit::WebURLError&); 262 261 virtual void didCreateDataSource(WebKit::WebFrame*, WebKit::WebDataSource*); 263 virtual void didStartProvisionalLoad(WebKit::WebFrame*);264 virtual void didReceiveServerRedirectForProvisionalLoad(WebKit::WebFrame*);265 virtual void didFailProvisionalLoad(WebKit::WebFrame*, const WebKit::WebURLError&);266 262 virtual void didCommitProvisionalLoad(WebKit::WebFrame*, bool isNewNavigation); 267 263 virtual void didClearWindowObject(WebKit::WebFrame*); 268 264 virtual void didReceiveTitle(WebKit::WebFrame*, const WebKit::WebString&, WebKit::WebTextDirection); 269 virtual void didFailLoad(WebKit::WebFrame*, const WebKit::WebURLError&);270 virtual void didFinishLoad(WebKit::WebFrame*);271 265 virtual void didNavigateWithinPage(WebKit::WebFrame*, bool isNewNavigation); 272 266 virtual void willSendRequest(WebKit::WebFrame*, unsigned identifier, WebKit::WebURLRequest&, const WebKit::WebURLResponse&); … … 307 301 void setPageTitle(const WebKit::WebString&); 308 302 309 // Called when the URL of the page changes.310 // Extracts the URL and forwards on to SetAddressBarURL().311 void updateAddressBar(WebKit::WebView*);312 313 // Called when the URL of the page changes.314 // Should be used to update the text of the URL bar.315 void setAddressBarURL(const WebKit::WebURL&);316 317 303 void enterFullScreenNow(); 318 304 void exitFullScreenNow(); 319 320 // In the Mac code, this is called to trigger the end of a test after the321 // page has finished loading. From here, we can generate the dump for the322 // test.323 void locationChangeDone(WebKit::WebFrame*);324 305 325 306 void updateForCommittedLoad(WebKit::WebFrame*, bool isNewNavigation); … … 359 340 // This delegate works for the following widget. 360 341 WebKit::WebWidget* m_webWidget; 361 362 // This is non-0 IFF a load is in progress.363 WebKit::WebFrame* m_topLoadingFrame;364 342 365 343 // For tracking session history. See RenderView.
Note: See TracChangeset
for help on using the changeset viewer.