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

Unified Diff: content/browser/frame_host/debug_urls.cc

Issue 1543803005: Added an integration test for kasko hang reports (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/frame_host/debug_urls.cc
diff --git a/content/browser/frame_host/debug_urls.cc b/content/browser/frame_host/debug_urls.cc
index f095f8e51e1ce000c58fe8c3bdd5f7cb1a9f1dff..1f93ce19fe549e0b0df9685f424d065ca038320c 100644
--- a/content/browser/frame_host/debug_urls.cc
+++ b/content/browser/frame_host/debug_urls.cc
@@ -30,6 +30,11 @@
namespace content {
+class ScopedAllowWaitForDebugURL {
+ private:
+ base::ThreadRestrictions::ScopedAllowWait wait;
+};
+
namespace {
// Define the Asan debug URLs.
@@ -163,14 +168,13 @@ bool HandleAsanDebugURL(const GURL& url) {
return true;
}
+void HangCurrentThread() {
+ ScopedAllowWaitForDebugURL allow_wait;
+ base::WaitableEvent(false, false).Wait();
+}
} // namespace
-class ScopedAllowWaitForDebugURL {
- private:
- base::ThreadRestrictions::ScopedAllowWait wait;
-};
-
bool HandleDebugURL(const GURL& url, ui::PageTransition transition) {
// Ensure that the user explicitly navigated to this URL, unless
// kEnableGpuBenchmarking is enabled by Telemetry.
@@ -198,8 +202,11 @@ bool HandleDebugURL(const GURL& url, ui::PageTransition transition) {
}
if (url == GURL(kChromeUIBrowserUIHang)) {
- ScopedAllowWaitForDebugURL allow_wait;
- base::WaitableEvent(false, false).Wait();
+ // Webdriver waits for the onload event in javascript which needs a little
+ // more time to fire.
+ BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE,
+ base::Bind(&HangCurrentThread),
+ base::TimeDelta::FromSeconds(1));
return true;
}

Powered by Google App Engine
This is Rietveld 408576698