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

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

Issue 2136173003: Add an histogram to differentiate between hang types of the renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed asan issue Created 4 years, 5 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 54d11f4497210c0a173bae3a9fdc857502a21d14..b83c7e27cab137550e08e6e6c9672be978169905 100644
--- a/content/browser/renderer_host/render_widget_host_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -406,7 +406,8 @@ class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate {
return handle_wheel_event_;
}
- void RendererUnresponsive(RenderWidgetHostImpl* render_widget_host) override {
+ void RendererUnresponsive(RenderWidgetHostImpl* render_widget_host,
+ RendererUnresponsiveType type) override {
unresponsive_timer_fired_ = true;
}
@@ -1071,11 +1072,15 @@ TEST_F(RenderWidgetHostTest, UnhandledGestureEvent) {
// while one is in progress (see crbug.com/11007).
TEST_F(RenderWidgetHostTest, DontPostponeHangMonitorTimeout) {
// Start with a short timeout.
- host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10));
+ host_->StartHangMonitorTimeout(
+ TimeDelta::FromMilliseconds(10),
+ RenderWidgetHostDelegate::RENDERER_UNRESPONSIVE_UNKNOWN);
// Immediately try to add a long 30 second timeout.
EXPECT_FALSE(delegate_->unresponsive_timer_fired());
- host_->StartHangMonitorTimeout(TimeDelta::FromSeconds(30));
+ host_->StartHangMonitorTimeout(
+ TimeDelta::FromSeconds(30),
+ RenderWidgetHostDelegate::RENDERER_UNRESPONSIVE_UNKNOWN);
// Wait long enough for first timeout and see if it fired.
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
@@ -1089,12 +1094,16 @@ TEST_F(RenderWidgetHostTest, DontPostponeHangMonitorTimeout) {
// and then started again.
TEST_F(RenderWidgetHostTest, StopAndStartHangMonitorTimeout) {
// Start with a short timeout, then stop it.
- host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10));
+ host_->StartHangMonitorTimeout(
+ TimeDelta::FromMilliseconds(10),
+ RenderWidgetHostDelegate::RENDERER_UNRESPONSIVE_UNKNOWN);
host_->StopHangMonitorTimeout();
// Start it again to ensure it still works.
EXPECT_FALSE(delegate_->unresponsive_timer_fired());
- host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10));
+ host_->StartHangMonitorTimeout(
+ TimeDelta::FromMilliseconds(10),
+ RenderWidgetHostDelegate::RENDERER_UNRESPONSIVE_UNKNOWN);
// Wait long enough for first timeout and see if it fired.
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
@@ -1108,11 +1117,15 @@ TEST_F(RenderWidgetHostTest, StopAndStartHangMonitorTimeout) {
// updated to a shorter duration.
TEST_F(RenderWidgetHostTest, ShorterDelayHangMonitorTimeout) {
// Start with a timeout.
- host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(100));
+ host_->StartHangMonitorTimeout(
+ TimeDelta::FromMilliseconds(100),
+ RenderWidgetHostDelegate::RENDERER_UNRESPONSIVE_UNKNOWN);
// Start it again with shorter delay.
EXPECT_FALSE(delegate_->unresponsive_timer_fired());
- host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(20));
+ host_->StartHangMonitorTimeout(
+ TimeDelta::FromMilliseconds(20),
+ RenderWidgetHostDelegate::RENDERER_UNRESPONSIVE_UNKNOWN);
// Wait long enough for the second timeout and see if it fired.
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.cc ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698