Title: [143638] trunk/Tools
- Revision
- 143638
- Author
- [email protected]
- Date
- 2013-02-21 12:31:41 -0800 (Thu, 21 Feb 2013)
Log Message
[chromium] document WebTestDelegate and WebTestRunner interfaces
https://bugs.webkit.org/show_bug.cgi?id=110472
Reviewed by Adam Barth.
Also remove the default implementation of the remaining WebTestDelegate
methods now that all embedders provide this interface.
* DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h:
(WebTestDelegate):
* DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h:
(WebTestRunner):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (143637 => 143638)
--- trunk/Tools/ChangeLog 2013-02-21 20:00:33 UTC (rev 143637)
+++ trunk/Tools/ChangeLog 2013-02-21 20:31:41 UTC (rev 143638)
@@ -1,3 +1,18 @@
+2013-02-21 Jochen Eisinger <[email protected]>
+
+ [chromium] document WebTestDelegate and WebTestRunner interfaces
+ https://bugs.webkit.org/show_bug.cgi?id=110472
+
+ Reviewed by Adam Barth.
+
+ Also remove the default implementation of the remaining WebTestDelegate
+ methods now that all embedders provide this interface.
+
+ * DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h:
+ (WebTestDelegate):
+ * DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h:
+ (WebTestRunner):
+
2013-02-19 Mark Hahnenberg <[email protected]>
Objective-C API: Need a way to use the Objective-C _javascript_ API with WebKit
Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h (143637 => 143638)
--- trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h 2013-02-21 20:00:33 UTC (rev 143637)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h 2013-02-21 20:31:41 UTC (rev 143638)
@@ -53,9 +53,15 @@
class WebTestDelegate {
public:
+ // Set and clear the edit command to execute on the next call to
+ // WebViewClient::handleCurrentKeyboardEvent().
virtual void clearEditCommand() = 0;
virtual void setEditCommand(const std::string& name, const std::string& value) = 0;
+
+ // Set the gamepads to return from WebKitPlatformSupport::sampleGamepads().
virtual void setGamepadData(const WebKit::WebGamepads&) = 0;
+
+ // Add a message to the text dump for the layout test.
virtual void printMessage(const std::string& message) = 0;
// The delegate takes ownership of the WebTask objects and is responsible
@@ -63,40 +69,91 @@
virtual void postTask(WebTask*) = 0;
virtual void postDelayedTask(WebTask*, long long ms) = 0;
+ // Register a new isolated filesystem with the given files, and return the
+ // new filesystem id.
virtual WebKit::WebString registerIsolatedFileSystem(const WebKit::WebVector<WebKit::WebString>& absoluteFilenames) = 0;
+
+ // Gets the current time in milliseconds since the UNIX epoch.
virtual long long getCurrentTimeInMillisecond() = 0;
+
+ // Convert the provided relative path into an absolute path.
virtual WebKit::WebString getAbsoluteWebStringFromUTF8Path(const std::string& path) = 0;
- // Methods used by TestRunner.
- // FIXME: Make these methods pure virtual once the TestRunner is part of
- // the public TestRunner API.
- virtual WebKit::WebURL localFileToDataURL(const WebKit::WebURL&) { return WebKit::WebURL(); }
- virtual WebKit::WebURL rewriteLayoutTestsURL(const std::string&) { return WebKit::WebURL(); }
- virtual WebPreferences* preferences() { return 0; }
- virtual void applyPreferences() { };
- virtual std::string makeURLErrorDescription(const WebKit::WebURLError&) { return std::string(); }
- virtual void setClientWindowRect(const WebKit::WebRect&) { }
- virtual void showDevTools() { }
- virtual void closeDevTools() { }
- virtual void evaluateInWebInspector(long, const std::string&) { }
- virtual void clearAllDatabases() { }
- virtual void setDatabaseQuota(int) { }
- virtual void setDeviceScaleFactor(float) { }
- virtual void setFocus(bool) { }
- virtual void setAcceptAllCookies(bool) { }
- virtual std::string pathToLocalResource(const std::string& resource) { return std::string(); }
- virtual void setLocale(const std::string&) { }
- virtual void testFinished() { }
- virtual void testTimedOut() { }
- virtual bool isBeingDebugged() { return false; }
- virtual int layoutTestTimeout() { return 30 * 1000; }
- virtual void closeRemainingWindows() { }
- virtual int navigationEntryCount() { return 0; }
- virtual void goToOffset(int) { }
- virtual void reload() { }
- virtual void loadURLForFrame(const WebKit::WebURL&, const std::string&) { }
- virtual bool allowExternalPages() { return false; }
- virtual void captureHistoryForWindow(WebTestProxyBase*, WebKit::WebVector<WebKit::WebHistoryItem>* history, size_t* currentEntryIndex) { }
+ // Reads in the given file and returns its contents as data URL.
+ virtual WebKit::WebURL localFileToDataURL(const WebKit::WebURL&) = 0;
+
+ // Replaces file:///tmp/LayoutTests/ with the actual path to the
+ // LayoutTests directory.
+ virtual WebKit::WebURL rewriteLayoutTestsURL(const std::string& utf8URL) = 0;
+
+ // Manages the settings to used for layout tests.
+ virtual WebPreferences* preferences() = 0;
+ virtual void applyPreferences() = 0;
+
+ // Returns a textual description of given error.
+ virtual std::string makeURLErrorDescription(const WebKit::WebURLError&) = 0;
+
+ // Resizes the WebView to the given size.
+ virtual void setClientWindowRect(const WebKit::WebRect&) = 0;
+
+ // Opens and closes the inspector.
+ virtual void showDevTools() = 0;
+ virtual void closeDevTools() = 0;
+
+ // Evaluate the given script in the DevTools agent.
+ virtual void evaluateInWebInspector(long callID, const std::string& script) = 0;
+
+ // Controls WebSQL databases.
+ virtual void clearAllDatabases() = 0;
+ virtual void setDatabaseQuota(int) = 0;
+
+ // Controls the device scale factor of the main WebView for hidpi tests.
+ virtual void setDeviceScaleFactor(float) = 0;
+
+ // Controls whether or not the main WebView should be focused.
+ virtual void setFocus(bool) = 0;
+
+ // Controls whether all cookies should be accepted or writing cookies in a
+ // third-party context is blocked.
+ virtual void setAcceptAllCookies(bool) = 0;
+
+ // The same as rewriteLayoutTestsURL unless the resource is a path starting
+ // with /tmp/, then return a file URL to a temporary file.
+ virtual std::string pathToLocalResource(const std::string& resource) = 0;
+
+ // Sets the POSIX locale of the current process.
+ virtual void setLocale(const std::string&) = 0;
+
+ // Invoked when the test finished.
+ virtual void testFinished() = 0;
+
+ // Invoked if the test timed out.
+ virtual void testTimedOut() = 0;
+
+ // If true, never abort a test because of a timeout.
+ virtual bool isBeingDebugged() = 0;
+
+ // The time in milliseconds after which a test is considered to have timed
+ // out.
+ virtual int layoutTestTimeout() = 0;
+
+ // Invoked when the embedder should close all but the main WebView.
+ virtual void closeRemainingWindows() = 0;
+
+ // Returns the length of the back/forward history of the main WebView.
+ virtual int navigationEntryCount() = 0;
+
+ // The following trigger navigations on the main WebViwe.
+ virtual void goToOffset(int offset) = 0;
+ virtual void reload() = 0;
+ virtual void loadURLForFrame(const WebKit::WebURL&, const std::string& frameName) = 0;
+
+ // Returns true if resource requests to external URLs should be permitted.
+ virtual bool allowExternalPages() = 0;
+
+ // Returns the back/forward history for the WebView associated with the
+ // given WebTestProxyBase as well as the index of the current entry.
+ virtual void captureHistoryForWindow(WebTestProxyBase*, WebKit::WebVector<WebKit::WebHistoryItem>*, size_t* currentEntryIndex) = 0;
};
}
Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h (143637 => 143638)
--- trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h 2013-02-21 20:00:33 UTC (rev 143637)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h 2013-02-21 20:31:41 UTC (rev 143638)
@@ -40,11 +40,26 @@
class WebTestRunner {
public:
- virtual bool shouldGeneratePixelResults() = 0;
+ // Returns a mock WebPermissionClient that is used for layout tests. An
+ // embedder should use this for all WebViews it creates.
+ virtual WebKit::WebPermissionClient* webPermissions() const = 0;
+
+ // After WebTestDelegate::testFinished was invoked, the following methods
+ // can be used to determine what kind of dump the main WebTestProxy can
+ // provide.
+
+ // If true, WebTestDelegate::audioData returns an audio dump and no text
+ // or pixel results are available.
virtual bool shouldDumpAsAudio() const = 0;
virtual const WebKit::WebArrayBufferView* audioData() const = 0;
+
+ // Returns true if the call to WebTestProxy::captureTree will invoke
+ // WebTestDelegate::captureHistoryForWindow.
virtual bool shouldDumpBackForwardList() const = 0;
- virtual WebKit::WebPermissionClient* webPermissions() const = 0;
+
+ // Returns true if WebTestProxy::capturePixels should be invoked after
+ // capturing text results.
+ virtual bool shouldGeneratePixelResults() = 0;
};
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes