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 3 // found in the LICENSE file. 4 5 #include "ppapi/shared_impl/test_harness_utils.h" 6 7 #include <string> 8 #include "base/macros.h" 9 10 namespace ppapi { 11 StripTestPrefixes(const std::string & test_name)12std::string StripTestPrefixes(const std::string& test_name) { 13 const char* const kTestPrefixes[] = { 14 "FAILS_", "FLAKY_", "DISABLED_", "SLOW_" }; 15 for (size_t i = 0; i < arraysize(kTestPrefixes); ++i) 16 if (test_name.find(kTestPrefixes[i]) == 0) 17 return test_name.substr(strlen(kTestPrefixes[i])); 18 return test_name; 19 } 20 GetTestLibraryName()21base::FilePath::StringType GetTestLibraryName() { 22 #if defined(OS_WIN) 23 return L"ppapi_tests.dll"; 24 #elif defined(OS_MACOSX) 25 return "ppapi_tests.plugin"; 26 #elif defined(OS_POSIX) 27 return "libppapi_tests.so"; 28 #endif 29 } 30 31 } // namespace ppapi 32