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

Side by Side 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: Use the IO thread on Windows. 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ 5 #ifndef CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_
6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ 6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 546
547 void ReceivedAck(blink::WebInputEvent::Type ack_type, uint32_t ack_state); 547 void ReceivedAck(blink::WebInputEvent::Type ack_type, uint32_t ack_state);
548 548
549 blink::WebInputEvent::Type wait_for_type_; 549 blink::WebInputEvent::Type wait_for_type_;
550 uint32_t ack_result_; 550 uint32_t ack_result_;
551 base::Closure quit_; 551 base::Closure quit_;
552 552
553 DISALLOW_COPY_AND_ASSIGN(InputMsgWatcher); 553 DISALLOW_COPY_AND_ASSIGN(InputMsgWatcher);
554 }; 554 };
555 555
556 // A proxy for ui::TestClipboard for use in browser tests. On Windows,
557 // clipboard is handled on the IO thread. BrowserTestClipboard
558 // hops messages onto the right thread.
559 class BrowserTestClipboard {
560 public:
561 BrowserTestClipboard();
562 ~BrowserTestClipboard();
563
564 void SetUp();
565 void TearDown();
566
567 // Puts text/rtf |rtf| on the clipboard.
568 void SetRtf(const std::string& rtf);
569
570 // Puts plain text |text| on the clipboard.
571 void SetText(const std::string& text);
572
573 private:
574 void RunTaskOnIOThreadAndWait(const base::Closure&);
575 void RunTask(const base::Closure& task, base::WaitableEvent* completion);
576
577 bool is_installed_;
578
579 DISALLOW_COPY_AND_ASSIGN(BrowserTestClipboard);
580 };
581
556 } // namespace content 582 } // namespace content
557 583
558 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ 584 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698