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

Side by Side Diff: chrome/test/ppapi/ppapi_test.cc

Issue 451923002: Add a X-Requested-With header to URL requests for PPAPI Flash (only). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add comment about -1. Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/ppapi/ppapi_browsertest.cc ('k') | content/child/request_extra_data.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/path_service.h" 9 #include "base/path_service.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 278
279 return http_server.GetURL(query); 279 return http_server.GetURL(query);
280 } 280 }
281 281
282 PPAPITest::PPAPITest() : in_process_(true) { 282 PPAPITest::PPAPITest() : in_process_(true) {
283 } 283 }
284 284
285 void PPAPITest::SetUpCommandLine(base::CommandLine* command_line) { 285 void PPAPITest::SetUpCommandLine(base::CommandLine* command_line) {
286 PPAPITestBase::SetUpCommandLine(command_line); 286 PPAPITestBase::SetUpCommandLine(command_line);
287 287
288 // Append the switch to register the pepper plugin.
289 // library name = <out dir>/<test_name>.<library_extension>
290 // MIME type = application/x-ppapi-<test_name>
291 base::FilePath plugin_dir; 288 base::FilePath plugin_dir;
292 EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &plugin_dir)); 289 EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &plugin_dir));
293 290
294 base::FilePath plugin_lib = plugin_dir.Append(ppapi::GetTestLibraryName()); 291 base::FilePath plugin_lib = plugin_dir.Append(ppapi::GetTestLibraryName());
295 EXPECT_TRUE(base::PathExists(plugin_lib)); 292 EXPECT_TRUE(base::PathExists(plugin_lib));
293
294 // Append the switch to register the pepper plugin.
295 // library path = <out dir>/<test_name>.<library_extension>
296 // library name = "PPAPI Tests"
297 // version = "1.2.3"
298 // MIME type = application/x-ppapi-<test_name>
296 base::FilePath::StringType pepper_plugin = plugin_lib.value(); 299 base::FilePath::StringType pepper_plugin = plugin_lib.value();
300 pepper_plugin.append(FILE_PATH_LITERAL("#PPAPI Tests"));
301 pepper_plugin.append(FILE_PATH_LITERAL("#")); // No description.
302 pepper_plugin.append(FILE_PATH_LITERAL("#1.2.3"));
297 pepper_plugin.append(FILE_PATH_LITERAL(";application/x-ppapi-tests")); 303 pepper_plugin.append(FILE_PATH_LITERAL(";application/x-ppapi-tests"));
298 command_line->AppendSwitchNative(switches::kRegisterPepperPlugins, 304 command_line->AppendSwitchNative(switches::kRegisterPepperPlugins,
299 pepper_plugin); 305 pepper_plugin);
306
300 command_line->AppendSwitchASCII(switches::kAllowNaClSocketAPI, "127.0.0.1"); 307 command_line->AppendSwitchASCII(switches::kAllowNaClSocketAPI, "127.0.0.1");
301
302 if (in_process_) 308 if (in_process_)
303 command_line->AppendSwitch(switches::kPpapiInProcess); 309 command_line->AppendSwitch(switches::kPpapiInProcess);
304 } 310 }
305 311
306 std::string PPAPITest::BuildQuery(const std::string& base, 312 std::string PPAPITest::BuildQuery(const std::string& base,
307 const std::string& test_case){ 313 const std::string& test_case){
308 return base::StringPrintf("%stestcase=%s", base.c_str(), test_case.c_str()); 314 return base::StringPrintf("%stestcase=%s", base.c_str(), test_case.c_str());
309 } 315 }
310 316
311 void PPAPIPrivateTest::SetUpCommandLine(base::CommandLine* command_line) { 317 void PPAPIPrivateTest::SetUpCommandLine(base::CommandLine* command_line) {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 const std::string& base, 461 const std::string& base,
456 const std::string& test_case) { 462 const std::string& test_case) {
457 return base::StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), 463 return base::StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(),
458 test_case.c_str()); 464 test_case.c_str());
459 } 465 }
460 466
461 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { 467 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() {
462 // The default content setting for the PPAPI broker is ASK. We purposefully 468 // The default content setting for the PPAPI broker is ASK. We purposefully
463 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. 469 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way.
464 } 470 }
OLDNEW
« no previous file with comments | « chrome/test/ppapi/ppapi_browsertest.cc ('k') | content/child/request_extra_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698