summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/browser/browser_plugin/browser_plugin_host_browsertest.cc145
-rw-r--r--content/browser/download/mhtml_generation_browsertest.cc6
-rw-r--r--content/browser/fileapi/file_system_browsertest.cc1
-rw-r--r--content/browser/loader/resource_dispatcher_host_browsertest.cc70
-rw-r--r--content/browser/media/webrtc_browsertest.cc31
-rw-r--r--content/browser/media/webrtc_internals_browsertest.cc7
-rw-r--r--content/browser/renderer_host/render_view_host_browsertest.cc21
-rw-r--r--content/browser/session_history_browsertest.cc37
-rw-r--r--content/browser/web_contents/web_contents_impl_browsertest.cc1
-rw-r--r--content/test/data/browser_plugin_dragging.html7
10 files changed, 107 insertions, 219 deletions
diff --git a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
index c67be30..818aa27 100644
--- a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
+++ b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
@@ -29,9 +29,6 @@
#include "content/test/content_browser_test.h"
#include "content/test/content_browser_test_utils.h"
#include "net/base/net_util.h"
-#include "net/test/embedded_test_server/embedded_test_server.h"
-#include "net/test/embedded_test_server/http_response.h"
-#include "net/test/embedded_test_server/http_request.h"
#include "net/test/spawned_test_server/spawned_test_server.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
#include "webkit/glue/webdropdata.h"
@@ -312,8 +309,8 @@ class BrowserPluginHostTest : public ContentBrowserTest {
const std::string& guest_url,
bool is_guest_data_url,
const std::string& embedder_code) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
- GURL test_url(embedded_test_server()->GetURL(embedder_url));
+ ASSERT_TRUE(test_server()->Start());
+ GURL test_url(test_server()->GetURL(embedder_url));
NavigateToURL(shell(), test_url);
WebContentsImpl* embedder_web_contents = static_cast<WebContentsImpl*>(
@@ -329,7 +326,7 @@ class BrowserPluginHostTest : public ContentBrowserTest {
ExecuteSyncJSFunction(rvh, embedder_code);
if (!is_guest_data_url) {
- test_url = embedded_test_server()->GetURL(guest_url);
+ test_url = test_server()->GetURL(guest_url);
ExecuteSyncJSFunction(
rvh, base::StringPrintf("SetSrc('%s');", test_url.spec().c_str()));
} else {
@@ -391,7 +388,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest,
content::BrowserPluginGuest::set_factory_for_testing(
TestShortHangTimeoutGuestFactory::GetInstance());
const char kEmbedderURL[] =
- "/browser_plugin_embedder_guest_unresponsive.html";
+ "files/browser_plugin_embedder_guest_unresponsive.html";
StartBrowserPluginTest(
kEmbedderURL, kHTMLForGuestBusyLoop, true, std::string());
// Wait until the busy loop starts.
@@ -447,7 +444,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, NavigateAfterResize) {
const gfx::Size nxt_size = gfx::Size(100, 200);
const std::string embedder_code = base::StringPrintf(
"SetSize(%d, %d);", nxt_size.width(), nxt_size.height());
- const char kEmbedderURL[] = "/browser_plugin_embedder.html";
+ const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, embedder_code);
// Wait for the guest to receive a damage buffer of size 100x200.
@@ -456,8 +453,8 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, NavigateAfterResize) {
}
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AdvanceFocus) {
- const char kEmbedderURL[] = "/browser_plugin_focus.html";
- const char* kGuestURL = "/browser_plugin_focus_child.html";
+ const char kEmbedderURL[] = "files/browser_plugin_focus.html";
+ const char* kGuestURL = "files/browser_plugin_focus_child.html";
StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, std::string());
SimulateMouseClick(test_embedder()->web_contents(), 0,
@@ -488,7 +485,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderChangedAfterSwap) {
ASSERT_TRUE(https_server.Start());
// 1. Load an embedder page with one guest in it.
- const char kEmbedderURL[] = "/browser_plugin_embedder.html";
+ const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
// 2. Navigate to a URL in https, so we trigger a RenderViewHost swap.
@@ -514,14 +511,14 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderChangedAfterSwap) {
// therefore the embedder created on first page navigation stays the same in
// web_contents.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderSameAfterNav) {
- const char kEmbedderURL[] = "/browser_plugin_embedder.html";
+ const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
WebContentsImpl* embedder_web_contents = test_embedder()->web_contents();
// Navigate to another page in same host and port, so RenderViewHost swap
// does not happen and existing embedder doesn't change in web_contents.
- GURL test_url_new(embedded_test_server()->GetURL(
- "/browser_plugin_title_change.html"));
+ GURL test_url_new(test_server()->GetURL(
+ "files/browser_plugin_title_change.html"));
const string16 expected_title = ASCIIToUTF16("done");
content::TitleWatcher title_watcher(shell()->web_contents(), expected_title);
NavigateToURL(shell(), test_url_new);
@@ -539,7 +536,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderSameAfterNav) {
// This test verifies that hiding the embedder also hides the guest.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, BrowserPluginVisibilityChanged) {
- const char kEmbedderURL[] = "/browser_plugin_embedder.html";
+ const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
// Hide the Browser Plugin.
@@ -553,7 +550,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, BrowserPluginVisibilityChanged) {
}
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderVisibilityChanged) {
- const char kEmbedderURL[] = "/browser_plugin_embedder.html";
+ const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
// Hide the embedder.
@@ -565,7 +562,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderVisibilityChanged) {
// This test verifies that calling the reload method reloads the guest.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, ReloadGuest) {
- const char kEmbedderURL[] = "/browser_plugin_embedder.html";
+ const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
test_guest()->ResetUpdateRectCount();
@@ -579,7 +576,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, ReloadGuest) {
// This test verifies that calling the stop method forwards the stop request
// to the guest's WebContents.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, StopGuest) {
- const char kEmbedderURL[] = "/browser_plugin_embedder.html";
+ const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
@@ -591,7 +588,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, StopGuest) {
// Verifies that installing/uninstalling touch-event handlers in the guest
// plugin correctly updates the touch-event handling state in the embedder.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AcceptTouchEvents) {
- const char kEmbedderURL[] = "/browser_plugin_embedder.html";
+ const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(
kEmbedderURL, kHTMLForGuestTouchHandler, true, std::string());
@@ -619,7 +616,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AcceptTouchEvents) {
}
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, Renavigate) {
- const char kEmbedderURL[] = "/browser_plugin_embedder.html";
+ const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(
kEmbedderURL, GetHTMLForGuestWithTitle("P1"), true, std::string());
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
@@ -715,7 +712,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, Renavigate) {
// This tests verifies that reloading the embedder does not crash the browser
// and that the guest is reset.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, ReloadEmbedder) {
- const char kEmbedderURL[] = "/browser_plugin_embedder.html";
+ const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
@@ -766,7 +763,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, ReloadEmbedder) {
}
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, TerminateGuest) {
- const char kEmbedderURL[] = "/browser_plugin_embedder.html";
+ const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
@@ -780,7 +777,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, TerminateGuest) {
// This test verifies that the guest is responsive after crashing and going back
// to a previous navigation entry.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, BackAfterTerminateGuest) {
- const char* kEmbedderURL = "/browser_plugin_embedder.html";
+ const char* kEmbedderURL = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(
kEmbedderURL, GetHTMLForGuestWithTitle("P1"), true, std::string());
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
@@ -823,7 +820,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, BackAfterTerminateGuest) {
}
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadStart) {
- const char kEmbedderURL[] = "/browser_plugin_embedder.html";
+ const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(kEmbedderURL, "about:blank", true, std::string());
const string16 expected_title = ASCIIToUTF16(kHTMLForGuest);
@@ -839,59 +836,18 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadStart) {
EXPECT_EQ(expected_title, actual_title);
}
-namespace {
-
-class EmptyHttpResponse : public net::test_server::HttpResponse {
- public:
- virtual std::string ToResponseString() const OVERRIDE {
- return std::string();
- }
-};
-
-// Handles |request| by serving an empty response.
-scoped_ptr<net::test_server::HttpResponse> EmptyResponseHandler(
- const std::string& path,
- const net::test_server::HttpRequest& request) {
- if (StartsWithASCII(path, request.relative_url, true)) {
- return scoped_ptr<net::test_server::HttpResponse>(
- new EmptyHttpResponse);
- }
-
- return scoped_ptr<net::test_server::HttpResponse>(NULL);
-}
-
-// Handles |request| by serving a redirect response.
-scoped_ptr<net::test_server::HttpResponse> RedirectResponseHandler(
- const std::string& path,
- const GURL& redirect_target,
- const net::test_server::HttpRequest& request) {
- if (!StartsWithASCII(path, request.relative_url, true))
- return scoped_ptr<net::test_server::HttpResponse>(NULL);
-
- scoped_ptr<net::test_server::BasicHttpResponse> http_response(
- new net::test_server::BasicHttpResponse);
- http_response->set_code(net::test_server::MOVED);
- http_response->AddCustomHeader("Location", redirect_target.spec());
- return http_response.PassAs<net::test_server::HttpResponse>();
-}
-
-} // namespace
-
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadAbort) {
- const char kEmbedderURL[] = "/browser_plugin_embedder.html";
+ const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(kEmbedderURL, "about:blank", true, std::string());
{
// Navigate the guest to "close-socket".
- const char kEmptyResponsePath[] = "/close-socket";
- embedded_test_server()->RegisterRequestHandler(
- base::Bind(&EmptyResponseHandler, kEmptyResponsePath));
const string16 expected_title = ASCIIToUTF16("ERR_EMPTY_RESPONSE");
content::TitleWatcher title_watcher(test_embedder()->web_contents(),
expected_title);
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
- GURL test_url = embedded_test_server()->GetURL(kEmptyResponsePath);
+ GURL test_url = test_server()->GetURL("close-socket");
ExecuteSyncJSFunction(
rvh, base::StringPrintf("SetSrc('%s');", test_url.spec().c_str()));
string16 actual_title = title_watcher.WaitAndGetTitle();
@@ -934,7 +890,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadAbort) {
}
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadRedirect) {
- const char kEmbedderURL[] = "/browser_plugin_embedder.html";
+ const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(kEmbedderURL, "about:blank", true, std::string());
const string16 expected_title = ASCIIToUTF16("redirected");
@@ -942,12 +898,8 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadRedirect) {
expected_title);
// Navigate with a redirect and wait until the title changes.
- const char kRedirectResponsePath[] = "/server-redirect";
- embedded_test_server()->RegisterRequestHandler(
- base::Bind(&RedirectResponseHandler,
- kRedirectResponsePath,
- embedded_test_server()->GetURL("/title1.html")));
- GURL redirect_url(embedded_test_server()->GetURL(kRedirectResponsePath));
+ GURL redirect_url(test_server()->GetURL(
+ "server-redirect?files/title1.html"));
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
ExecuteSyncJSFunction(
@@ -965,8 +917,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadRedirect) {
value = content::ExecuteScriptAndGetValue(rvh, "redirectNewUrl");
EXPECT_TRUE(value->GetAsString(&result));
- EXPECT_EQ(embedded_test_server()->GetURL("/title1.html").spec().c_str(),
- result);
+ EXPECT_EQ(test_server()->GetURL("files/title1.html").spec().c_str(), result);
}
// Always failing in the win7_aura try bot. See http://crbug.com/181107.
@@ -979,7 +930,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadRedirect) {
// Tests that a drag-n-drop over the browser plugin in the embedder happens
// correctly.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, MAYBE_AcceptDragEvents) {
- const char kEmbedderURL[] = "/browser_plugin_dragging.html";
+ const char kEmbedderURL[] = "files/browser_plugin_dragging.html";
StartBrowserPluginTest(
kEmbedderURL, kHTMLForGuestAcceptDrag, true, std::string());
@@ -1035,8 +986,8 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, MAYBE_AcceptDragEvents) {
// message.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, PostMessage) {
const char* kTesting = "testing123";
- const char* kEmbedderURL = "/browser_plugin_embedder.html";
- const char* kGuestURL = "/browser_plugin_post_message_guest.html";
+ const char* kEmbedderURL = "files/browser_plugin_embedder.html";
+ const char* kGuestURL = "files/browser_plugin_post_message_guest.html";
StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, std::string());
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
@@ -1063,8 +1014,8 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, PostMessage) {
// iframe targeting is fixed (see http://crbug.com/153701).
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_PostMessageToIFrame) {
const char* kTesting = "testing123";
- const char* kEmbedderURL = "/browser_plugin_embedder.html";
- const char* kGuestURL = "/browser_plugin_post_message_guest.html";
+ const char* kEmbedderURL = "files/browser_plugin_embedder.html";
+ const char* kGuestURL = "files/browser_plugin_post_message_guest.html";
StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, std::string());
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
@@ -1087,8 +1038,8 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_PostMessageToIFrame) {
RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>(
test_guest()->web_contents()->GetRenderViewHost());
- GURL test_url = embedded_test_server()->GetURL(
- "/browser_plugin_post_message_guest.html");
+ GURL test_url = test_server()->GetURL(
+ "files/browser_plugin_post_message_guest.html");
ExecuteSyncJSFunction(
guest_rvh,
base::StringPrintf(
@@ -1110,7 +1061,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_PostMessageToIFrame) {
}
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadStop) {
- const char* kEmbedderURL = "/browser_plugin_embedder.html";
+ const char* kEmbedderURL = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(kEmbedderURL, "about:blank", true, std::string());
const string16 expected_title = ASCIIToUTF16("loadStop");
@@ -1127,7 +1078,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadStop) {
}
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadCommit) {
- const char* kEmbedderURL = "/browser_plugin_embedder.html";
+ const char* kEmbedderURL = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(kEmbedderURL, "about:blank", true, std::string());
const string16 expected_title = ASCIIToUTF16(
@@ -1152,7 +1103,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadCommit) {
// This test verifies that if a browser plugin is hidden before navigation,
// the guest starts off hidden.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, HiddenBeforeNavigation) {
- const char* kEmbedderURL = "/browser_plugin_embedder.html";
+ const char* kEmbedderURL = "files/browser_plugin_embedder.html";
const std::string embedder_code =
"document.getElementById('plugin').style.visibility = 'hidden'";
StartBrowserPluginTest(
@@ -1163,7 +1114,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, HiddenBeforeNavigation) {
// This test verifies that if we lose the guest, and get a new one,
// the new guest will inherit the visibility state of the old guest.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, VisibilityPreservation) {
- const char* kEmbedderURL = "/browser_plugin_embedder.html";
+ const char* kEmbedderURL = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
@@ -1184,7 +1135,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, VisibilityPreservation) {
// This test verifies that if a browser plugin is focused before navigation then
// the guest starts off focused.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, FocusBeforeNavigation) {
- const char* kEmbedderURL = "/browser_plugin_embedder.html";
+ const char* kEmbedderURL = "files/browser_plugin_embedder.html";
const std::string embedder_code =
"document.getElementById('plugin').focus();";
StartBrowserPluginTest(
@@ -1203,7 +1154,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, FocusBeforeNavigation) {
// the new guest will inherit the focus state of the old guest.
// crbug.com/170249
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_FocusPreservation) {
- const char* kEmbedderURL = "/browser_plugin_embedder.html";
+ const char* kEmbedderURL = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
@@ -1242,7 +1193,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_FocusPreservation) {
}
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, FocusTracksEmbedder) {
- const char* kEmbedderURL = "/browser_plugin_embedder.html";
+ const char* kEmbedderURL = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string());
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
test_embedder()->web_contents()->GetRenderViewHost());
@@ -1270,7 +1221,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, FocusTracksEmbedder) {
// This test verifies that if a browser plugin is in autosize mode before
// navigation then the guest starts auto-sized.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AutoSizeBeforeNavigation) {
- const char* kEmbedderURL = "/browser_plugin_embedder.html";
+ const char* kEmbedderURL = "files/browser_plugin_embedder.html";
const std::string embedder_code =
"document.getElementById('plugin').minwidth = 300;"
"document.getElementById('plugin').minheight = 200;"
@@ -1286,7 +1237,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AutoSizeBeforeNavigation) {
// This test verifies that enabling autosize resizes the guest and triggers
// a 'sizechanged' event.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AutoSizeAfterNavigation) {
- const char* kEmbedderURL = "/browser_plugin_embedder.html";
+ const char* kEmbedderURL = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(
kEmbedderURL, kHTMLForGuestWithSize, true, std::string());
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
@@ -1326,7 +1277,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AutoSizeAfterNavigation) {
// Test for regression http://crbug.com/162961.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, GetRenderViewHostAtPositionTest) {
- const char kEmbedderURL[] = "/browser_plugin_embedder.html";
+ const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
const std::string embedder_code =
base::StringPrintf("SetSize(%d, %d);", 100, 100);
StartBrowserPluginTest(kEmbedderURL, kHTMLForGuestWithSize, true,
@@ -1347,8 +1298,8 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, GetRenderViewHostAtPositionTest) {
#endif
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, MAYBE_ChangeWindowName) {
- const char kEmbedderURL[] = "/browser_plugin_naming_embedder.html";
- const char* kGuestURL = "/browser_plugin_naming_guest.html";
+ const char kEmbedderURL[] = "files/browser_plugin_naming_embedder.html";
+ const char* kGuestURL = "files/browser_plugin_naming_guest.html";
StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, std::string());
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
@@ -1394,7 +1345,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, MAYBE_ChangeWindowName) {
// This test verifies that all autosize attributes can be removed
// without crashing the plugin, or throwing errors.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, RemoveAutosizeAttributes) {
- const char* kEmbedderURL = "/browser_plugin_embedder.html";
+ const char* kEmbedderURL = "files/browser_plugin_embedder.html";
const std::string embedder_code =
"document.getElementById('plugin').minwidth = 300;"
"document.getElementById('plugin').minheight = 200;"
@@ -1420,7 +1371,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, RemoveAutosizeAttributes) {
// This test verifies that autosize works when some of the parameters are unset.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, PartialAutosizeAttributes) {
- const char* kEmbedderURL = "/browser_plugin_embedder.html";
+ const char* kEmbedderURL = "files/browser_plugin_embedder.html";
const std::string embedder_code =
"document.getElementById('plugin').minwidth = 300;"
"document.getElementById('plugin').minheight = 200;"
diff --git a/content/browser/download/mhtml_generation_browsertest.cc b/content/browser/download/mhtml_generation_browsertest.cc
index 07bffed..e8a9042 100644
--- a/content/browser/download/mhtml_generation_browsertest.cc
+++ b/content/browser/download/mhtml_generation_browsertest.cc
@@ -12,7 +12,7 @@
#include "content/shell/shell.h"
#include "content/test/content_browser_test.h"
#include "content/test/content_browser_test_utils.h"
-#include "net/test/embedded_test_server/embedded_test_server.h"
+#include "net/test/spawned_test_server/spawned_test_server.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace content {
@@ -48,12 +48,12 @@ class MHTMLGenerationTest : public ContentBrowserTest {
// test is to ensure we were successfull in creating the MHTML data from the
// renderer.
IN_PROC_BROWSER_TEST_F(MHTMLGenerationTest, GenerateMHTML) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(test_server()->Start());
base::FilePath path(temp_dir_.path());
path = path.Append(FILE_PATH_LITERAL("test.mht"));
- NavigateToURL(shell(), embedded_test_server()->GetURL("/simple_page.html"));
+ NavigateToURL(shell(), test_server()->GetURL("files/simple_page.html"));
shell()->web_contents()->GenerateMHTML(
path, base::Bind(&MHTMLGenerationTest::MHTMLGenerated, this));
diff --git a/content/browser/fileapi/file_system_browsertest.cc b/content/browser/fileapi/file_system_browsertest.cc
index 510064f..d8e55af 100644
--- a/content/browser/fileapi/file_system_browsertest.cc
+++ b/content/browser/fileapi/file_system_browsertest.cc
@@ -17,6 +17,7 @@
#include "content/test/content_browser_test.h"
#include "content/test/content_browser_test_utils.h"
#include "content/test/layout_browsertest.h"
+#include "net/test/spawned_test_server/spawned_test_server.h"
#include "webkit/quota/quota_manager.h"
using quota::QuotaManager;
diff --git a/content/browser/loader/resource_dispatcher_host_browsertest.cc b/content/browser/loader/resource_dispatcher_host_browsertest.cc
index 2cb1124..43cb267 100644
--- a/content/browser/loader/resource_dispatcher_host_browsertest.cc
+++ b/content/browser/loader/resource_dispatcher_host_browsertest.cc
@@ -20,9 +20,7 @@
#include "content/test/net/url_request_failed_job.h"
#include "content/test/net/url_request_mock_http_job.h"
#include "net/base/net_errors.h"
-#include "net/test/embedded_test_server/embedded_test_server.h"
-#include "net/test/embedded_test_server/http_response.h"
-#include "net/test/embedded_test_server/http_request.h"
+#include "net/test/spawned_test_server/spawned_test_server.h"
namespace content {
@@ -90,9 +88,9 @@ class ResourceDispatcherHostBrowserTest : public ContentBrowserTest,
// Test title for content created by javascript window.open().
// See http://crbug.com/5988
IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, DynamicTitle1) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(test_server()->Start());
- GURL url(embedded_test_server()->GetURL("/dynamic1.html"));
+ GURL url(test_server()->GetURL("files/dynamic1.html"));
string16 title;
ASSERT_TRUE(GetPopupTitle(url, &title));
EXPECT_TRUE(StartsWith(title, ASCIIToUTF16("My Popup Title"), true))
@@ -102,9 +100,9 @@ IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, DynamicTitle1) {
// Test title for content created by javascript window.open().
// See http://crbug.com/5988
IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, DynamicTitle2) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(test_server()->Start());
- GURL url(embedded_test_server()->GetURL("/dynamic2.html"));
+ GURL url(test_server()->GetURL("files/dynamic2.html"));
string16 title;
ASSERT_TRUE(GetPopupTitle(url, &title));
EXPECT_TRUE(StartsWith(title, ASCIIToUTF16("My Dynamic Title"), true))
@@ -158,9 +156,9 @@ IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest,
// Test for bug #1091358.
IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, SyncXMLHttpRequest) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(test_server()->Start());
NavigateToURL(
- shell(), embedded_test_server()->GetURL("/sync_xmlhttprequest.html"));
+ shell(), test_server()->GetURL("files/sync_xmlhttprequest.html"));
// Let's check the XMLHttpRequest ran successfully.
bool success = false;
@@ -174,10 +172,10 @@ IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, SyncXMLHttpRequest) {
// If this flakes, use http://crbug.com/62776.
IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest,
SyncXMLHttpRequest_Disallowed) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(test_server()->Start());
NavigateToURL(
shell(),
- embedded_test_server()->GetURL("/sync_xmlhttprequest_disallowed.html"));
+ test_server()->GetURL("files/sync_xmlhttprequest_disallowed.html"));
// Let's check the XMLHttpRequest ran successfully.
bool success = false;
@@ -194,18 +192,18 @@ IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest,
// If this flakes, use http://crbug.com/56264.
IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest,
SyncXMLHttpRequest_DuringUnload) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(test_server()->Start());
BrowserContext::GetDownloadManager(
shell()->web_contents()->GetBrowserContext())->AddObserver(this);
CheckTitleTest(
- embedded_test_server()->GetURL("/sync_xmlhttprequest_during_unload.html"),
+ test_server()->GetURL("files/sync_xmlhttprequest_during_unload.html"),
"sync xhr on unload");
// Navigate to a new page, to dispatch unload event and trigger xhr.
// (the bug would make this step hang the renderer).
CheckTitleTest(
- embedded_test_server()->GetURL("/title2.html"), "Title Of Awesomeness");
+ test_server()->GetURL("files/title2.html"), "Title Of Awesomeness");
ASSERT_FALSE(got_downloads());
}
@@ -213,9 +211,9 @@ IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest,
// Tests that onunload is run for cross-site requests. (Bug 1114994)
IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest,
CrossSiteOnunloadCookie) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(test_server()->Start());
- GURL url = embedded_test_server()->GetURL("/onunload_cookie.html");
+ GURL url = test_server()->GetURL("files/onunload_cookie.html");
CheckTitleTest(url, "set cookie on unload");
// Navigate to a new cross-site page, to dispatch unload event and set the
@@ -232,9 +230,9 @@ IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest,
// without network loads (e.g., about:blank, data URLs).
IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest,
DISABLED_CrossSiteImmediateLoadOnunloadCookie) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(test_server()->Start());
- GURL url = embedded_test_server()->GetURL("/onunload_cookie.html");
+ GURL url = test_server()->GetURL("files/onunload_cookie.html");
CheckTitleTest(url, "set cookie on unload");
// Navigate to a cross-site page that loads immediately without making a
@@ -245,38 +243,18 @@ IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest,
EXPECT_EQ("onunloadCookie=foo", GetCookies(url));
}
-namespace {
-
-// Handles |request| by serving a redirect response.
-scoped_ptr<net::test_server::HttpResponse> NoContentResponseHandler(
- const std::string& path,
- const net::test_server::HttpRequest& request) {
- if (!StartsWithASCII(path, request.relative_url, true))
- return scoped_ptr<net::test_server::HttpResponse>(NULL);
-
- scoped_ptr<net::test_server::BasicHttpResponse> http_response(
- new net::test_server::BasicHttpResponse);
- http_response->set_code(net::test_server::NO_CONTENT);
- return http_response.PassAs<net::test_server::HttpResponse>();
-}
-
-} // namespace
-
// Tests that the unload handler is not run for 204 responses.
// If this flakes use http://crbug.com/80596.
IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest,
CrossSiteNoUnloadOn204) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(test_server()->Start());
// Start with a URL that sets a cookie in its unload handler.
- GURL url = embedded_test_server()->GetURL("/onunload_cookie.html");
+ GURL url = test_server()->GetURL("files/onunload_cookie.html");
CheckTitleTest(url, "set cookie on unload");
// Navigate to a cross-site URL that returns a 204 No Content response.
- const char kNoContentPath[] = "/nocontent";
- embedded_test_server()->RegisterRequestHandler(
- base::Bind(&NoContentResponseHandler, kNoContentPath));
- NavigateToURL(shell(), embedded_test_server()->GetURL(kNoContentPath));
+ NavigateToURL(shell(), test_server()->GetURL("nocontent"));
// Check that the unload cookie was not set.
EXPECT_EQ("", GetCookies(url));
@@ -327,9 +305,9 @@ IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest,
// Flaky: http://crbug.com/100823
IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest,
CrossSiteNavigationErrorPage) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(test_server()->Start());
- GURL url(embedded_test_server()->GetURL("/onunload_cookie.html"));
+ GURL url(test_server()->GetURL("files/onunload_cookie.html"));
CheckTitleTest(url, "set cookie on unload");
// Navigate to a new cross-site URL that results in an error.
@@ -359,7 +337,7 @@ IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest,
TitleWatcher title_watcher(shell()->web_contents(), expected_title16);
bool success;
- GURL test_url(embedded_test_server()->GetURL("/title2.html"));
+ GURL test_url(test_server()->GetURL("files/title2.html"));
std::string redirect_script = "window.location='" +
test_url.possibly_invalid_spec() + "';" +
"window.domAutomationController.send(true);";
@@ -372,9 +350,9 @@ IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest,
IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest,
CrossSiteNavigationErrorPage2) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(test_server()->Start());
- GURL url(embedded_test_server()->GetURL("/title2.html"));
+ GURL url(test_server()->GetURL("files/title2.html"));
CheckTitleTest(url, "Title Of Awesomeness");
// Navigate to a new cross-site URL that results in an error.
diff --git a/content/browser/media/webrtc_browsertest.cc b/content/browser/media/webrtc_browsertest.cc
index 7c99007..fcd6ad8 100644
--- a/content/browser/media/webrtc_browsertest.cc
+++ b/content/browser/media/webrtc_browsertest.cc
@@ -10,7 +10,7 @@
#include "content/shell/shell.h"
#include "content/test/content_browser_test.h"
#include "content/test/content_browser_test_utils.h"
-#include "net/test/embedded_test_server/embedded_test_server.h"
+#include "net/test/spawned_test_server/spawned_test_server.h"
#if defined(OS_WIN)
#include "base/win/windows_version.h"
@@ -29,9 +29,8 @@ class WebrtcBrowserTest: public ContentBrowserTest {
ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch(
switches::kUseFakeDeviceForMediaStream));
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(test_server()->Start());
}
-
protected:
bool ExecuteJavascript(const std::string& javascript) {
return ExecuteScript(shell()->web_contents(), javascript);
@@ -48,7 +47,7 @@ class WebrtcBrowserTest: public ContentBrowserTest {
// see that the success callback is called. If the error callback is called or
// none of the callbacks are called the tests will simply time out and fail.
IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, GetVideoStreamAndStop) {
- GURL url(embedded_test_server()->GetURL("/media/getusermedia.html"));
+ GURL url(test_server()->GetURL("files/media/getusermedia.html"));
NavigateToURL(shell(), url);
EXPECT_TRUE(ExecuteJavascript("getUserMedia({video: true});"));
@@ -57,7 +56,7 @@ IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, GetVideoStreamAndStop) {
}
IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, GetAudioAndVideoStreamAndStop) {
- GURL url(embedded_test_server()->GetURL("/media/getusermedia.html"));
+ GURL url(test_server()->GetURL("files/media/getusermedia.html"));
NavigateToURL(shell(), url);
EXPECT_TRUE(ExecuteJavascript("getUserMedia({video: true, audio: true});"));
@@ -66,7 +65,7 @@ IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, GetAudioAndVideoStreamAndStop) {
}
IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, GetAudioAndVideoStreamAndClone) {
- GURL url(embedded_test_server()->GetURL("/media/getusermedia.html"));
+ GURL url(test_server()->GetURL("files/media/getusermedia.html"));
NavigateToURL(shell(), url);
EXPECT_TRUE(ExecuteJavascript("getUserMediaAndClone();"));
@@ -85,7 +84,7 @@ IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, GetAudioAndVideoStreamAndClone) {
// These tests will make a complete PeerConnection-based call and verify that
// video is playing for the call.
IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, MAYBE_CanSetupVideoCall) {
- GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
+ GURL url(test_server()->GetURL("files/media/peerconnection-call.html"));
NavigateToURL(shell(), url);
EXPECT_TRUE(ExecuteJavascript("call({video: true});"));
@@ -100,7 +99,7 @@ IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, MAYBE_CanSetupVideoCall) {
#endif
IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, MAYBE_CanSetupAudioAndVideoCall) {
- GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
+ GURL url(test_server()->GetURL("files/media/peerconnection-call.html"));
NavigateToURL(shell(), url);
EXPECT_TRUE(ExecuteJavascript("call({video: true, audio: true});"));
@@ -108,7 +107,7 @@ IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, MAYBE_CanSetupAudioAndVideoCall) {
}
IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, MANUAL_CanSetupCallAndSendDtmf) {
- GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
+ GURL url(test_server()->GetURL("files/media/peerconnection-call.html"));
NavigateToURL(shell(), url);
EXPECT_TRUE(
@@ -118,7 +117,7 @@ IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, MANUAL_CanSetupCallAndSendDtmf) {
// TODO(miu): Test is flaky. http://crbug.com/236102
IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest,
DISABLED_CanMakeEmptyCallThenAddStreamsAndRenegotiate) {
- GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
+ GURL url(test_server()->GetURL("files/media/peerconnection-call.html"));
NavigateToURL(shell(), url);
const char* kJavascript =
@@ -146,7 +145,7 @@ IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest,
#endif
IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest,
MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle) {
- GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
+ GURL url(test_server()->GetURL("files/media/peerconnection-call.html"));
NavigateToURL(shell(), url);
EXPECT_TRUE(ExecuteJavascript("callWithoutMsidAndBundle();"));
@@ -156,7 +155,7 @@ IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest,
// This test will make a PeerConnection-based call and test an unreliable text
// dataChannel.
IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, CallWithDataOnly) {
- GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
+ GURL url(test_server()->GetURL("files/media/peerconnection-call.html"));
NavigateToURL(shell(), url);
EXPECT_TRUE(ExecuteJavascript("callWithDataOnly();"));
@@ -173,7 +172,7 @@ IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, CallWithDataOnly) {
// This test will make a PeerConnection-based call and test an unreliable text
// dataChannel and audio and video tracks.
IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, MAYBE_CallWithDataAndMedia) {
- GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
+ GURL url(test_server()->GetURL("files/media/peerconnection-call.html"));
NavigateToURL(shell(), url);
EXPECT_TRUE(ExecuteJavascript("callWithDataAndMedia();"));
@@ -183,7 +182,7 @@ IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, MAYBE_CallWithDataAndMedia) {
// This test will make a PeerConnection-based call and test an unreliable text
// dataChannel and later add an audio and video track.
IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, CallWithDataAndLaterAddMedia) {
- GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
+ GURL url(test_server()->GetURL("files/media/peerconnection-call.html"));
NavigateToURL(shell(), url);
EXPECT_TRUE(ExecuteJavascript("callWithDataAndLaterAddMedia();"));
@@ -201,7 +200,7 @@ IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, CallWithDataAndLaterAddMedia) {
// MediaStream that has been created based on a MediaStream created with
// getUserMedia.
IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, MAYBE_CallWithNewVideoMediaStream) {
- GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
+ GURL url(test_server()->GetURL("files/media/peerconnection-call.html"));
NavigateToURL(shell(), url);
EXPECT_TRUE(ExecuteJavascript("callWithNewVideoMediaStream();"));
@@ -215,7 +214,7 @@ IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, MAYBE_CallWithNewVideoMediaStream) {
// TODO(phoglund): This test is manual since not all buildbots has an audio
// input.
IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, MANUAL_CallAndModifyStream) {
- GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
+ GURL url(test_server()->GetURL("files/media/peerconnection-call.html"));
NavigateToURL(shell(), url);
EXPECT_TRUE(
diff --git a/content/browser/media/webrtc_internals_browsertest.cc b/content/browser/media/webrtc_internals_browsertest.cc
index 46b513f..4c64474 100644
--- a/content/browser/media/webrtc_internals_browsertest.cc
+++ b/content/browser/media/webrtc_internals_browsertest.cc
@@ -12,7 +12,7 @@
#include "content/shell/shell.h"
#include "content/test/content_browser_test.h"
#include "content/test/content_browser_test_utils.h"
-#include "net/test/embedded_test_server/embedded_test_server.h"
+#include "net/test/spawned_test_server/spawned_test_server.h"
using std::string;
namespace content {
@@ -128,6 +128,8 @@ class WebRTCInternalsBrowserTest: public ContentBrowserTest {
// assume this switch is set by default in content_browsertests.
ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch(
switches::kUseFakeDeviceForMediaStream));
+
+ ASSERT_TRUE(test_server()->Start());
}
protected:
@@ -580,8 +582,7 @@ IN_PROC_BROWSER_TEST_F(WebRTCInternalsBrowserTest, ConvertedGraphs) {
IN_PROC_BROWSER_TEST_F(WebRTCInternalsBrowserTest,
MAYBE_WithRealPeerConnectionCall) {
// Start a peerconnection call in the first window.
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
- GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
+ GURL url(test_server()->GetURL("files/media/peerconnection-call.html"));
NavigateToURL(shell(), url);
ASSERT_TRUE(ExecuteJavascript("call({video:true});"));
ExpectTitle("OK");
diff --git a/content/browser/renderer_host/render_view_host_browsertest.cc b/content/browser/renderer_host/render_view_host_browsertest.cc
index 8fb43e5..1170fe5 100644
--- a/content/browser/renderer_host/render_view_host_browsertest.cc
+++ b/content/browser/renderer_host/render_view_host_browsertest.cc
@@ -2,7 +2,6 @@
// 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"
@@ -11,14 +10,13 @@
#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/embedded_test_server/embedded_test_server.h"
+#include "net/test/spawned_test_server/spawned_test_server.h"
namespace content {
@@ -61,33 +59,30 @@ class RenderViewHostTestWebContentsObserver : public WebContentsObserver {
};
IN_PROC_BROWSER_TEST_F(RenderViewHostTest, FrameNavigateSocketAddress) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(test_server()->Start());
RenderViewHostTestWebContentsObserver observer(shell()->web_contents());
- GURL test_url = embedded_test_server()->GetURL("/simple_page.html");
+ GURL test_url = test_server()->GetURL("files/simple_page.html");
NavigateToURL(shell(), test_url);
- EXPECT_EQ(net::HostPortPair::FromURL(
- embedded_test_server()->base_url()).ToString(),
+ EXPECT_EQ(test_server()->host_port_pair().ToString(),
observer.observed_socket_address().ToString());
EXPECT_EQ(1, observer.navigation_count());
}
IN_PROC_BROWSER_TEST_F(RenderViewHostTest, BaseURLParam) {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+ ASSERT_TRUE(test_server()->Start());
RenderViewHostTestWebContentsObserver observer(shell()->web_contents());
// Base URL is not set if it is the same as the URL.
- GURL test_url = embedded_test_server()->GetURL("/simple_page.html");
+ GURL test_url = test_server()->GetURL("files/simple_page.tml");
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.
- 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"));
+ test_url = net::FilePathToFileURL(test_server()->document_root().Append(
+ FILE_PATH_LITERAL("google.mht")));
NavigateToURL(shell(), test_url);
EXPECT_EQ("http://www.google.com/", observer.base_url().spec());
}
diff --git a/content/browser/session_history_browsertest.cc b/content/browser/session_history_browsertest.cc
index d8a24ef..b2698b9d 100644
--- a/content/browser/session_history_browsertest.cc
+++ b/content/browser/session_history_browsertest.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/stringprintf.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "content/public/browser/navigation_controller.h"
@@ -15,43 +14,17 @@
#include "content/shell/shell.h"
#include "content/test/content_browser_test.h"
#include "content/test/content_browser_test_utils.h"
-#include "net/test/embedded_test_server/embedded_test_server.h"
-#include "net/test/embedded_test_server/http_response.h"
-#include "net/test/embedded_test_server/http_request.h"
+#include "net/test/spawned_test_server/spawned_test_server.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace content {
-namespace {
-
-// Handles |request| by serving a response with title set to request contents.
-scoped_ptr<net::test_server::HttpResponse> HandleEchoTitleRequest(
- const std::string& echotitle_path,
- const net::test_server::HttpRequest& request) {
- if (!StartsWithASCII(request.relative_url, echotitle_path, true))
- return scoped_ptr<net::test_server::HttpResponse>(NULL);
-
- scoped_ptr<net::test_server::BasicHttpResponse> http_response(
- new net::test_server::BasicHttpResponse);
- http_response->set_code(net::test_server::SUCCESS);
- http_response->set_content(
- base::StringPrintf(
- "<html><head><title>%s</title></head></html>",
- request.content.c_str()));
- return http_response.PassAs<net::test_server::HttpResponse>();
-}
-
-} // namespace
-
class SessionHistoryTest : public ContentBrowserTest {
protected:
SessionHistoryTest() {}
virtual void SetUpOnMainThread() OVERRIDE {
- ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
- embedded_test_server()->RegisterRequestHandler(
- base::Bind(&HandleEchoTitleRequest, "/echotitle"));
-
+ ASSERT_TRUE(test_server()->Start());
NavigateToURL(shell(), GURL(kAboutBlankURL));
}
@@ -93,8 +66,7 @@ class SessionHistoryTest : public ContentBrowserTest {
}
GURL GetURL(const std::string file) {
- return embedded_test_server()->GetURL(
- std::string("/session_history/") + file);
+ return test_server()->GetURL(std::string("files/session_history/") + file);
}
void NavigateAndCheckTitle(const char* filename,
@@ -325,9 +297,6 @@ IN_PROC_BROWSER_TEST_F(SessionHistoryTest, CrossFrameFormBackForward) {
// navigations. Bug 730379.
// If this flakes use http://crbug.com/61619.
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, FragmentBackForward) {
- embedded_test_server()->RegisterRequestHandler(
- base::Bind(&HandleEchoTitleRequest, "/echotitle"));
-
ASSERT_FALSE(CanGoBack());
GURL fragment(GetURL("fragment.html"));
diff --git a/content/browser/web_contents/web_contents_impl_browsertest.cc b/content/browser/web_contents/web_contents_impl_browsertest.cc
index 000da0e..96cabcf 100644
--- a/content/browser/web_contents/web_contents_impl_browsertest.cc
+++ b/content/browser/web_contents/web_contents_impl_browsertest.cc
@@ -17,6 +17,7 @@
#include "content/test/content_browser_test.h"
#include "content/test/content_browser_test_utils.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
+#include "net/test/spawned_test_server/spawned_test_server.h"
namespace content {
diff --git a/content/test/data/browser_plugin_dragging.html b/content/test/data/browser_plugin_dragging.html
index 66375e0..1a0c38c 100644
--- a/content/test/data/browser_plugin_dragging.html
+++ b/content/test/data/browser_plugin_dragging.html
@@ -1,7 +1,3 @@
-<html>
-<head></head>
-<body>
-
<textarea id='id_message'>
</textarea>
@@ -30,6 +26,3 @@ function SetSrc(src) {
plugin.src = src;
}
</script>
-
-</body>
-</html>