| 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..17937263d40b05140000368964225d272e92f7c1 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"
|
| @@ -425,16 +426,21 @@ class FrameWatcher : public BrowserMessageFilter {
|
| // Wait for |frames_to_wait| swap mesages from the compositor.
|
| void WaitFrames(int frames_to_wait);
|
|
|
| + // Return the meta data received in the last compositor
|
| + // swap frame.
|
| + const cc::CompositorFrameMetadata& LastMetadata();
|
| +
|
| private:
|
| ~FrameWatcher() override;
|
|
|
| // 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 +469,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 until ack message occurs, returning the ack result from
|
| + // 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_
|
|
|