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

Unified Diff: chrome/browser/extensions/webstore_installer_test.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
Index: chrome/browser/extensions/webstore_installer_test.cc
diff --git a/chrome/browser/extensions/webstore_installer_test.cc b/chrome/browser/extensions/webstore_installer_test.cc
index f5bb127aaafcb61a2b8b2fbe95abc63e9e202293..d2e0eaf8124e9b144d7da849ea151cf0c350d7fc 100644
--- a/chrome/browser/extensions/webstore_installer_test.cc
+++ b/chrome/browser/extensions/webstore_installer_test.cc
@@ -27,6 +27,7 @@
#include "content/public/test/browser_test_utils.h"
#include "net/base/host_port_pair.h"
#include "net/dns/mock_host_resolver.h"
+#include "net/test/embedded_test_server/embedded_test_server.h"
#include "url/gurl.h"
using content::WebContents;
@@ -55,12 +56,12 @@ void WebstoreInstallerTest::SetUpCommandLine(base::CommandLine* command_line) {
ExtensionBrowserTest::SetUpCommandLine(command_line);
// We start the test server now instead of in
// SetUpInProcessBrowserTestFixture so that we can get its port number.
- ASSERT_TRUE(test_server()->Start());
+ ASSERT_TRUE(embedded_test_server()->Start());
- net::HostPortPair host_port = test_server()->host_port_pair();
- test_gallery_url_ = base::StringPrintf(
- "http://%s:%d/files/%s",
- webstore_domain_.c_str(), host_port.port(), test_data_path_.c_str());
+ net::HostPortPair host_port = embedded_test_server()->host_port_pair();
+ test_gallery_url_ =
+ base::StringPrintf("http://%s:%d/%s", webstore_domain_.c_str(),
+ host_port.port(), test_data_path_.c_str());
command_line->AppendSwitchASCII(
switches::kAppsGalleryURL, test_gallery_url_);
@@ -90,10 +91,8 @@ void WebstoreInstallerTest::SetUpOnMainThread() {
GURL WebstoreInstallerTest::GenerateTestServerUrl(
const std::string& domain,
const std::string& page_filename) {
- GURL page_url = test_server()->GetURL(
- base::StringPrintf("files/%s/%s",
- test_data_path_.c_str(),
- page_filename.c_str()));
+ GURL page_url = embedded_test_server()->GetURL(base::StringPrintf(
+ "/%s/%s", test_data_path_.c_str(), page_filename.c_str()));
GURL::Replacements replace_host;
replace_host.SetHostStr(domain);
« no previous file with comments | « chrome/browser/extensions/wake_event_page_apitest.cc ('k') | chrome/browser/extensions/window_open_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698