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

Unified Diff: content/public/test/browser_test_utils.h

Issue 1631963002: Plumb firing passive event listeners. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_wheel_passive_listeners_2a
Patch Set: Fix windows build Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
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..d4f1af25de00063fc7c6a00619a15c69da6e8dda 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();
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_meta_data_;
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
+ // the message.
+ uint32_t Wait();
+
+ 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_

Powered by Google App Engine
This is Rietveld 408576698