| 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;
|
| }
|
|
|
|
|