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

Unified Diff: chrome/browser/extensions/extension_apitest.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/extension_apitest.cc
diff --git a/chrome/browser/extensions/extension_apitest.cc b/chrome/browser/extensions/extension_apitest.cc
index 261ee75355bd0f3a42470791faf6aacf7d9eb847..c039ba7ef3a2f5460221e0afe2a7f7563a7d2c67 100644
--- a/chrome/browser/extensions/extension_apitest.cc
+++ b/chrome/browser/extensions/extension_apitest.cc
@@ -33,12 +33,11 @@
namespace {
const char kTestCustomArg[] = "customArg";
-const char kTestServerPort[] = "testServer.port";
const char kTestDataDirectory[] = "testDataDirectory";
const char kTestWebSocketPort[] = "testWebSocketPort";
const char kSitePerProcess[] = "sitePerProcess";
const char kFtpServerPort[] = "ftpServer.port";
-const char kSpawnedTestServerPort[] = "spawnedTestServer.port";
+const char kEmbeddedTestServerPort[] = "testServer.port";
scoped_ptr<net::test_server::HttpResponse> HandleServerRedirectRequest(
const net::test_server::HttpRequest& request) {
@@ -370,13 +369,13 @@ const extensions::Extension* ExtensionApiTest::GetSingleLoadedExtension() {
}
bool ExtensionApiTest::StartEmbeddedTestServer() {
- if (!embedded_test_server()->InitializeAndWaitUntilReady())
+ if (!embedded_test_server()->Start())
return false;
// Build a dictionary of values that tests can use to build URLs that
// access the test server and local file system. Tests can see these values
// using the extension API function chrome.test.getConfig().
- test_config_->SetInteger(kTestServerPort,
+ test_config_->SetInteger(kEmbeddedTestServerPort,
embedded_test_server()->port());
return true;
@@ -413,19 +412,6 @@ bool ExtensionApiTest::StartFTPServer(const base::FilePath& root_directory) {
return true;
}
-bool ExtensionApiTest::StartSpawnedTestServer() {
- if (!test_server()->Start())
- return false;
-
- // Build a dictionary of values that tests can use to build URLs that
- // access the test server and local file system. Tests can see these values
- // using the extension API function chrome.test.getConfig().
- test_config_->SetInteger(kSpawnedTestServerPort,
- test_server()->host_port_pair().port());
-
- return true;
-}
-
void ExtensionApiTest::SetUpCommandLine(base::CommandLine* command_line) {
ExtensionBrowserTest::SetUpCommandLine(command_line);
test_data_dir_ = test_data_dir_.AppendASCII("api_test");
« no previous file with comments | « chrome/browser/extensions/extension_apitest.h ('k') | chrome/browser/extensions/extension_keybinding_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698