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

Unified Diff: content/browser/renderer_host/render_widget_host_unittest.cc

Issue 1376003002: Make rendering timeouts work even if paint data received early (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cursor
Patch Set: Moved message dispatch mechanism from Blink to content Created 5 years, 3 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/render_widget_host_unittest.cc
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc
index 0e2557c36cdc1d67320e5e09aeae13de283e4de6..785288d5c6e2b48d2416037bc03ae731b2360040 100644
--- a/content/browser/renderer_host/render_widget_host_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -1106,7 +1106,18 @@ TEST_F(RenderWidgetHostTest, NewContentRenderingTimeout) {
// Test immediate start and stop, ensuring that the timeout doesn't fire.
host_->StartNewContentRenderingTimeout();
- host_->StopNewContentRenderingTimeout();
+ host_->OnFirstPaintAfterLoad();
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, base::MessageLoop::QuitClosure(),
+ TimeDelta::FromMicroseconds(20));
esprehn 2015/10/02 05:58:15 Why wait 20 microseconds? This usually produces fl
kenrb 2015/10/02 13:24:40 I used the same values as the hung renderer test,
+ base::MessageLoop::current()->Run();
+
+ EXPECT_FALSE(host_->new_content_rendering_timeout_fired());
+
+ // Test that the timer doesn't fire if it receives a stop before
+ // a start.
+ host_->OnFirstPaintAfterLoad();
+ host_->StartNewContentRenderingTimeout();
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, base::MessageLoop::QuitClosure(),
TimeDelta::FromMicroseconds(20));

Powered by Google App Engine
This is Rietveld 408576698