Index: chrome/browser/extensions/app_process_apitest.cc |
diff --git a/chrome/browser/extensions/app_process_apitest.cc b/chrome/browser/extensions/app_process_apitest.cc |
index f47eb7b4d71969657978e1705d778330e59d0b12..e48b29d5a1b48e4ef5ae081c58d1227e68a3b92a 100644 |
--- a/chrome/browser/extensions/app_process_apitest.cc |
+++ b/chrome/browser/extensions/app_process_apitest.cc |
@@ -28,6 +28,7 @@ |
#include "content/public/test/browser_test_utils.h" |
#include "content/public/test/test_navigation_observer.h" |
#include "net/dns/mock_host_resolver.h" |
+#include "net/test/embedded_test_server/embedded_test_server.h" |
#include "sync/api/string_ordinal.h" |
using content::NavigationController; |
@@ -44,8 +45,8 @@ class AppApiTest : public ExtensionApiTest { |
GURL::Replacements replace_host; |
std::string host_str("localhost"); // must stay in scope with replace_host |
replace_host.SetHostStr(host_str); |
- GURL base_url = test_server()->GetURL( |
- "files/extensions/api_test/" + test_directory + "/"); |
+ GURL base_url = embedded_test_server()->GetURL( |
+ "/extensions/api_test/" + test_directory + "/"); |
return base_url.ReplaceComponents(replace_host); |
} |
@@ -67,7 +68,7 @@ class AppApiTest : public ExtensionApiTest { |
browser()->profile())->extension_service()->process_map(); |
host_resolver()->AddRule("*", "127.0.0.1"); |
- ASSERT_TRUE(test_server()->Start()); |
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
ASSERT_TRUE(LoadExtension( |
test_data_dir_.AppendASCII(app_name))); |
@@ -144,7 +145,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, DISABLED_AppProcess) { |
browser()->profile())->extension_service()->process_map(); |
host_resolver()->AddRule("*", "127.0.0.1"); |
- ASSERT_TRUE(test_server()->Start()); |
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("app_process"))); |
@@ -291,7 +292,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, MAYBE_BookmarkAppGetsNormalProcess) { |
extensions::ProcessMap* process_map = service->process_map(); |
host_resolver()->AddRule("*", "127.0.0.1"); |
- ASSERT_TRUE(test_server()->Start()); |
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
GURL base_url = GetTestBaseURL("app_process"); |
// Load an app as a bookmark app. |
@@ -371,7 +372,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, MAYBE_BookmarkAppGetsNormalProcess) { |
// See http://crbug.com/61757 |
IN_PROC_BROWSER_TEST_F(AppApiTest, AppProcessRedirectBack) { |
host_resolver()->AddRule("*", "127.0.0.1"); |
- ASSERT_TRUE(test_server()->Start()); |
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("app_process"))); |
@@ -397,7 +398,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, AppProcessRedirectBack) { |
// 3 tabs, including the initial about:blank. The last 2 should be the same |
// process. |
ASSERT_EQ(3, browser()->tab_strip_model()->count()); |
- EXPECT_EQ("/files/extensions/api_test/app_process/path1/empty.html", |
+ EXPECT_EQ("/extensions/api_test/app_process/path1/empty.html", |
browser()->tab_strip_model()->GetWebContentsAt(2)-> |
GetController().GetLastCommittedEntry()->GetURL().path()); |
EXPECT_EQ(browser()->tab_strip_model()->GetWebContentsAt(1)-> |
@@ -416,7 +417,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, NavigateIntoAppProcess) { |
browser()->profile())->extension_service()->process_map(); |
host_resolver()->AddRule("*", "127.0.0.1"); |
- ASSERT_TRUE(test_server()->Start()); |
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
// The app under test acts on URLs whose host is "localhost", |
// so the URLs we navigate to must have host "localhost". |
@@ -463,7 +464,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, ReloadIntoAppProcess) { |
browser()->profile())->extension_service()->process_map(); |
host_resolver()->AddRule("*", "127.0.0.1"); |
- ASSERT_TRUE(test_server()->Start()); |
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
// The app under test acts on URLs whose host is "localhost", |
// so the URLs we navigate to must have host "localhost". |
@@ -528,7 +529,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, ReloadIntoAppProcessWithJavaScript) { |
browser()->profile())->extension_service()->process_map(); |
host_resolver()->AddRule("*", "127.0.0.1"); |
- ASSERT_TRUE(test_server()->Start()); |
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
// The app under test acts on URLs whose host is "localhost", |
// so the URLs we navigate to must have host "localhost". |
@@ -602,7 +603,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, OpenAppFromIframe) { |
browser()->profile())->extension_service()->process_map(); |
host_resolver()->AddRule("*", "127.0.0.1"); |
- ASSERT_TRUE(test_server()->Start()); |
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
GURL base_url = GetTestBaseURL("app_process"); |
@@ -638,7 +639,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, OpenAppFromIframe) { |
#endif |
IN_PROC_BROWSER_TEST_F(BlockedAppApiTest, MAYBE_OpenAppFromIframe) { |
host_resolver()->AddRule("*", "127.0.0.1"); |
- ASSERT_TRUE(test_server()->Start()); |
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
// Load app and start URL (not in the app). |
const Extension* app = |
@@ -666,7 +667,7 @@ IN_PROC_BROWSER_TEST_F(BlockedAppApiTest, MAYBE_OpenAppFromIframe) { |
// up with an app process. See http://crbug.com/99349 for more details. |
IN_PROC_BROWSER_TEST_F(AppApiTest, ServerRedirectToAppFromExtension) { |
host_resolver()->AddRule("*", "127.0.0.1"); |
- ASSERT_TRUE(StartTestServer()); |
+ ASSERT_TRUE(StartEmbeddedTestServer()); |
LoadExtension(test_data_dir_.AppendASCII("app_process")); |
const Extension* launcher = |
@@ -708,7 +709,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, ServerRedirectToAppFromExtension) { |
// up with an app process. |
IN_PROC_BROWSER_TEST_F(AppApiTest, ClientRedirectToAppFromExtension) { |
host_resolver()->AddRule("*", "127.0.0.1"); |
- ASSERT_TRUE(StartTestServer()); |
+ ASSERT_TRUE(StartEmbeddedTestServer()); |
LoadExtension(test_data_dir_.AppendASCII("app_process")); |
const Extension* launcher = |
@@ -757,7 +758,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, OpenWebPopupFromWebIframe) { |
browser()->profile())->extension_service()->process_map(); |
host_resolver()->AddRule("*", "127.0.0.1"); |
- ASSERT_TRUE(test_server()->Start()); |
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
GURL base_url = GetTestBaseURL("app_process"); |
@@ -794,7 +795,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, MAYBE_ReloadAppAfterCrash) { |
browser()->profile())->extension_service()->process_map(); |
host_resolver()->AddRule("*", "127.0.0.1"); |
- ASSERT_TRUE(test_server()->Start()); |
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("app_process"))); |