OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/test/ppapi/ppapi_test.h" | 5 #include "chrome/test/ppapi/ppapi_test.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 net::TestServer ws_server(net::TestServer::TYPE_WS, | 212 net::TestServer ws_server(net::TestServer::TYPE_WS, |
213 net::TestServer::kLocalhost, | 213 net::TestServer::kLocalhost, |
214 net::GetWebSocketTestDataDirectory()); | 214 net::GetWebSocketTestDataDirectory()); |
215 // Start the servers in parallel. | 215 // Start the servers in parallel. |
216 ASSERT_TRUE(http_server.StartInBackground()); | 216 ASSERT_TRUE(http_server.StartInBackground()); |
217 ASSERT_TRUE(ws_server.StartInBackground()); | 217 ASSERT_TRUE(ws_server.StartInBackground()); |
218 // Wait until they are both finished before continuing. | 218 // Wait until they are both finished before continuing. |
219 ASSERT_TRUE(http_server.BlockUntilStarted()); | 219 ASSERT_TRUE(http_server.BlockUntilStarted()); |
220 ASSERT_TRUE(ws_server.BlockUntilStarted()); | 220 ASSERT_TRUE(ws_server.BlockUntilStarted()); |
221 | 221 |
| 222 std::string host = ws_server.host_port_pair().HostForURL(); |
222 uint16_t port = ws_server.host_port_pair().port(); | 223 uint16_t port = ws_server.host_port_pair().port(); |
223 RunTestURL(GetTestURL(http_server, | 224 RunTestURL(GetTestURL(http_server, |
224 test_case, | 225 test_case, |
225 StringPrintf("websocket_port=%d", port))); | 226 StringPrintf("websocket_host=%s&websocket_port=%d", |
| 227 host.c_str(), |
| 228 port))); |
226 } | 229 } |
227 | 230 |
228 void PPAPITestBase::RunTestIfAudioOutputAvailable( | 231 void PPAPITestBase::RunTestIfAudioOutputAvailable( |
229 const std::string& test_case) { | 232 const std::string& test_case) { |
230 RunTest(test_case); | 233 RunTest(test_case); |
231 } | 234 } |
232 | 235 |
233 void PPAPITestBase::RunTestViaHTTPIfAudioOutputAvailable( | 236 void PPAPITestBase::RunTestViaHTTPIfAudioOutputAvailable( |
234 const std::string& test_case) { | 237 const std::string& test_case) { |
235 RunTestViaHTTP(test_case); | 238 RunTestViaHTTP(test_case); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 const std::string& base, | 354 const std::string& base, |
352 const std::string& test_case) { | 355 const std::string& test_case) { |
353 return StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), | 356 return StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), |
354 test_case.c_str()); | 357 test_case.c_str()); |
355 } | 358 } |
356 | 359 |
357 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { | 360 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { |
358 // The default content setting for the PPAPI broker is ASK. We purposefully | 361 // The default content setting for the PPAPI broker is ASK. We purposefully |
359 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. | 362 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. |
360 } | 363 } |
OLD | NEW |