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

Unified Diff: chrome/browser/media/media_browsertest.cc

Issue 1409163006: Migrating tests to use EmbeddedTestServer (/chrome/browser misc) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 1 month 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
« no previous file with comments | « chrome/browser/media/media_browsertest.h ('k') | chrome/browser/notifications/notification_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/media_browsertest.cc
diff --git a/chrome/browser/media/media_browsertest.cc b/chrome/browser/media/media_browsertest.cc
index 53056adedee5c44e871dec73fc6efd5d980d5b38..6aa919e0487e978be21bc1b5bf33d7d4645071b8 100644
--- a/chrome/browser/media/media_browsertest.cc
+++ b/chrome/browser/media/media_browsertest.cc
@@ -15,7 +15,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test_utils.h"
#include "media/base/test_data_util.h"
-#include "net/test/spawned_test_server/spawned_test_server.h"
+#include "net/test/embedded_test_server/embedded_test_server.h"
// Common test results.
const char MediaBrowserTest::kEnded[] = "ENDED";
@@ -34,16 +34,14 @@ void MediaBrowserTest::RunMediaTestPage(const std::string& html_page,
bool http) {
GURL gurl;
std::string query = media::GetURLQueryString(query_params);
- scoped_ptr<net::SpawnedTestServer> http_test_server;
+ scoped_ptr<net::EmbeddedTestServer> http_test_server;
if (http) {
DVLOG(0) << base::TimeFormatTimeOfDayWithMilliseconds(base::Time::Now())
<< " Starting HTTP server";
- http_test_server.reset(
- new net::SpawnedTestServer(net::SpawnedTestServer::TYPE_HTTP,
- net::SpawnedTestServer::kLocalhost,
- media::GetTestDataPath()));
+ http_test_server.reset(new net::EmbeddedTestServer);
+ http_test_server->ServeFilesFromSourceDirectory(media::GetTestDataPath());
CHECK(http_test_server->Start());
- gurl = http_test_server->GetURL("files/" + html_page + "?" + query);
+ gurl = http_test_server->GetURL("/" + html_page + "?" + query);
} else {
gurl = content::GetFileUrlWithQuery(media::GetTestDataFilePath(html_page),
query);
@@ -84,4 +82,3 @@ void MediaBrowserTest::PluginCrashed(const base::FilePath& plugin_path,
void MediaBrowserTest::IgnorePluginCrash() {
ignore_plugin_crash_ = true;
}
-
« no previous file with comments | « chrome/browser/media/media_browsertest.h ('k') | chrome/browser/notifications/notification_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698