Title: [135008] trunk/Tools
Revision
135008
Author
joc...@chromium.org
Date
2012-11-16 15:05:33 -0800 (Fri, 16 Nov 2012)

Log Message

[chromium] move stubs from DRTTestRunner to TestRunner
https://bugs.webkit.org/show_bug.cgi?id=102489

Reviewed by Adam Barth.

This is part of moving all methods from DRTTestRunner to TestRunner.
Instead of keeping one stub per method, I'm using a shared stub to
clean up the code.

* DumpRenderTree/chromium/DRTTestRunner.cpp:
(DRTTestRunner::DRTTestRunner):
* DumpRenderTree/chromium/DRTTestRunner.h:
(DRTTestRunner):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
(WebTestRunner::TestRunner::TestRunner):
(WebTestRunner):
(WebTestRunner::TestRunner::fallbackMethod):
(WebTestRunner::TestRunner::notImplemented):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
(WebTestRunner):
(TestRunner):
(WebTestRunner::TestRunner::setDelegate):
* DumpRenderTree/chromium/TestShell.cpp:
(TestShell::createMainWindow):
(TestShell::~TestShell):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (135007 => 135008)


--- trunk/Tools/ChangeLog	2012-11-16 23:02:52 UTC (rev 135007)
+++ trunk/Tools/ChangeLog	2012-11-16 23:05:33 UTC (rev 135008)
@@ -1,5 +1,33 @@
 2012-11-16  Jochen Eisinger  <joc...@chromium.org>
 
