WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-99960-20121022083539.patch (text/plain), 18.69 KB, created by
jochen
on 2012-10-21 23:37:00 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
jochen
Created:
2012-10-21 23:37:00 PDT
Size:
18.69 KB
patch
obsolete
>Subversion Revision: 132030 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index ddebaa5220ca8fcd4cd248dfa0869c883a55e37d..4357d77ca43b52398a066374ab63a0e4e87965f4 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,5 +1,55 @@ > 2012-10-21 Jochen Eisinger <jochen@chromium.org> > >+ [chromium] add a method for printing message to the WebTestDelegate >+ https://bugs.webkit.org/show_bug.cgi?id=99960 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When using the TestRunner library from the content_shell, we can't print >+ message directly but need to send them to the browser process. >+ >+ * DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h: >+ (WebTestDelegate): >+ * DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.cpp: >+ (WebTestRunner::AccessibilityController::fallbackCallback): >+ * DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.h: >+ (WebTestRunner::AccessibilityController::setDelegate): >+ (AccessibilityController): >+ * DumpRenderTree/chromium/TestRunner/src/EventSender.cpp: >+ (WebTestRunner): >+ (WebTestRunner::EventSender::dumpFilenameBeingDragged): >+ * DumpRenderTree/chromium/TestRunner/src/GamepadController.cpp: >+ (GamepadController::connect): >+ (GamepadController::disconnect): >+ (GamepadController::setId): >+ (GamepadController::setButtonCount): >+ (GamepadController::setButtonData): >+ (GamepadController::setAxisCount): >+ (GamepadController::setAxisData): >+ (GamepadController::fallbackCallback): >+ * DumpRenderTree/chromium/TestRunner/src/TestDelegate.h: >+ (TestDelegate): >+ * DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp: >+ (TestInterfaces::~TestInterfaces): >+ (TestInterfaces::setDelegate): >+ * DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp: >+ (WebTestInterfaces::Internal): >+ (WebTestRunner::WebTestInterfaces::Internal::printMessage): >+ (WebTestRunner): >+ * DumpRenderTree/chromium/WebViewHost.cpp: >+ (WebViewHost::didBeginEditing): >+ (WebViewHost::lastContextMenuData): >+ (WebViewHost::clearContextMenuData): >+ (WebViewHost::setEditCommand): >+ (WebViewHost::clearEditCommand): >+ (WebViewHost::fillSpellingSuggestionList): >+ (WebViewHost::setGamepadData): >+ (WebViewHost::printMessage): >+ * DumpRenderTree/chromium/WebViewHost.h: >+ (WebViewHost): >+ >+2012-10-21 Jochen Eisinger <jochen@chromium.org> >+ > [chromium] introduce a public API for the TestRunner library > https://bugs.webkit.org/show_bug.cgi?id=99904 > >diff --git a/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h b/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h >index a4f62021ced6f4afe3f4e0f80ea9c47bca097b2f..536bc570a967eb4cbc962a16b3d37c66afadc634 100644 >--- a/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h >+++ b/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h >@@ -49,6 +49,7 @@ public: > virtual void setEditCommand(const std::string& name, const std::string& value) = 0; > virtual WebKit::WebContextMenuData* lastContextMenuData() const = 0; > virtual void setGamepadData(const WebKit::WebGamepads&) = 0; >+ virtual void printMessage(const std::string& message) const = 0; > }; > > } >diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.cpp >index 8e25db2d236a5337ab51bca078d470b4f2b97090..5f1b4f9a92d27553b5365e3caa061e064bd74f9d 100644 >--- a/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.cpp >+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.cpp >@@ -31,6 +31,7 @@ > #include "config.h" > #include "AccessibilityControllerChromium.h" > >+#include "TestDelegate.h" > #include "WebAccessibilityObject.h" > #include "WebElement.h" > #include "WebFrame.h" >@@ -197,8 +198,7 @@ void AccessibilityController::accessibleElementByIdGetterCallback(const CppArgum > > void AccessibilityController::fallbackCallback(const CppArgumentList&, CppVariant* result) > { >- printf("CONSOLE MESSAGE: JavaScript ERROR: unknown method called on " >- "AccessibilityController\n"); >+ m_delegate->printMessage("CONSOLE MESSAGE: JavaScript ERROR: unknown method called on AccessibilityController\n"); > result->setNull(); > } > >diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.h b/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.h >index 4dd7f8705f9ff00ee084f764b667fcd4141188c9..35bf06c56367e01645d01b18d1731922fbadf870 100644 >--- a/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.h >+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.h >@@ -40,6 +40,8 @@ class WebFrame; > class WebView; > } > >+class TestDelegate; >+ > namespace WebTestRunner { > > class AccessibilityController : public CppBoundClass { >@@ -59,6 +61,7 @@ public: > > void notificationReceived(const WebKit::WebAccessibilityObject& target, const char* notificationName); > >+ void setDelegate(TestDelegate* delegate) { m_delegate = delegate; } > void setWebView(WebKit::WebView* webView) { m_webView = webView; } > > private: >@@ -84,6 +87,7 @@ private: > > std::vector<CppVariant> m_notificationCallbacks; > >+ TestDelegate* m_delegate; > WebKit::WebView* m_webView; > }; > >diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp >index 310ae6c48bd4e8ff36917af82310d69fe5f1a48d..d6f72f0de94b8e5b71e8a8779fecd842fb62e3b0 100644 >--- a/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp >+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp >@@ -369,7 +369,7 @@ void EventSender::dumpFilenameBeingDragged(const CppArgumentList&, CppVariant*) > break; > } > } >- printf("Filename being dragged: %s\n", filename.utf8().data()); >+ m_delegate->printMessage(std::string("Filename being dragged: ") + filename.utf8().data() + "\n"); > } > > WebMouseEvent::Button EventSender::getButtonTypeFromButtonNumber(int buttonCode) >diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/GamepadController.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/GamepadController.cpp >index cb36bfdfbbb2e2e58979b6f30f3d6cd1b5f5d738..282ce44de85375268feaf78d3f65095e5a73c2af 100644 >--- a/Tools/DumpRenderTree/chromium/TestRunner/src/GamepadController.cpp >+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/GamepadController.cpp >@@ -67,7 +67,7 @@ void GamepadController::reset() > void GamepadController::connect(const CppArgumentList& args, CppVariant* result) > { > if (args.size() < 1) { >- printf("Invalid args"); >+ m_delegate->printMessage("Invalid args"); > return; > } > int index = args[0].toInt32(); >@@ -85,7 +85,7 @@ void GamepadController::connect(const CppArgumentList& args, CppVariant* result) > void GamepadController::disconnect(const CppArgumentList& args, CppVariant* result) > { > if (args.size() < 1) { >- printf("Invalid args"); >+ m_delegate->printMessage("Invalid args"); > return; > } > int index = args[0].toInt32(); >@@ -103,7 +103,7 @@ void GamepadController::disconnect(const CppArgumentList& args, CppVariant* resu > void GamepadController::setId(const CppArgumentList& args, CppVariant* result) > { > if (args.size() < 2) { >- printf("Invalid args"); >+ m_delegate->printMessage("Invalid args"); > return; > } > int index = args[0].toInt32(); >@@ -121,7 +121,7 @@ void GamepadController::setId(const CppArgumentList& args, CppVariant* result) > void GamepadController::setButtonCount(const CppArgumentList& args, CppVariant* result) > { > if (args.size() < 2) { >- printf("Invalid args"); >+ m_delegate->printMessage("Invalid args"); > return; > } > int index = args[0].toInt32(); >@@ -138,7 +138,7 @@ void GamepadController::setButtonCount(const CppArgumentList& args, CppVariant* > void GamepadController::setButtonData(const CppArgumentList& args, CppVariant* result) > { > if (args.size() < 3) { >- printf("Invalid args"); >+ m_delegate->printMessage("Invalid args"); > return; > } > int index = args[0].toInt32(); >@@ -156,7 +156,7 @@ void GamepadController::setButtonData(const CppArgumentList& args, CppVariant* r > void GamepadController::setAxisCount(const CppArgumentList& args, CppVariant* result) > { > if (args.size() < 2) { >- printf("Invalid args"); >+ m_delegate->printMessage("Invalid args"); > return; > } > int index = args[0].toInt32(); >@@ -173,7 +173,7 @@ void GamepadController::setAxisCount(const CppArgumentList& args, CppVariant* re > void GamepadController::setAxisData(const CppArgumentList& args, CppVariant* result) > { > if (args.size() < 3) { >- printf("Invalid args"); >+ m_delegate->printMessage("Invalid args"); > return; > } > int index = args[0].toInt32(); >@@ -190,7 +190,6 @@ void GamepadController::setAxisData(const CppArgumentList& args, CppVariant* res > > void GamepadController::fallbackCallback(const CppArgumentList&, CppVariant* result) > { >- printf("CONSOLE MESSAGE: JavaScript ERROR: unknown method called on " >- "GamepadController\n"); >+ m_delegate->printMessage("CONSOLE MESSAGE: JavaScript ERROR: unknown method called on GamepadController\n"); > result->setNull(); > } >diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h b/Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h >index 0b0d9622e8d8d944a031e55401147439582416b2..04ae1821189070394011609f15eb95040fd147fa 100644 >--- a/Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h >+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h >@@ -47,6 +47,7 @@ public: > virtual void setEditCommand(const std::string& name, const std::string& value) = 0; > virtual WebKit::WebContextMenuData* lastContextMenuData() const = 0; > virtual void setGamepadData(const WebKit::WebGamepads&) = 0; >+ virtual void printMessage(const std::string& message) const = 0; > }; > > #endif // TestDelegate_h >diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp >index cc821214bf6684f3831312c8bb3538694933edfd..8959bb1ba39e25e192b6f7f4377228a8f5257e90 100644 >--- a/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp >+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp >@@ -58,7 +58,7 @@ TestInterfaces::~TestInterfaces() > // m_gamepadController doesn't depend on WebView. > m_textInputController->setWebView(0); > >- // m_accessibilityController doesn't depend on TestDelegate. >+ m_accessibilityController->setDelegate(0); > m_eventSender->setDelegate(0); > m_gamepadController->setDelegate(0); > // m_textInputController doesn't depend on TestDelegate. >@@ -74,7 +74,7 @@ void TestInterfaces::setWebView(WebView* webView) > > void TestInterfaces::setDelegate(TestDelegate* delegate) > { >- // m_accessibilityController doesn't depend on TestDelegate. >+ m_accessibilityController->setDelegate(delegate); > m_eventSender->setDelegate(delegate); > m_gamepadController->setDelegate(delegate); > // m_textInputController doesn't depend on TestDelegate. >diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp >index 3d5b0de3ec0df396d82f2243005bcbdc7ce81cf4..9490d18136bc41aaa13650ea4caccc9282a3c36f 100644 >--- a/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp >+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp >@@ -63,6 +63,7 @@ public: > virtual void setEditCommand(const std::string& name, const std::string& value); > virtual WebContextMenuData* lastContextMenuData() const; > virtual void setGamepadData(const WebGamepads&); >+ virtual void printMessage(const std::string& message) const; > > private: > TestInterfaces m_interfaces; >@@ -123,6 +124,11 @@ void WebTestInterfaces::Internal::setGamepadData(const WebGamepads& pads) > m_delegate->setGamepadData(pads); > } > >+void WebTestInterfaces::Internal::printMessage(const std::string& message) const >+{ >+ m_delegate->printMessage(message); >+} >+ > WebTestInterfaces::WebTestInterfaces() > { > m_internal = new Internal; >diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.cpp b/Tools/DumpRenderTree/chromium/WebViewHost.cpp >index 106caa9785f53cb722bc0f6ac121f433b33089ff..3880f232b500f4471d0d06e244f6cb6e6e0df95d 100644 >--- a/Tools/DumpRenderTree/chromium/WebViewHost.cpp >+++ b/Tools/DumpRenderTree/chromium/WebViewHost.cpp >@@ -426,7 +426,6 @@ bool WebViewHost::isSelectTrailingWhitespaceEnabled() > void WebViewHost::didBeginEditing() > { > if (!testRunner()->shouldDumpEditingCallbacks()) >- return; > fputs("EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification\n", stdout); > } > >@@ -579,16 +578,6 @@ void WebViewHost::showContextMenu(WebFrame*, const WebContextMenuData& contextMe > m_lastContextMenuData = adoptPtr(new WebContextMenuData(contextMenuData)); > } > >-void WebViewHost::clearContextMenuData() >-{ >- m_lastContextMenuData.clear(); >-} >- >-WebContextMenuData* WebViewHost::lastContextMenuData() const >-{ >- return m_lastContextMenuData.get(); >-} >- > void WebViewHost::setStatusText(const WebString& text) > { > if (!testRunner()->shouldDumpStatusCallbacks()) >@@ -774,11 +763,6 @@ MockSpellCheck* WebViewHost::mockSpellCheck() > return &m_spellcheck; > } > >-void WebViewHost::fillSpellingSuggestionList(const WebKit::WebString& word, WebKit::WebVector<WebKit::WebString>* suggestions) >-{ >- mockSpellCheck()->fillSuggestionList(word, suggestions); >-} >- > WebDeviceOrientationClient* WebViewHost::deviceOrientationClient() > { > return deviceOrientationClientMock(); >@@ -1459,6 +1443,45 @@ void WebViewHost::deliveredIntentFailure(WebFrame* frame, int id, const WebSeria > printf("Web intent failure for id %d\n", id); > } > >+// WebTestDelegate ------------------------------------------------------------ >+ >+WebContextMenuData* WebViewHost::lastContextMenuData() const >+{ >+ return m_lastContextMenuData.get(); >+} >+ >+void WebViewHost::clearContextMenuData() >+{ >+ m_lastContextMenuData.clear(); >+} >+ >+void WebViewHost::setEditCommand(const string& name, const string& value) >+{ >+ m_editCommandName = name; >+ m_editCommandValue = value; >+} >+ >+void WebViewHost::clearEditCommand() >+{ >+ m_editCommandName.clear(); >+ m_editCommandValue.clear(); >+} >+ >+void WebViewHost::fillSpellingSuggestionList(const WebKit::WebString& word, WebKit::WebVector<WebKit::WebString>* suggestions) >+{ >+ mockSpellCheck()->fillSuggestionList(word, suggestions); >+} >+ >+void WebViewHost::setGamepadData(const WebGamepads& pads) >+{ >+ webkit_support::SetGamepadData(pads); >+} >+ >+void WebViewHost::printMessage(const std::string& message) const >+{ >+ printf("%s", message.c_str()); >+} >+ > // Public functions ----------------------------------------------------------- > > WebViewHost::WebViewHost(TestShell* shell) >@@ -1594,18 +1617,6 @@ void WebViewHost::waitForPolicyDelegate() > m_policyDelegateShouldNotifyDone = true; > } > >-void WebViewHost::setEditCommand(const string& name, const string& value) >-{ >- m_editCommandName = name; >- m_editCommandValue = value; >-} >- >-void WebViewHost::clearEditCommand() >-{ >- m_editCommandName.clear(); >- m_editCommandValue.clear(); >-} >- > void WebViewHost::loadURLForFrame(const WebURL& url, const WebString& frameName) > { > if (!url.isValid()) >@@ -1790,11 +1801,6 @@ void WebViewHost::setDeviceScaleFactor(float deviceScaleFactor) > discardBackingStore(); > } > >-void WebViewHost::setGamepadData(const WebGamepads& pads) >-{ >- webkit_support::SetGamepadData(pads); >-} >- > void WebViewHost::setPageTitle(const WebString&) > { > // Nothing to do in layout test. >diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.h b/Tools/DumpRenderTree/chromium/WebViewHost.h >index ba763503aae6d668105a8d9509edac905bdee947..410d19df60964becc38723df5d4053a92c896186 100644 >--- a/Tools/DumpRenderTree/chromium/WebViewHost.h >+++ b/Tools/DumpRenderTree/chromium/WebViewHost.h >@@ -95,13 +95,9 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, > WebKit::WebFrame* topLoadingFrame() { return m_topLoadingFrame; } > void setBlockRedirects(bool block) { m_blocksRedirects = block; } > void setRequestReturnNull(bool returnNull) { m_requestReturnNull = returnNull; } >- virtual void setEditCommand(const std::string& name, const std::string& value) OVERRIDE; >- virtual void clearEditCommand() OVERRIDE; > void setPendingExtraData(PassOwnPtr<TestShellExtraData>); > void setDeviceScaleFactor(float); > >- virtual void setGamepadData(const WebKit::WebGamepads&); >- > void paintRect(const WebKit::WebRect&); > void updatePaintRect(const WebKit::WebRect&); > void paintInvalidatedRegion(); >@@ -116,9 +112,6 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, > const HashSet<WTF::String>& clearHeaders() const { return m_clearHeaders; } > void closeWidget(); > >- virtual WebKit::WebContextMenuData* lastContextMenuData() const OVERRIDE; >- virtual void clearContextMenuData() OVERRIDE; >- > #if ENABLE(INPUT_SPEECH) > MockWebSpeechInputController* speechInputControllerMock() { return m_speechInputControllerMock.get(); } > #endif >@@ -135,6 +128,15 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, > void setPointerLockWillFailSynchronously() { m_pointerLockPlannedResult = PointerLockWillFailSync; } > #endif > >+ // WebTestDelegate. >+ virtual WebKit::WebContextMenuData* lastContextMenuData() const OVERRIDE; >+ virtual void clearContextMenuData() OVERRIDE; >+ virtual void setEditCommand(const std::string& name, const std::string& value) OVERRIDE; >+ virtual void clearEditCommand() OVERRIDE; >+ virtual void fillSpellingSuggestionList(const WebKit::WebString& word, WebKit::WebVector<WebKit::WebString>* suggestions) OVERRIDE; >+ virtual void setGamepadData(const WebKit::WebGamepads&) OVERRIDE; >+ virtual void printMessage(const std::string& message) const OVERRIDE; >+ > // NavigationHost > virtual bool navigate(const TestNavigationEntry&, bool reload); > >@@ -281,7 +283,6 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, > // Spellcheck related helper APIs > MockSpellCheck* mockSpellCheck(); > void finishLastTextCheck(); >- virtual void fillSpellingSuggestionList(const WebKit::WebString& word, WebKit::WebVector<WebKit::WebString>* suggestions) OVERRIDE; > > // Geolocation client mocks for DRTTestRunner > WebKit::WebGeolocationClientMock* geolocationClientMock();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 99960
:
169833
|
169927