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

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: Better documentation for RunTest() Created 4 years, 11 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/frame_host/debug_urls.cc
diff --git a/content/browser/frame_host/debug_urls.cc b/content/browser/frame_host/debug_urls.cc
index f3190a74acb2d0f2da878ae048840a5c045c490c..833b0063ab4a5efc1f1bbd86c6f6cc763e612ecf 100644
--- a/content/browser/frame_host/debug_urls.cc
+++ b/content/browser/frame_host/debug_urls.cc
@@ -31,6 +31,11 @@
namespace content {
+class ScopedAllowWaitForDebugURL {
+ private:
+ base::ThreadRestrictions::ScopedAllowWait wait;
+};
+
namespace {
// Define the Asan debug URLs.
@@ -164,14 +169,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.
@@ -199,8 +203,16 @@ bool HandleDebugURL(const GURL& url, ui::PageTransition transition) {
}
if (url == GURL(kChromeUIBrowserUIHang)) {
- ScopedAllowWaitForDebugURL allow_wait;
- base::WaitableEvent(false, false).Wait();
+ HangCurrentThread();
+ return true;
+ }
+
+ if (url == GURL(kChromeUIDelayedBrowserUIHang)) {
+ // Webdriver-safe url to hang the ui thread. 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(2));
return true;
}

Powered by Google App Engine
This is Rietveld 408576698