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

Unified Diff: chrome/test/ppapi/ppapi_test.cc

Issue 12033057: Make PPAPI test servers start in parallel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add comments per review request Created 7 years, 11 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: chrome/test/ppapi/ppapi_test.cc
diff --git a/chrome/test/ppapi/ppapi_test.cc b/chrome/test/ppapi/ppapi_test.cc
index 018d0dd2e852c2615be31fb4d9948a230ae83513..5c1231830bfe67dee78f86251962393ca55826d4 100644
--- a/chrome/test/ppapi/ppapi_test.cc
+++ b/chrome/test/ppapi/ppapi_test.cc
@@ -34,7 +34,6 @@
#include "content/public/test/browser_test_utils.h"
#include "net/base/net_util.h"
#include "net/base/test_data_directory.h"
-#include "net/test/test_server.h"
#include "ppapi/shared_impl/ppapi_switches.h"
#include "ui/gl/gl_switches.h"
#include "webkit/plugins/plugin_switches.h"
@@ -173,7 +172,7 @@ void PPAPITestBase::RunTestAndReload(const std::string& test_case) {
void PPAPITestBase::RunTestViaHTTP(const std::string& test_case) {
FilePath document_root;
ASSERT_TRUE(ui_test_utils::GetRelativeBuildDirectory(&document_root));
- RunHTTPTestServer(document_root, test_case, "");
+ RunHTTPTestServer(document_root, test_case, "", NULL);
}
void PPAPITestBase::RunTestWithSSLServer(const std::string& test_case) {
@@ -182,22 +181,26 @@ void PPAPITestBase::RunTestWithSSLServer(const std::string& test_case) {
net::TestServer test_server(net::TestServer::TYPE_HTTPS,
net::BaseTestServer::SSLOptions(),
document_root);
- ASSERT_TRUE(test_server.Start());
+ ASSERT_TRUE(test_server.StartInBackground());
uint16_t port = test_server.host_port_pair().port();
- RunHTTPTestServer(document_root, test_case,
- StringPrintf("ssl_server_port=%d", port));
+ RunHTTPTestServer(document_root,
+ test_case,
+ StringPrintf("ssl_server_port=%d", port),
+ &test_server);
}
void PPAPITestBase::RunTestWithWebSocketServer(const std::string& test_case) {
net::TestServer server(net::TestServer::TYPE_WS,
net::TestServer::kLocalhost,
net::GetWebSocketTestDataDirectory());
- ASSERT_TRUE(server.Start());
+ ASSERT_TRUE(server.StartInBackground());
uint16_t port = server.host_port_pair().port();
FilePath http_document_root;
ASSERT_TRUE(ui_test_utils::GetRelativeBuildDirectory(&http_document_root));
- RunHTTPTestServer(http_document_root, test_case,
- StringPrintf("websocket_port=%d", port));
+ RunHTTPTestServer(http_document_root,
+ test_case,
+ StringPrintf("websocket_port=%d", port),
+ &server);
}
void PPAPITestBase::RunTestIfAudioOutputAvailable(
@@ -239,11 +242,15 @@ void PPAPITestBase::RunTestURL(const GURL& test_url) {
void PPAPITestBase::RunHTTPTestServer(
const FilePath& document_root,
const std::string& test_case,
- const std::string& extra_params) {
+ const std::string& extra_params,
+ net::TestServer* extra_server) {
net::TestServer test_server(net::TestServer::TYPE_HTTP,
net::TestServer::kLocalhost,
document_root);
- ASSERT_TRUE(test_server.Start());
+ ASSERT_TRUE(test_server.StartInBackground());
+ if (extra_server)
+ ASSERT_TRUE(extra_server->BlockUntilStarted());
+ ASSERT_TRUE(test_server.BlockUntilStarted());
std::string query = BuildQuery("files/test_case.html?", test_case);
if (!extra_params.empty())
query = StringPrintf("%s&%s", query.c_str(), extra_params.c_str());

Powered by Google App Engine
This is Rietveld 408576698