| OLD | NEW |
| 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 Loading... |
| 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_ |
| OLD | NEW |