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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 net::TestServer test_server(net::TestServer::TYPE_HTTPS, | 187 net::TestServer test_server(net::TestServer::TYPE_HTTPS, |
188 net::BaseTestServer::SSLOptions(), | 188 net::BaseTestServer::SSLOptions(), |
189 document_root); | 189 document_root); |
190 ASSERT_TRUE(test_server.Start()); | 190 ASSERT_TRUE(test_server.Start()); |
191 uint16_t port = test_server.host_port_pair().port(); | 191 uint16_t port = test_server.host_port_pair().port(); |
192 RunHTTPTestServer(document_root, test_case, | 192 RunHTTPTestServer(document_root, test_case, |
193 StringPrintf("ssl_server_port=%d", port)); | 193 StringPrintf("ssl_server_port=%d", port)); |
194 } | 194 } |
195 | 195 |
196 void PPAPITestBase::RunTestWithWebSocketServer(const std::string& test_case) { | 196 void PPAPITestBase::RunTestWithWebSocketServer(const std::string& test_case) { |
197 FilePath websocket_root_dir; | 197 net::TestServer server(net::TestServer::TYPE_WS, |
198 ASSERT_TRUE( | 198 net::TestServer::kLocalhost, |
199 PathService::Get(content::DIR_LAYOUT_TESTS, &websocket_root_dir)); | 199 FilePath(FILE_PATH_LITERAL("net/data/websocket"))); |
200 content::TestWebSocketServer server; | 200 ASSERT_TRUE(server.Start()); |
201 int port = server.UseRandomPort(); | 201 uint16_t port = server.host_port_pair().port(); |
202 ASSERT_TRUE(server.Start(websocket_root_dir)); | |
203 FilePath http_document_root; | 202 FilePath http_document_root; |
204 ASSERT_TRUE(ui_test_utils::GetRelativeBuildDirectory(&http_document_root)); | 203 ASSERT_TRUE(ui_test_utils::GetRelativeBuildDirectory(&http_document_root)); |
205 RunHTTPTestServer(http_document_root, test_case, | 204 RunHTTPTestServer(http_document_root, test_case, |
206 StringPrintf("websocket_port=%d", port)); | 205 StringPrintf("websocket_port=%d", port)); |
207 } | 206 } |
208 | 207 |
209 void PPAPITestBase::RunTestIfAudioOutputAvailable( | 208 void PPAPITestBase::RunTestIfAudioOutputAvailable( |
210 const std::string& test_case) { | 209 const std::string& test_case) { |
211 if (IsAudioOutputAvailable()) { | 210 if (IsAudioOutputAvailable()) { |
212 RunTest(test_case); | 211 RunTest(test_case); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 const std::string& base, | 346 const std::string& base, |
348 const std::string& test_case) { | 347 const std::string& test_case) { |
349 return StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), | 348 return StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), |
350 test_case.c_str()); | 349 test_case.c_str()); |
351 } | 350 } |
352 | 351 |
353 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { | 352 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { |
354 // The default content setting for the PPAPI broker is ASK. We purposefully | 353 // The default content setting for the PPAPI broker is ASK. We purposefully |
355 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. | 354 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. |
356 } | 355 } |
OLD | NEW |