Commit 31c0204d authored by Nasko Oskov's avatar Nasko Oskov Committed by Commit Bot

Use EmbeddedTestServer provided URL instead of no-port localhost URL.

The ProcessManagerBrowserTest.HostedAppAlerts test uses a hardcoded URL
to localhost without a port number. Since the server runs on non-default
and randomized port number, navigation to URL without port is expected
to fail. This test needs to be updated to ensure navigation succeeds.

Bug: 838161
Change-Id: Iedf309114dfc60f7b10745d96daf6b669f657c14
Reviewed-on: https://chromium-review.googlesource.com/1035363Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554804}
parent ffad29c8
...@@ -1589,8 +1589,13 @@ IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest, HostedAppAlerts) { ...@@ -1589,8 +1589,13 @@ IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest, HostedAppAlerts) {
content::WebContents* tab = content::WebContents* tab =
browser()->tab_strip_model()->GetActiveWebContents(); browser()->tab_strip_model()->GetActiveWebContents();
GURL hosted_app_url("http://localhost/extensions/hosted_app/main.html"); GURL hosted_app_url(embedded_test_server()->GetURL(
NavigateToURL(hosted_app_url); "localhost", "/extensions/hosted_app/main.html"));
{
content::TestNavigationObserver observer(tab);
NavigateToURL(hosted_app_url);
EXPECT_TRUE(observer.last_navigation_succeeded());
}
EXPECT_EQ(hosted_app_url, tab->GetLastCommittedURL()); EXPECT_EQ(hosted_app_url, tab->GetLastCommittedURL());
ProcessManager* pm = ProcessManager::Get(profile()); ProcessManager* pm = ProcessManager::Get(profile());
EXPECT_EQ(extension, pm->GetExtensionForWebContents(tab)); EXPECT_EQ(extension, pm->GetExtensionForWebContents(tab));
......
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