Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1375)

Unified Diff: content/public/test/browser_test_utils.h

Issue 2146323002: Expose RTF content on the clipboard as strings to pages when pasting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: BrowserTestClipboardScope. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/content_tests.gypi ('k') | content/public/test/browser_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « content/content_tests.gypi ('k') | content/public/test/browser_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698