summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/mock_webclipboard_impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/tools/test_shell/mock_webclipboard_impl.h')
-rw-r--r--webkit/tools/test_shell/mock_webclipboard_impl.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/mock_webclipboard_impl.h b/webkit/tools/test_shell/mock_webclipboard_impl.h
new file mode 100644
index 0000000..6420244
--- /dev/null
+++ b/webkit/tools/test_shell/mock_webclipboard_impl.h
@@ -0,0 +1,38 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
+// source code is governed by a BSD-style license that can be found in the
+// LICENSE file.
+//
+// This file mocks out just enough of the WebClipboard API for running the
+// webkit tests. This is so we can run webkit tests without them sharing a
+// clipboard, which allows for running them in parallel and having the tests
+// not interact with actual user actions.
+
+#ifndef WEBKIT_TOOLS_TEST_SHELL_MOCK_WEBCLIPBOARD_IMPL_H_
+#define WEBKIT_TOOLS_TEST_SHELL_MOCK_WEBCLIPBOARD_IMPL_H_
+
+#include "third_party/WebKit/WebKit/chromium/public/WebClipboard.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
+
+class MockWebClipboardImpl : public WebKit::WebClipboard {
+ public:
+ virtual bool isFormatAvailable(WebKit::WebClipboard::Format);
+
+ virtual WebKit::WebString readPlainText();
+ virtual WebKit::WebString readHTML(WebKit::WebURL*);
+
+ virtual void writeHTML(
+ const WebKit::WebString& htmlText, const WebKit::WebURL&,
+ const WebKit::WebString& plainText, bool writeSmartPaste);
+ virtual void writeURL(
+ const WebKit::WebURL&, const WebKit::WebString& title);
+ virtual void writeImage(
+ const WebKit::WebImage&, const WebKit::WebURL&,
+ const WebKit::WebString& title);
+
+ private:
+ WebKit::WebString m_plainText;
+ WebKit::WebString m_htmlText;
+ bool m_writeSmartPaste;
+};
+
+#endif // WEBKIT_TOOLS_TEST_SHELL_MOCK_WEBCLIPBOARD_IMPL_H_