+        [chromium] move stubs from DRTTestRunner to TestRunner
+        https://bugs.webkit.org/show_bug.cgi?id=102489
+
+        Reviewed by Adam Barth.
+
+        This is part of moving all methods from DRTTestRunner to TestRunner.
+        Instead of keeping one stub per method, I'm using a shared stub to
+        clean up the code.
+
+        * DumpRenderTree/chromium/DRTTestRunner.cpp:
+        (DRTTestRunner::DRTTestRunner):
+        * DumpRenderTree/chromium/DRTTestRunner.h:
+        (DRTTestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
+        (WebTestRunner::TestRunner::TestRunner):
+        (WebTestRunner):
+        (WebTestRunner::TestRunner::fallbackMethod):
+        (WebTestRunner::TestRunner::notImplemented):
+        * DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
+        (WebTestRunner):
+        (TestRunner):
+        (WebTestRunner::TestRunner::setDelegate):
+        * DumpRenderTree/chromium/TestShell.cpp:
+        (TestShell::createMainWindow):
+        (TestShell::~TestShell):
+
+2012-11-16  Jochen Eisinger  <joc...@chromium.org>
+
         [chromium] fake drag drop operations in the WebTestProxyBase instead of the WebViewHost
         https://bugs.webkit.org/show_bug.cgi?id=102495
 

Modified: trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp (135007 => 135008)


--- trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp	2012-11-16 23:02:52 UTC (rev 135007)
+++ trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp	2012-11-16 23:05:33 UTC (rev 135008)
@@ -137,7 +137,6 @@
     bindMethod("dumpBackForwardList", &DRTTestRunner::dumpBackForwardList);
     bindMethod("dumpChildFramesAsText", &DRTTestRunner::dumpChildFramesAsText);
     bindMethod("dumpChildFrameScrollPositions", &DRTTestRunner::dumpChildFrameScrollPositions);
-    bindMethod("dumpDatabaseCallbacks", &DRTTestRunner::dumpDatabaseCallbacks);
     bindMethod("dumpEditingCallbacks", &DRTTestRunner::dumpEditingCallbacks);
     bindMethod("dumpFrameLoadCallbacks", &DRTTestRunner::dumpFrameLoadCallbacks);
     bindMethod("dumpProgressFinishedCallback", &DRTTestRunner::dumpProgressFinishedCallback);
@@ -160,9 +159,6 @@
     bindMethod("forceRedSelectionColors", &DRTTestRunner::forceRedSelectionColors);
 #if ENABLE(NOTIFICATIONS)
     bindMethod("grantWebNotificationPermission", &DRTTestRunner::grantWebNotificationPermission);
-    bindMethod("denyWebNotificationPermission", &DRTTestRunner::denyWebNotificationPermission);
-    bindMethod("removeAllWebNotificationPermissions", &DRTTestRunner::removeAllWebNotificationPermissions);
-    bindMethod("simulateWebNotificationClick", &DRTTestRunner::simulateWebNotificationClick);
 #endif
     bindMethod("findString", &DRTTestRunner::findString);
     bindMethod("isCommandEnabled", &DRTTestRunner::isCommandEnabled);
@@ -201,7 +197,6 @@
     bindMethod("setDomainRelaxationForbiddenForURLScheme", &DRTTestRunner::setDomainRelaxationForbiddenForURLScheme);
     bindMethod("setAudioData", &DRTTestRunner::setAudioData);
     bindMethod("setGeolocationPermission", &DRTTestRunner::setGeolocationPermission);
-    bindMethod("setIconDatabaseEnabled", &DRTTestRunner::setIconDatabaseEnabled);
     bindMethod("setJavaScriptCanAccessClipboard", &DRTTestRunner::setJavaScriptCanAccessClipboard);
     bindMethod("setMinimumTimerInterval", &DRTTestRunner::setMinimumTimerInterval);
     bindMethod("setMockDeviceOrientation", &DRTTestRunner::setMockDeviceOrientation);
@@ -216,7 +211,6 @@
     bindMethod("setPopupBlockingEnabled", &DRTTestRunner::setPopupBlockingEnabled);
     bindMethod("setPOSIXLocale", &DRTTestRunner::setPOSIXLocale);
     bindMethod("setPrinting", &DRTTestRunner::setPrinting);
-    bindMethod("setScrollbarPolicy", &DRTTestRunner::setScrollbarPolicy);
     bindMethod("setSelectTrailingWhitespaceEnabled", &DRTTestRunner::setSelectTrailingWhitespaceEnabled);
     bindMethod("setTextSubpixelPositioning", &DRTTestRunner::setTextSubpixelPositioning);
     bindMethod("setBackingScaleFactor", &DRTTestRunner::setBackingScaleFactor);
@@ -247,35 +241,14 @@
     bindMethod("setStorageAllowed", &DRTTestRunner::setStorageAllowed);
     bindMethod("setPluginsAllowed", &DRTTestRunner::setPluginsAllowed);
 
-    // The following are stubs.
     bindMethod("abortModal", &DRTTestRunner::abortModal);
-    bindMethod("addDisallowedURL", &DRTTestRunner::addDisallowedURL);
-    bindMethod("applicationCacheDiskUsageForOrigin", &DRTTestRunner::applicationCacheDiskUsageForOrigin);
     bindMethod("callShouldCloseOnWebView", &DRTTestRunner::callShouldCloseOnWebView);
-    bindMethod("clearAllApplicationCaches", &DRTTestRunner::clearAllApplicationCaches);
-    bindMethod("clearApplicationCacheForOrigin", &DRTTestRunner::clearApplicationCacheForOrigin);
-    bindMethod("clearBackForwardList", &DRTTestRunner::clearBackForwardList);
-    bindMethod("keepWebHistory", &DRTTestRunner::keepWebHistory);
-    bindMethod("setApplicationCacheOriginQuota", &DRTTestRunner::setApplicationCacheOriginQuota);
-    bindMethod("setCallCloseOnWebViews", &DRTTestRunner::setCallCloseOnWebViews);
-    bindMethod("setMainFrameIsFirstResponder", &DRTTestRunner::setMainFrameIsFirstResponder);
-    bindMethod("setPrivateBrowsingEnabled", &DRTTestRunner::setPrivateBrowsingEnabled);
-    bindMethod("setUseDashboardCompatibilityMode", &DRTTestRunner::setUseDashboardCompatibilityMode);
-    bindMethod("deleteAllLocalStorage", &DRTTestRunner::deleteAllLocalStorage);
-    bindMethod("localStorageDiskUsageForOrigin", &DRTTestRunner::localStorageDiskUsageForOrigin);
-    bindMethod("originsWithLocalStorage", &DRTTestRunner::originsWithLocalStorage);
-    bindMethod("deleteLocalStorageForOrigin", &DRTTestRunner::deleteLocalStorageForOrigin);
-    bindMethod("observeStorageTrackerNotifications", &DRTTestRunner::observeStorageTrackerNotifications);
-    bindMethod("syncLocalStorage", &DRTTestRunner::syncLocalStorage);
     bindMethod("setShouldStayOnPageAfterHandlingBeforeUnload", &DRTTestRunner::setShouldStayOnPageAfterHandlingBeforeUnload);
     bindMethod("enableFixedLayoutMode", &DRTTestRunner::enableFixedLayoutMode);
     bindMethod("setFixedLayoutSize", &DRTTestRunner::setFixedLayoutSize);
     bindMethod("selectionAsMarkup", &DRTTestRunner::selectionAsMarkup);
     bindMethod("textSurroundingNode", &DRTTestRunner::textSurroundingNode);
 
-    // The fallback method is called when an unknown method is invoked.
-    bindFallbackMethod(&DRTTestRunner::fallbackMethod);
-
     // Shared properties.
     // globalFlag is used by a number of layout tests in
     // LayoutTests\http\tests\security\dataURL.
@@ -354,12 +327,6 @@
     result->setNull();
 }
 
