Chromium Code Reviews| 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 ed6aa653f0ce8045e64ca6cc0d2c4e6e7b9a0588..ab5c41702fda19fe7492a89c6cc3e75a46161656 100644 |
| --- a/content/public/test/browser_test_utils.h |
| +++ b/content/public/test/browser_test_utils.h |
| @@ -17,6 +17,7 @@ |
| #include "base/process/process.h" |
| #include "base/strings/string16.h" |
| #include "build/build_config.h" |
| +#include "cc/output/compositor_frame.h" |
| #include "content/public/browser/browser_message_filter.h" |
| #include "content/public/browser/notification_observer.h" |
| #include "content/public/browser/notification_registrar.h" |
| @@ -424,6 +425,7 @@ class FrameWatcher : public BrowserMessageFilter { |
| // Wait for |frames_to_wait| swap mesages from the compositor. |
| void WaitFrames(int frames_to_wait); |
| + const cc::CompositorFrameMetadata& LastMetadata(); |
|
Charlie Reis
2016/02/16 22:25:22
nit: Add blank line and comment.
dtapuska
2016/02/17 03:34:57
Done.
|
| private: |
| ~FrameWatcher() override; |
| @@ -431,10 +433,11 @@ class FrameWatcher : public BrowserMessageFilter { |
| // Overridden BrowserMessageFilter methods. |
| bool OnMessageReceived(const IPC::Message& message) override; |
| - void ReceivedFrameSwap(); |
| + void ReceivedFrameSwap(cc::CompositorFrameMetadata meta_data); |
| int frames_to_wait_; |
| base::Closure quit_; |
| + cc::CompositorFrameMetadata last_metadata_; |
| DISALLOW_COPY_AND_ASSIGN(FrameWatcher); |
| }; |
| @@ -463,6 +466,31 @@ class MainThreadFrameObserver : public IPC::Listener { |
| DISALLOW_COPY_AND_ASSIGN(MainThreadFrameObserver); |
| }; |
| +// Watches for an input msg to be consumed. |
| +class InputMsgWatcher : public BrowserMessageFilter { |
| + public: |
| + InputMsgWatcher(RenderWidgetHost* render_widget_host, |
| + blink::WebInputEvent::Type type); |
| + |
| + // Wait for until ack message occurs; returning the ack result from |
|
Charlie Reis
2016/02/16 22:25:22
nit: Drop "for"
nit: Change semicolon to a comma,
dtapuska
2016/02/17 03:34:57
Done.
|
| + // the message. |
| + uint32_t WaitForAck(); |
| + |
| + private: |
| + ~InputMsgWatcher() override; |
| + |
| + // Overridden BrowserMessageFilter methods. |
| + bool OnMessageReceived(const IPC::Message& message) override; |
| + |
| + void ReceivedAck(blink::WebInputEvent::Type ack_type, uint32_t ack_state); |
| + |
| + blink::WebInputEvent::Type wait_for_type_; |
| + uint32_t ack_result_; |
| + base::Closure quit_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(InputMsgWatcher); |
| +}; |
| + |
| } // namespace content |
| #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |