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

Unified Diff: content/browser/renderer_host/input/non_blocking_event_browsertest.cc

Issue 2780373002: Use observer pattern instead of sniffing SwapCompositorFrame IPC (Closed)
Patch Set: Addressed comments Created 3 years, 8 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/browser/renderer_host/input/non_blocking_event_browsertest.cc
diff --git a/content/browser/renderer_host/input/non_blocking_event_browsertest.cc b/content/browser/renderer_host/input/non_blocking_event_browsertest.cc
index 25f2ed3b5133875aef03b6a5ee525e3913fcf553..fe5ed602160a56d7572886ea1dd587732b39e968 100644
--- a/content/browser/renderer_host/input/non_blocking_event_browsertest.cc
+++ b/content/browser/renderer_host/input/non_blocking_event_browsertest.cc
@@ -127,8 +127,7 @@ class NonBlockingEventBrowserTest : public ContentBrowserTest {
ExecuteScriptAndExtractInt("document.documentElement.scrollHeight");
EXPECT_EQ(kWebsiteHeight, scrollHeight);
- scoped_refptr<FrameWatcher> frame_watcher(new FrameWatcher());
- frame_watcher->AttachTo(shell()->web_contents());
+ FrameWatcher frame_watcher(shell()->web_contents());
scoped_refptr<InputMsgWatcher> input_msg_watcher(
new InputMsgWatcher(GetWidgetHost(), blink::WebInputEvent::MouseWheel));
@@ -141,8 +140,8 @@ class NonBlockingEventBrowserTest : public ContentBrowserTest {
// Expect that the compositor scrolled at least one pixel while the
// main thread was in a busy loop.
- while (frame_watcher->LastMetadata().root_scroll_offset.y() <= 0)
- frame_watcher->WaitFrames(1);
+ while (frame_watcher.LastMetadata().root_scroll_offset.y() <= 0)
+ frame_watcher.WaitFrames(1);
}
void DoTouchScroll() {
@@ -152,8 +151,7 @@ class NonBlockingEventBrowserTest : public ContentBrowserTest {
ExecuteScriptAndExtractInt("document.documentElement.scrollHeight");
EXPECT_EQ(kWebsiteHeight, scrollHeight);
- scoped_refptr<FrameWatcher> frame_watcher(new FrameWatcher());
- frame_watcher->AttachTo(shell()->web_contents());
+ FrameWatcher frame_watcher(shell()->web_contents());
SyntheticSmoothScrollGestureParams params;
params.gesture_source_type = SyntheticGestureParams::TOUCH_INPUT;
@@ -169,8 +167,8 @@ class NonBlockingEventBrowserTest : public ContentBrowserTest {
// Expect that the compositor scrolled at least one pixel while the
// main thread was in a busy loop.
- while (frame_watcher->LastMetadata().root_scroll_offset.y() <= 0)
- frame_watcher->WaitFrames(1);
+ while (frame_watcher.LastMetadata().root_scroll_offset.y() <= 0)
+ frame_watcher.WaitFrames(1);
}
private:

Powered by Google App Engine
This is Rietveld 408576698