| 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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 // Watches for an input msg to be consumed. | 545 // Watches for an input msg to be consumed. |
| 546 class InputMsgWatcher : public BrowserMessageFilter { | 546 class InputMsgWatcher : public BrowserMessageFilter { |
| 547 public: | 547 public: |
| 548 InputMsgWatcher(RenderWidgetHost* render_widget_host, | 548 InputMsgWatcher(RenderWidgetHost* render_widget_host, |
| 549 blink::WebInputEvent::Type type); | 549 blink::WebInputEvent::Type type); |
| 550 | 550 |
| 551 // Wait until ack message occurs, returning the ack result from | 551 // Wait until ack message occurs, returning the ack result from |
| 552 // the message. | 552 // the message. |
| 553 uint32_t WaitForAck(); | 553 uint32_t WaitForAck(); |
| 554 | 554 |
| 555 uint32_t last_event_ack_source() const { return ack_source_; } |
| 556 |
| 555 private: | 557 private: |
| 556 ~InputMsgWatcher() override; | 558 ~InputMsgWatcher() override; |
| 557 | 559 |
| 558 // Overridden BrowserMessageFilter methods. | 560 // Overridden BrowserMessageFilter methods. |
| 559 bool OnMessageReceived(const IPC::Message& message) override; | 561 bool OnMessageReceived(const IPC::Message& message) override; |
| 560 | 562 |
| 561 void ReceivedAck(blink::WebInputEvent::Type ack_type, uint32_t ack_state); | 563 void ReceivedAck(blink::WebInputEvent::Type ack_type, |
| 564 uint32_t ack_state, |
| 565 uint32_t ack_source); |
| 562 | 566 |
| 563 blink::WebInputEvent::Type wait_for_type_; | 567 blink::WebInputEvent::Type wait_for_type_; |
| 564 uint32_t ack_result_; | 568 uint32_t ack_result_; |
| 569 uint32_t ack_source_; |
| 565 base::Closure quit_; | 570 base::Closure quit_; |
| 566 | 571 |
| 567 DISALLOW_COPY_AND_ASSIGN(InputMsgWatcher); | 572 DISALLOW_COPY_AND_ASSIGN(InputMsgWatcher); |
| 568 }; | 573 }; |
| 569 | 574 |
| 570 // Sets up a ui::TestClipboard for use in browser tests. On Windows, | 575 // Sets up a ui::TestClipboard for use in browser tests. On Windows, |
| 571 // clipboard is handled on the IO thread, BrowserTestClipboardScope | 576 // clipboard is handled on the IO thread, BrowserTestClipboardScope |
| 572 // hops messages onto the right thread. | 577 // hops messages onto the right thread. |
| 573 class BrowserTestClipboardScope { | 578 class BrowserTestClipboardScope { |
| 574 public: | 579 public: |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 | 710 |
| 706 // The MessageLoopRunner used to spin the message loop. | 711 // The MessageLoopRunner used to spin the message loop. |
| 707 scoped_refptr<MessageLoopRunner> message_loop_runner_; | 712 scoped_refptr<MessageLoopRunner> message_loop_runner_; |
| 708 | 713 |
| 709 DISALLOW_COPY_AND_ASSIGN(ConsoleObserverDelegate); | 714 DISALLOW_COPY_AND_ASSIGN(ConsoleObserverDelegate); |
| 710 }; | 715 }; |
| 711 | 716 |
| 712 } // namespace content | 717 } // namespace content |
| 713 | 718 |
| 714 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 719 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
| OLD | NEW |