Index: content/public/test/browser_test_utils.h |
diff --git a/content/public/test/browser_test_utils.h b/content/public/test/browser_test_utils.h |
index 3793c111e9576324556645af177e513727a7d430..52f48f18fd7330fcf6c6a9f155c2288064e05d9c 100644 |
--- a/content/public/test/browser_test_utils.h |
+++ b/content/public/test/browser_test_utils.h |
@@ -553,6 +553,27 @@ class InputMsgWatcher : public BrowserMessageFilter { |
DISALLOW_COPY_AND_ASSIGN(InputMsgWatcher); |
}; |
+// Sets up a ui::TestClipboard for use in browser tests. On Windows, |
+// clipboard is handled on the IO thread, BrowserTestClipboardScope |
+// hops messages onto the right thread. |
+class BrowserTestClipboardScope { |
+ public: |
+ // Sets up a ui::TestClipboard. |
+ BrowserTestClipboardScope(); |
+ |
+ // Tears down the clipboard. |
+ ~BrowserTestClipboardScope(); |
+ |
+ // Puts text/rtf |rtf| on the clipboard. |
+ void SetRtf(const std::string& rtf); |
+ |
+ // Puts plain text |text| on the clipboard. |
+ void SetText(const std::string& text); |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(BrowserTestClipboardScope); |
+}; |
+ |
} // namespace content |
#endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |