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

Side by Side Diff: content/public/test/ppapi_test_utils.cc

Issue 1140953003: PPAPI Testing: Clean up location of ppapi::StripTestPrefixes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move to shared_impl Created 5 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/public/test/ppapi_test_utils.h" 5 #include "content/public/test/ppapi_test_utils.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 20 matching lines...) Expand all
31 base::FilePath::StringType pepper_plugin = plugin_path.value(); 31 base::FilePath::StringType pepper_plugin = plugin_path.value();
32 pepper_plugin.append(extra_registration_parameters); 32 pepper_plugin.append(extra_registration_parameters);
33 pepper_plugin.append(FILE_PATH_LITERAL(";application/x-ppapi-tests")); 33 pepper_plugin.append(FILE_PATH_LITERAL(";application/x-ppapi-tests"));
34 command_line->AppendSwitchNative(switches::kRegisterPepperPlugins, 34 command_line->AppendSwitchNative(switches::kRegisterPepperPlugins,
35 pepper_plugin); 35 pepper_plugin);
36 return true; 36 return true;
37 } 37 }
38 38
39 } // namespace 39 } // namespace
40 40
41 std::string StripTestPrefixes(const std::string& test_name) {
42 if (test_name.find("DISABLED_") == 0)
43 return test_name.substr(strlen("DISABLED_"));
44 return test_name;
45 }
46
47 bool RegisterTestPlugin(base::CommandLine* command_line) { 41 bool RegisterTestPlugin(base::CommandLine* command_line) {
48 return RegisterTestPluginWithExtraParameters(command_line, 42 return RegisterTestPluginWithExtraParameters(command_line,
49 FILE_PATH_LITERAL("")); 43 FILE_PATH_LITERAL(""));
50 } 44 }
51 45
52 bool RegisterTestPluginWithExtraParameters( 46 bool RegisterTestPluginWithExtraParameters(
53 base::CommandLine* command_line, 47 base::CommandLine* command_line,
54 const base::FilePath::StringType& extra_registration_parameters) { 48 const base::FilePath::StringType& extra_registration_parameters) {
55 #if defined(OS_WIN) 49 #if defined(OS_WIN)
56 base::FilePath::StringType plugin_library = L"ppapi_tests.dll"; 50 base::FilePath::StringType plugin_library = L"ppapi_tests.dll";
57 #elif defined(OS_MACOSX) 51 #elif defined(OS_MACOSX)
58 base::FilePath::StringType plugin_library = "ppapi_tests.plugin"; 52 base::FilePath::StringType plugin_library = "ppapi_tests.plugin";
59 #elif defined(OS_POSIX) 53 #elif defined(OS_POSIX)
60 base::FilePath::StringType plugin_library = "libppapi_tests.so"; 54 base::FilePath::StringType plugin_library = "libppapi_tests.so";
61 #endif 55 #endif
62 return RegisterPlugin(command_line, plugin_library, 56 return RegisterPlugin(command_line, plugin_library,
63 extra_registration_parameters); 57 extra_registration_parameters);
64 } 58 }
65 59
66 bool RegisterPowerSaverTestPlugin(base::CommandLine* command_line) { 60 bool RegisterPowerSaverTestPlugin(base::CommandLine* command_line) {
67 base::FilePath::StringType library_name = 61 base::FilePath::StringType library_name =
68 base::FilePath::FromUTF8Unsafe(ppapi::kPowerSaverTestPluginName).value(); 62 base::FilePath::FromUTF8Unsafe(ppapi::kPowerSaverTestPluginName).value();
69 return RegisterPlugin(command_line, library_name, FILE_PATH_LITERAL("")); 63 return RegisterPlugin(command_line, library_name, FILE_PATH_LITERAL(""));
70 } 64 }
71 65
72 } // namespace ppapi 66 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698