Index: content/browser/renderer_host/render_view_host_browsertest.cc |
diff --git a/content/browser/renderer_host/render_view_host_browsertest.cc b/content/browser/renderer_host/render_view_host_browsertest.cc |
index 1170fe5131b4a2b7e4579cd1cd32271985cb6ed2..8fb43e567f2c64aa9fa75551f066b8d740af9415 100644 |
--- a/content/browser/renderer_host/render_view_host_browsertest.cc |
+++ b/content/browser/renderer_host/render_view_host_browsertest.cc |
@@ -2,6 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#include "base/path_service.h" |
#include "base/time.h" |
#include "base/utf_string_conversions.h" |
#include "base/values.h" |
@@ -10,13 +11,14 @@ |
#include "content/common/view_messages.h" |
#include "content/public/browser/notification_types.h" |
#include "content/public/browser/web_contents_observer.h" |
+#include "content/public/common/content_paths.h" |
#include "content/public/test/browser_test_utils.h" |
#include "content/shell/shell.h" |
#include "content/test/content_browser_test.h" |
#include "content/test/content_browser_test_utils.h" |
#include "net/base/host_port_pair.h" |
#include "net/base/net_util.h" |
-#include "net/test/spawned_test_server/spawned_test_server.h" |
+#include "net/test/embedded_test_server/embedded_test_server.h" |
namespace content { |
@@ -59,30 +61,33 @@ class RenderViewHostTestWebContentsObserver : public WebContentsObserver { |
}; |
IN_PROC_BROWSER_TEST_F(RenderViewHostTest, FrameNavigateSocketAddress) { |
- ASSERT_TRUE(test_server()->Start()); |
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
RenderViewHostTestWebContentsObserver observer(shell()->web_contents()); |
- GURL test_url = test_server()->GetURL("files/simple_page.html"); |
+ GURL test_url = embedded_test_server()->GetURL("/simple_page.html"); |
NavigateToURL(shell(), test_url); |
- EXPECT_EQ(test_server()->host_port_pair().ToString(), |
+ EXPECT_EQ(net::HostPortPair::FromURL( |
+ embedded_test_server()->base_url()).ToString(), |
observer.observed_socket_address().ToString()); |
EXPECT_EQ(1, observer.navigation_count()); |
} |
IN_PROC_BROWSER_TEST_F(RenderViewHostTest, BaseURLParam) { |
- ASSERT_TRUE(test_server()->Start()); |
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
RenderViewHostTestWebContentsObserver observer(shell()->web_contents()); |
// Base URL is not set if it is the same as the URL. |
- GURL test_url = test_server()->GetURL("files/simple_page.tml"); |
+ GURL test_url = embedded_test_server()->GetURL("/simple_page.html"); |
NavigateToURL(shell(), test_url); |
EXPECT_TRUE(observer.base_url().is_empty()); |
EXPECT_EQ(1, observer.navigation_count()); |
// But should be set to the original page when reading MHTML. |
- test_url = net::FilePathToFileURL(test_server()->document_root().Append( |
- FILE_PATH_LITERAL("google.mht"))); |
+ base::FilePath content_test_data_dir; |
+ ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &content_test_data_dir)); |
+ test_url = net::FilePathToFileURL( |
+ content_test_data_dir.AppendASCII("google.mht")); |
NavigateToURL(shell(), test_url); |
EXPECT_EQ("http://www.google.com/", observer.base_url().spec()); |
} |