Commit ac31d43d authored by Nick Carter's avatar Nick Carter Committed by Commit Bot

Fix test flake in ProcessManagerBrowserTest.NestedURLNavigationsViaProxyBlocked

Cause of flake was confirmed by adding a slow unload handler to |popup|. This
fixes it.

Bug: 821596, 822635
Change-Id: I602c98a0fb37f9951cc85fb9d886616bb22e8b42
Reviewed-on: https://chromium-review.googlesource.com/967352Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Commit-Queue: Nick Carter <nick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543870}
parent 2ceb0195
...@@ -1081,9 +1081,8 @@ IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest, ...@@ -1081,9 +1081,8 @@ IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest,
// Test that a web frame can't navigate a proxy for an extension frame to a // Test that a web frame can't navigate a proxy for an extension frame to a
// blob/filesystem extension URL. See https://crbug.com/656752. // blob/filesystem extension URL. See https://crbug.com/656752.
// Disabled due to flake, see http://crbug.com/822635.
IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest, IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest,
DISABLED_NestedURLNavigationsViaProxyBlocked) { NestedURLNavigationsViaProxyBlocked) {
// Create a simple extension without a background page. // Create a simple extension without a background page.
const Extension* extension = CreateExtension("Extension", false); const Extension* extension = CreateExtension("Extension", false);
embedded_test_server()->ServeFilesFromDirectory(extension->path()); embedded_test_server()->ServeFilesFromDirectory(extension->path());
...@@ -1107,6 +1106,8 @@ IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest, ...@@ -1107,6 +1106,8 @@ IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest,
// Setup the test by navigating popup to an extension page. This is allowed // Setup the test by navigating popup to an extension page. This is allowed
// because it's web accessible. // because it's web accessible.
content::WebContents* popup = OpenPopup(main_frame, extension_url); content::WebContents* popup = OpenPopup(main_frame, extension_url);
content::RenderFrameDeletedObserver popup_unload_observer(
popup->GetMainFrame());
// This frame should now be in an extension process. // This frame should now be in an extension process.
EXPECT_EQ(1u, pm->GetAllFrames().size()); EXPECT_EQ(1u, pm->GetAllFrames().size());
...@@ -1120,6 +1121,7 @@ IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest, ...@@ -1120,6 +1121,7 @@ IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest,
EXPECT_TRUE(ExecuteScript( EXPECT_TRUE(ExecuteScript(
tab, "window.popup.location.href = '" + nested_url.spec() + "';")); tab, "window.popup.location.href = '" + nested_url.spec() + "';"));
WaitForLoadStop(popup); WaitForLoadStop(popup);
popup_unload_observer.WaitUntilDeleted();
// Because the navigation was blocked, it should be an empty page. // Because the navigation was blocked, it should be an empty page.
EXPECT_NE(nested_url, popup->GetLastCommittedURL()); EXPECT_NE(nested_url, popup->GetLastCommittedURL());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment