Changeset 143480 in webkit
- Timestamp:
- Feb 20, 2013, 10:45:45 AM (12 years ago)
- Location:
- trunk/Tools
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r143470 r143480 1 2013-02-20 Jochen Eisinger <jochen@chromium.org> 2 3 [chromium] use a WebTestProxyBase pointer to identify the window we need the history for 4 https://bugs.webkit.org/show_bug.cgi?id=110346 5 6 Reviewed by Adam Barth. 7 8 Using an index is very brittle, as the TestRunner API does not define 9 any ordering of windows. 10 11 Also, make TestRunner::shouldDumpBackForwardList() so content shell can 12 trigger the capturing in the browser process before generating the 13 text dump. 14 15 * DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h: 16 (WebTestRunner): 17 (WebTestRunner::WebTestDelegate::captureHistoryForWindow): 18 * DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h: 19 (WebTestRunner): 20 * DumpRenderTree/chromium/TestRunner/src/TestRunner.h: 21 (TestRunner): 22 * DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp: 23 (WebTestRunner::WebTestProxyBase::captureTree): 24 * DumpRenderTree/chromium/WebViewHost.cpp: 25 (WebViewHost::captureHistoryForWindow): 26 * DumpRenderTree/chromium/WebViewHost.h: 27 (WebViewHost): 28 1 29 2013-02-19 Rouslan Solomakhin <rouslan@chromium.org> 2 30 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h
r143457 r143480 37 37 #include <string> 38 38 39 #define WEBTESTRUNNER_NEW_HISTORY_CAPTURE 40 39 41 namespace WebKit { 40 42 class WebGamepads; … … 48 50 struct WebPreferences; 49 51 class WebTask; 52 class WebTestProxyBase; 50 53 51 54 class WebTestDelegate { … … 94 97 virtual void loadURLForFrame(const WebKit::WebURL&, const std::string&) { } 95 98 virtual bool allowExternalPages() { return false; } 96 virtual void captureHistoryForWindow( size_t windowIndex, WebKit::WebVector<WebKit::WebHistoryItem>* history, size_t* currentEntryIndex) { }99 virtual void captureHistoryForWindow(WebTestProxyBase*, WebKit::WebVector<WebKit::WebHistoryItem>* history, size_t* currentEntryIndex) { } 97 100 }; 98 101 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h
r142929 r143480 44 44 virtual bool shouldDumpAsAudio() const = 0; 45 45 virtual const WebKit::WebArrayBufferView* audioData() const = 0; 46 virtual bool shouldDumpBackForwardList() const = 0; 46 47 virtual WebKit::WebPermissionClient* webPermissions() const = 0; 47 48 }; -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h
r143457 r143480 79 79 virtual bool shouldDumpAsAudio() const OVERRIDE; 80 80 virtual const WebKit::WebArrayBufferView* audioData() const OVERRIDE; 81 virtual bool shouldDumpBackForwardList() const OVERRIDE; 81 82 virtual WebKit::WebPermissionClient* webPermissions() const OVERRIDE; 82 83 … … 87 88 bool isPrinting() const; 88 89 bool shouldDumpAsText(); 89 bool shouldDumpBackForwardList() const;90 90 bool shouldDumpChildFrameScrollPositions() const; 91 91 bool shouldDumpChildFramesAsText() const; -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp
r143457 r143480 401 401 } 402 402 403 string dumpAllBackForwardLists( WebTestDelegate* delegate, unsigned windowCount)403 string dumpAllBackForwardLists(TestInterfaces* interfaces, WebTestDelegate* delegate) 404 404 { 405 405 string result; 406 for (unsigned i = 0; i < windowCount; ++i) { 406 const vector<WebTestProxyBase*>& windowList = interfaces->windowList(); 407 for (unsigned i = 0; i < windowList.size(); ++i) { 407 408 size_t currentEntryIndex = 0; 408 409 WebVector<WebHistoryItem> history; 409 delegate->captureHistoryForWindow( i, &history, ¤tEntryIndex);410 delegate->captureHistoryForWindow(windowList.at(i), &history, ¤tEntryIndex); 410 411 dumpBackForwardList(history, currentEntryIndex, result); 411 412 } … … 489 490 490 491 if (m_testInterfaces->testRunner()->shouldDumpBackForwardList()) 491 dataUtf8 += dumpAllBackForwardLists(m_ delegate, m_testInterfaces->windowList().size());492 dataUtf8 += dumpAllBackForwardLists(m_testInterfaces, m_delegate); 492 493 493 494 return dataUtf8; -
trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp
r143457 r143480 714 714 } 715 715 716 void WebViewHost::captureHistoryForWindow(size_t windowIndex, WebVector<WebHistoryItem>* history, size_t* currentEntryIndex) 717 { 718 m_shell->captureHistoryForWindow(windowIndex, history, currentEntryIndex); 716 void WebViewHost::captureHistoryForWindow(WebTestProxyBase* proxy, WebVector<WebHistoryItem>* history, size_t* currentEntryIndex) 717 { 718 for (size_t i = 0; i < m_shell->windowList().size(); ++i) { 719 if (m_shell->windowList()[i]->proxy() == proxy) 720 m_shell->captureHistoryForWindow(i, history, currentEntryIndex); 721 } 719 722 } 720 723 -
trunk/Tools/DumpRenderTree/chromium/WebViewHost.h
r143457 r143480 120 120 virtual void loadURLForFrame(const WebKit::WebURL&, const std::string& frameName) OVERRIDE; 121 121 virtual bool allowExternalPages() OVERRIDE; 122 virtual void captureHistoryForWindow( size_t windowIndex, WebKit::WebVector<WebKit::WebHistoryItem>*, size_t* currentEntryIndex) OVERRIDE;122 virtual void captureHistoryForWindow(WebTestRunner::WebTestProxyBase*, WebKit::WebVector<WebKit::WebHistoryItem>*, size_t* currentEntryIndex) OVERRIDE; 123 123 124 124 // NavigationHost
Note:
See TracChangeset
for help on using the changeset viewer.