-void DRTTestRunner::dumpDatabaseCallbacks(const CppArgumentList&, CppVariant* result)
-{
-    // Do nothing; we don't use this flag anywhere for now
-    result->setNull();
-}
-
 void DRTTestRunner::dumpEditingCallbacks(const CppArgumentList&, CppVariant* result)
 {
     m_dumpEditingCallbacks = true;
@@ -855,49 +822,6 @@
     result->setNull();
 }
 
-void DRTTestRunner::setUseDashboardCompatibilityMode(const CppArgumentList&, CppVariant* result)
-{
-    // We have no need to support Dashboard Compatibility Mode (mac-only)
-    result->setNull();
-}
-
-void DRTTestRunner::clearAllApplicationCaches(const CppArgumentList&, CppVariant* result)
-{
-    // FIXME: Implement to support application cache quotas.
-    result->setNull();
-}
-
-void DRTTestRunner::clearApplicationCacheForOrigin(const CppArgumentList&, CppVariant* result)
-{
-    // FIXME: Implement to support deleting all application cache for an origin.
-    result->setNull();
-}
-
-void DRTTestRunner::setApplicationCacheOriginQuota(const CppArgumentList&, CppVariant* result)
-{
-    // FIXME: Implement to support application cache quotas.
-    result->setNull();
-}
-
-void DRTTestRunner::originsWithApplicationCache(const CppArgumentList&, CppVariant* result)
-{
-    // FIXME: Implement to support getting origins that have application caches.
-    result->setNull();
-}
-
-void DRTTestRunner::applicationCacheDiskUsageForOrigin(const CppArgumentList&, CppVariant* result)
-{
-    // FIXME: Implement to support getting disk usage by all application cache for an origin.
-    result->setNull();
-}
-
-void DRTTestRunner::setScrollbarPolicy(const CppArgumentList&, CppVariant* result)
-{
-    // FIXME: implement.
-    // Currently only has a non-null implementation on QT.
-    result->setNull();
-}
-
 void DRTTestRunner::setCustomPolicyDelegate(const CppArgumentList& arguments, CppVariant* result)
 {
     if (arguments.size() > 0 && arguments[0].isBool()) {
@@ -1129,12 +1053,6 @@
     result->set(numberOfActiveAnimations());
 }
 
-void DRTTestRunner::setIconDatabaseEnabled(const CppArgumentList&, CppVariant* result)
-{
-    // We don't use the WebKit icon database.
-    result->setNull();
-}
-
 void DRTTestRunner::callShouldCloseOnWebView(const CppArgumentList&, CppVariant* result)
 {
     result->set(m_shell->webView()->dispatchBeforeUnloadEvent());
@@ -1153,24 +1071,6 @@
     result->set(true);
 }
 
-void DRTTestRunner::denyWebNotificationPermission(const CppArgumentList& arguments, CppVariant* result)
-{
-    // FIXME: Implement.
-    result->setNull();
-}
-
-void DRTTestRunner::removeAllWebNotificationPermissions(const CppArgumentList& arguments, CppVariant* result)
-{
-    // FIXME: Implement.
-    result->setNull();
-}
-
-void DRTTestRunner::simulateWebNotificationClick(const CppArgumentList& arguments, CppVariant* result)
-{
-    // FIXME: Implement.
-    result->setNull();
-}
-
 void DRTTestRunner::simulateLegacyWebNotificationClick(const CppArgumentList& arguments, CppVariant* result)
 {
     if (arguments.size() != 1 || !arguments[0].isString()) {
@@ -1199,15 +1099,6 @@
         m_deferMainResourceDataLoad = cppVariantToBool(arguments[0]);
 }
 
-//
-// Unimplemented stubs
-//
-
-void DRTTestRunner::setMainFrameIsFirstResponder(const CppArgumentList& arguments, CppVariant* result)
-{
-    result->setNull();
-}
-
 void DRTTestRunner::dumpSelectionRect(const CppArgumentList& arguments, CppVariant* result)
 {
     m_dumpSelectionRect = true;
@@ -1245,31 +1136,6 @@
     result->setNull();
 }
 
-void DRTTestRunner::clearBackForwardList(const CppArgumentList& arguments, CppVariant* result)
-{
-    result->setNull();
-}
-
-void DRTTestRunner::keepWebHistory(const CppArgumentList& arguments,  CppVariant* result)
-{
-    result->setNull();
-}
-
-void DRTTestRunner::addDisallowedURL(const CppArgumentList& arguments, CppVariant* result)
-{
-    result->setNull();
-}
-
-void DRTTestRunner::setCallCloseOnWebViews(const CppArgumentList& arguments, CppVariant* result)
-{
-    result->setNull();
-}
-
-void DRTTestRunner::setPrivateBrowsingEnabled(const CppArgumentList& arguments, CppVariant* result)
-{
-    result->setNull();
-}
-
 void DRTTestRunner::setJavaScriptCanAccessClipboard(const CppArgumentList& arguments, CppVariant* result)
 {
     if (arguments.size() > 0 && arguments[0].isBool()) {
@@ -1567,12 +1433,6 @@
     m_shell->applyPreferences();
 }
 
-void DRTTestRunner::fallbackMethod(const CppArgumentList&, CppVariant* result)
-{
-    printf("CONSOLE MESSAGE: _javascript_ ERROR: unknown method called on DRTTestRunner\n");
-    result->setNull();
-}
-
 void DRTTestRunner::addOriginAccessWhitelistEntry(const CppArgumentList& arguments, CppVariant* result)
 {
     result->setNull();
@@ -1948,36 +1808,6 @@
     input->setValue(cppVariantToWebString(arguments[1]), true);
 }
 
-void DRTTestRunner::deleteAllLocalStorage(const CppArgumentList& arguments, CppVariant*)
-{
-    // Not Implemented
-}
-
-void DRTTestRunner::localStorageDiskUsageForOrigin(const CppArgumentList& arguments, CppVariant*)
-{
-    // Not Implemented
-}
-
-void DRTTestRunner::originsWithLocalStorage(const CppArgumentList& arguments, CppVariant*)
-{
-    // Not Implemented
-}
-
-void DRTTestRunner::deleteLocalStorageForOrigin(const CppArgumentList& arguments, CppVariant*)
-{
-    // Not Implemented
-}
-
-void DRTTestRunner::observeStorageTrackerNotifications(const CppArgumentList&, CppVariant*)
-{
-    // Not Implemented
-}
-
-void DRTTestRunner::syncLocalStorage(const CppArgumentList&, CppVariant*)
-{
-    // Not Implemented
-}
-
 void DRTTestRunner::setShouldStayOnPageAfterHandlingBeforeUnload(const CppArgumentList& arguments, CppVariant* result)
 {
     if (arguments.size() == 1 && arguments[0].isBool())

Modified: trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h (135007 => 135008)


--- trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h	2012-11-16 23:02:52 UTC (rev 135007)
+++ trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h	2012-11-16 23:05:33 UTC (rev 135008)
@@ -79,13 +79,6 @@
     // It takes an optional argument, whether to dump pixels results or not.
     void dumpAsText(const CppArgumentList&, CppVariant*);
 
-    // This function should set a flag that tells the test_shell to print a line
-    // of descriptive text for each database command. It should take no
-    // arguments, and ignore any that may be present. However, at the moment, we
-    // don't have any DB function that prints messages, so for now this function
-    // doesn't do anything.
-    void dumpDatabaseCallbacks(const CppArgumentList&, CppVariant*);
-
     // This function sets a flag that tells the test_shell to print a line of
     // descriptive text for each editing command. It takes no arguments, and
     // ignores any that may be present.
@@ -184,13 +177,6 @@
     // Passes this preference through to WebSettings.
     void setAuthorAndUserStylesEnabled(const CppArgumentList&, CppVariant*);
 
-    // Puts Webkit in "dashboard compatibility mode", which is used in obscure
-    // Mac-only circumstances. It's not really necessary, and will most likely
-    // never be used by Chrome, but some layout tests depend on its presence.
-    void setUseDashboardCompatibilityMode(const CppArgumentList&, CppVariant*);
-
-    void setScrollbarPolicy(const CppArgumentList&, CppVariant*);
-
     // Causes navigation actions just printout the intended navigation instead
     // of taking you to the page. This is used for cases like mailto, where you
     // don't actually want to open the mail program.
@@ -236,15 +222,11 @@
     void enableAutoResizeMode(const CppArgumentList&, CppVariant*);
     void disableAutoResizeMode(const CppArgumentList&, CppVariant*);
     void numberOfActiveAnimations(const CppArgumentList&, CppVariant*);
-    void setIconDatabaseEnabled(const CppArgumentList&, CppVariant*);
     void dumpSelectionRect(const CppArgumentList&, CppVariant*);
 
 #if ENABLE(NOTIFICATIONS)
     // Grants permission for desktop notifications to an origin
     void grantWebNotificationPermission(const CppArgumentList&, CppVariant*);
-    void denyWebNotificationPermission(const CppArgumentList&, CppVariant*);
-    void removeAllWebNotificationPermissions(const CppArgumentList&, CppVariant*);
-    void simulateWebNotificationClick(const CppArgumentList&, CppVariant*);
     // Simulates a click on a desktop notification.
     void simulateLegacyWebNotificationClick(const CppArgumentList&, CppVariant*);
 #endif
@@ -256,20 +238,12 @@
     void setAudioData(const CppArgumentList&, CppVariant*);
     const WebKit::WebArrayBufferView& audioData() const { return m_audioData; } 
 
-    // The following are only stubs.
-    // FIXME: Implement any of these that are needed to pass the layout tests.
     void dumpTitleChanges(const CppArgumentList&, CppVariant*);
-    void setMainFrameIsFirstResponder(const CppArgumentList&, CppVariant*);
     void display(const CppArgumentList&, CppVariant*);
     void displayInvalidatedRegion(const CppArgumentList&, CppVariant*);
     void testRepaint(const CppArgumentList&, CppVariant*);
     void repaintSweepHorizontally(const CppArgumentList&, CppVariant*);
-    void clearBackForwardList(const CppArgumentList&, CppVariant*);
-    void keepWebHistory(const CppArgumentList&, CppVariant*);
-    void addDisallowedURL(const CppArgumentList&, CppVariant*);
     void callShouldCloseOnWebView(const CppArgumentList&, CppVariant*);
-    void setCallCloseOnWebViews(const CppArgumentList&, CppVariant*);
-    void setPrivateBrowsingEnabled(const CppArgumentList&, CppVariant*);
 
     void setJavaScriptCanAccessClipboard(const CppArgumentList&, CppVariant*);
     void setXSSAuditorEnabled(const CppArgumentList&, CppVariant*);
@@ -284,28 +258,10 @@
     void setIsolatedWorldSecurityOrigin(const CppArgumentList&, CppVariant*);
     void setIsolatedWorldContentSecurityPolicy(const CppArgumentList&, CppVariant*);
 
-    // The fallback method is called when a nonexistent method is called on
-    // the layout test controller object.
-    // It is usefull to catch typos in the _javascript_ code (a few layout tests
-    // do have typos in them) and it allows the script to continue running in
-    // that case (as the Mac does).
-    void fallbackMethod(const CppArgumentList&, CppVariant*);
-
     // Allows layout tests to manage origins' whitelisting.
     void addOriginAccessWhitelistEntry(const CppArgumentList&, CppVariant*);
     void removeOriginAccessWhitelistEntry(const CppArgumentList&, CppVariant*);
 
-    // Clears all application caches.
-    void clearAllApplicationCaches(const CppArgumentList&, CppVariant*);
-    // Clears an application cache for an origin.
-    void clearApplicationCacheForOrigin(const CppArgumentList&, CppVariant*);
-    // Returns origins that have application caches.
-    void originsWithApplicationCache(const CppArgumentList&, CppVariant*);
-    // Sets the application cache quota for the localhost origin.
-    void setApplicationCacheOriginQuota(const CppArgumentList&, CppVariant*);
-    // Returns disk usage by all application caches for an origin.
-    void applicationCacheDiskUsageForOrigin(const CppArgumentList&, CppVariant*);
-
     // Clears all databases.
     void clearAllDatabases(const CppArgumentList&, CppVariant*);
     // Sets the default quota for all origins
@@ -373,14 +329,6 @@
     // Forwards the setValueForUser() call to the element.
     void setValueForUser(const CppArgumentList&, CppVariant*);
 
-    // LocalStorage origin-related
-    void deleteAllLocalStorage(const CppArgumentList&, CppVariant*);
-    void originsWithLocalStorage(const CppArgumentList&, CppVariant*);
-    void deleteLocalStorageForOrigin(const CppArgumentList&, CppVariant*);
-    void localStorageDiskUsageForOrigin(const CppArgumentList&, CppVariant*);
-    void observeStorageTrackerNotifications(const CppArgumentList&, CppVariant*);
-    void syncLocalStorage(const CppArgumentList&, CppVariant*);
-
     // WebPermissionClient related.
     void setImagesAllowed(const CppArgumentList&, CppVariant*);
     void setScriptsAllowed(const CppArgumentList&, CppVariant*);

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp (135007 => 135008)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp	2012-11-16 23:02:52 UTC (rev 135007)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp	2012-11-16 23:05:33 UTC (rev 135008)
@@ -32,10 +32,53 @@
 #include "config.h"
 #include "TestRunner.h"
 
+#include "WebTestDelegate.h"
+
 namespace WebTestRunner {
 
 TestRunner::TestRunner()
+    : m_delegate(0)
 {
+    // The following are stubs.
+    bindMethod("dumpDatabaseCallbacks", &TestRunner::notImplemented);
+#if ENABLE(NOTIFICATIONS)
+    bindMethod("denyWebNotificationPermission", &TestRunner::notImplemented);
+    bindMethod("removeAllWebNotificationPermissions", &TestRunner::notImplemented);
+    bindMethod("simulateWebNotificationClick", &TestRunner::notImplemented);
+#endif
+    bindMethod("setIconDatabaseEnabled", &TestRunner::notImplemented);
+    bindMethod("setScrollbarPolicy", &TestRunner::notImplemented);
+    bindMethod("clearAllApplicationCaches", &TestRunner::notImplemented);
+    bindMethod("clearApplicationCacheForOrigin", &TestRunner::notImplemented);
+    bindMethod("clearBackForwardList", &TestRunner::notImplemented);
+    bindMethod("keepWebHistory", &TestRunner::notImplemented);
+    bindMethod("setApplicationCacheOriginQuota", &TestRunner::notImplemented);
+    bindMethod("setCallCloseOnWebViews", &TestRunner::notImplemented);
+    bindMethod("setMainFrameIsFirstResponder", &TestRunner::notImplemented);
+    bindMethod("setPrivateBrowsingEnabled", &TestRunner::notImplemented);
+    bindMethod("setUseDashboardCompatibilityMode", &TestRunner::notImplemented);
+    bindMethod("deleteAllLocalStorage", &TestRunner::notImplemented);
+    bindMethod("localStorageDiskUsageForOrigin", &TestRunner::notImplemented);
+    bindMethod("originsWithLocalStorage", &TestRunner::notImplemented);
+    bindMethod("deleteLocalStorageForOrigin", &TestRunner::notImplemented);
+    bindMethod("observeStorageTrackerNotifications", &TestRunner::notImplemented);
+    bindMethod("syncLocalStorage", &TestRunner::notImplemented);
+    bindMethod("addDisallowedURL", &TestRunner::notImplemented);
+    bindMethod("applicationCacheDiskUsageForOrigin", &TestRunner::notImplemented);
+
+    // The fallback method is called when an unknown method is invoked.
+    bindFallbackMethod(&TestRunner::fallbackMethod);
 }
 
+void TestRunner::fallbackMethod(const CppArgumentList&, CppVariant* result)
+{
+    m_delegate->printMessage("CONSOLE MESSAGE: _javascript_ ERROR: unknown method called on TestRunner\n");
+    result->setNull();
 }
+
+void TestRunner::notImplemented(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+}

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h (135007 => 135008)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h	2012-11-16 23:02:52 UTC (rev 135007)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h	2012-11-16 23:05:33 UTC (rev 135008)
@@ -36,9 +36,28 @@
 
 namespace WebTestRunner {
 
+class WebTestDelegate;
+
 class TestRunner : public CppBoundClass {
 public:
     TestRunner();
+
+    // FIXME: once DRTTestRunner is moved entirely to this class, change this
+    // method to take a TestDelegate* instead.
+    void setDelegate(WebTestDelegate* delegate) { m_delegate = delegate; }
+
+private:
+    // The fallback method is called when a nonexistent method is called on
+    // the layout test controller object.
+    // It is usefull to catch typos in the _javascript_ code (a few layout tests
+    // do have typos in them) and it allows the script to continue running in
+    // that case (as the Mac does).
+    void fallbackMethod(const CppArgumentList&, CppVariant*);
+
+    // Stub for not implemented methods.
+    void notImplemented(const CppArgumentList&, CppVariant*);
+
+    WebTestDelegate* m_delegate;
 };
 
 }

Modified: trunk/Tools/DumpRenderTree/chromium/TestShell.cpp (135007 => 135008)


--- trunk/Tools/DumpRenderTree/chromium/TestShell.cpp	2012-11-16 23:02:52 UTC (rev 135007)
+++ trunk/Tools/DumpRenderTree/chromium/TestShell.cpp	2012-11-16 23:05:33 UTC (rev 135008)
@@ -185,6 +185,7 @@
     m_webView = m_webViewHost->webView();
     m_testInterfaces->setDelegate(m_webViewHost.get());
     m_testInterfaces->setWebView(m_webView);
+    m_testRunner->setDelegate(m_webViewHost.get());
     m_drtDevToolsAgent->setWebView(m_webView);
 }
 
@@ -192,6 +193,7 @@
 {
     m_testInterfaces->setDelegate(0);
     m_testInterfaces->setWebView(0);
+    m_testRunner->setDelegate(0);
     m_drtDevToolsAgent->setWebView(0);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to