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

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 creis's comments 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
« no previous file with comments | « content/content_tests.gypi ('k') | content/public/test/browser_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « content/content_tests.gypi ('k') | content/public/test/browser_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698