Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Unified Diff: content/browser/renderer_host/render_view_host_browsertest.cc

Issue 15505003: GTTF: Convert most tests in content to use EmbeddedTestServer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clang Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());
}
« no previous file with comments | « content/browser/media/webrtc_internals_browsertest.cc ('k') | content/browser/session_history_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698