Commit a88b609b authored by tommycli's avatar tommycli Committed by Commit bot

PPAPI Testing: Clean up location of ppapi::StripTestPrefixes

BUG=478309

Review URL: https://codereview.chromium.org/1140953003

Cr-Commit-Position: refs/heads/master@{#329874}
parent 5b9b392d
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h" #include "content/public/common/url_constants.h"
#include "content/public/test/javascript_test_observer.h" #include "content/public/test/javascript_test_observer.h"
#include "content/public/test/ppapi_test_utils.h"
#include "content/public/test/test_renderer_host.h" #include "content/public/test/test_renderer_host.h"
#include "extensions/common/constants.h" #include "extensions/common/constants.h"
#include "extensions/test/extension_test_message_listener.h" #include "extensions/test/extension_test_message_listener.h"
#include "ppapi/shared_impl/test_utils.h"
using content::RenderViewHost; using content::RenderViewHost;
......
...@@ -38,12 +38,6 @@ bool RegisterPlugin( ...@@ -38,12 +38,6 @@ bool RegisterPlugin(
} // namespace } // namespace
std::string StripTestPrefixes(const std::string& test_name) {
if (test_name.find("DISABLED_") == 0)
return test_name.substr(strlen("DISABLED_"));
return test_name;
}
bool RegisterTestPlugin(base::CommandLine* command_line) { bool RegisterTestPlugin(base::CommandLine* command_line) {
return RegisterTestPluginWithExtraParameters(command_line, return RegisterTestPluginWithExtraParameters(command_line,
FILE_PATH_LITERAL("")); FILE_PATH_LITERAL(""));
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
#ifndef CONTENT_PUBLIC_TEST_PPAPI_TEST_UTILS_H_ #ifndef CONTENT_PUBLIC_TEST_PPAPI_TEST_UTILS_H_
#define CONTENT_PUBLIC_TEST_PPAPI_TEST_UTILS_H_ #define CONTENT_PUBLIC_TEST_PPAPI_TEST_UTILS_H_
#include <string>
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
...@@ -18,9 +16,6 @@ class CommandLine; ...@@ -18,9 +16,6 @@ class CommandLine;
// browser_tests and content_browsertests. // browser_tests and content_browsertests.
namespace ppapi { namespace ppapi {
// Strips prefixes used to annotate tests from a test name.
std::string StripTestPrefixes(const std::string& test_name);
// Registers the PPAPI test plugin to application/x-ppapi-tests. Returns true // Registers the PPAPI test plugin to application/x-ppapi-tests. Returns true
// on success, and false otherwise. // on success, and false otherwise.
bool RegisterTestPlugin(base::CommandLine* command_line) WARN_UNUSED_RESULT; bool RegisterTestPlugin(base::CommandLine* command_line) WARN_UNUSED_RESULT;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "ppapi/shared_impl/proxy_lock.h" #include "ppapi/shared_impl/proxy_lock.h"
#include "ppapi/shared_impl/scoped_pp_var.h" #include "ppapi/shared_impl/scoped_pp_var.h"
#include "ppapi/shared_impl/test_globals.h" #include "ppapi/shared_impl/test_globals.h"
#include "ppapi/shared_impl/unittest_utils.h" #include "ppapi/shared_impl/test_utils.h"
#include "ppapi/shared_impl/var.h" #include "ppapi/shared_impl/var.h"
#include "ppapi/shared_impl/var_tracker.h" #include "ppapi/shared_impl/var_tracker.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "content/public/test/ppapi_test_utils.h"
#include "content/test/ppapi/ppapi_test.h" #include "content/test/ppapi/ppapi_test.h"
#include "ppapi/shared_impl/test_utils.h"
// This file lists tests for Pepper APIs (without NaCl) against content_shell. // This file lists tests for Pepper APIs (without NaCl) against content_shell.
// TODO(teravest): Move more tests here. http://crbug.com/371873 // TODO(teravest): Move more tests here. http://crbug.com/371873
......
...@@ -122,8 +122,8 @@ ...@@ -122,8 +122,8 @@
'proxy/resource_message_test_sink.h', 'proxy/resource_message_test_sink.h',
'shared_impl/test_globals.cc', 'shared_impl/test_globals.cc',
'shared_impl/test_globals.h', 'shared_impl/test_globals.h',
'shared_impl/unittest_utils.cc', 'shared_impl/test_utils.cc',
'shared_impl/unittest_utils.h', 'shared_impl/test_utils.h',
], ],
}, },
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "ppapi/shared_impl/resource_var.h" #include "ppapi/shared_impl/resource_var.h"
#include "ppapi/shared_impl/scoped_pp_var.h" #include "ppapi/shared_impl/scoped_pp_var.h"
#include "ppapi/shared_impl/test_globals.h" #include "ppapi/shared_impl/test_globals.h"
#include "ppapi/shared_impl/unittest_utils.h" #include "ppapi/shared_impl/test_utils.h"
#include "ppapi/shared_impl/var.h" #include "ppapi/shared_impl/var.h"
#include "ppapi/shared_impl/var_tracker.h" #include "ppapi/shared_impl/var_tracker.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
......
...@@ -193,8 +193,8 @@ source_set("test_support") { ...@@ -193,8 +193,8 @@ source_set("test_support") {
sources = [ sources = [
"test_globals.cc", "test_globals.cc",
"test_globals.h", "test_globals.h",
"unittest_utils.cc", "test_utils.cc",
"unittest_utils.h", "test_utils.h",
] ]
deps = [ deps = [
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "ppapi/shared_impl/unittest_utils.h" #include "ppapi/shared_impl/test_utils.h"
#include <cmath> #include <cmath>
...@@ -209,4 +209,10 @@ bool TestEqual(const PP_Var& expected, ...@@ -209,4 +209,10 @@ bool TestEqual(const PP_Var& expected,
return Equals(expected, actual, test_string_references, &visited_map); return Equals(expected, actual, test_string_references, &visited_map);
} }
std::string StripTestPrefixes(const std::string& test_name) {
if (test_name.find("DISABLED_") == 0)
return test_name.substr(strlen("DISABLED_"));
return test_name;
}
} // namespace ppapi } // namespace ppapi
...@@ -2,8 +2,10 @@ ...@@ -2,8 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef PPAPI_SHARED_IMPL_UNITTEST_UTILS_H_ #ifndef PPAPI_SHARED_IMPL_TEST_UTILS_H_
#define PPAPI_SHARED_IMPL_UNITTEST_UTILS_H_ #define PPAPI_SHARED_IMPL_TEST_UTILS_H_
#include <string>
#include "ppapi/c/pp_var.h" #include "ppapi/c/pp_var.h"
...@@ -19,6 +21,8 @@ bool TestEqual(const PP_Var& expected, ...@@ -19,6 +21,8 @@ bool TestEqual(const PP_Var& expected,
const PP_Var& actual, const PP_Var& actual,
bool test_string_references); bool test_string_references);
std::string StripTestPrefixes(const std::string& test_name);
} // namespace ppapi } // namespace ppapi
#endif // PPAPI_SHARED_IMPL_UNITTEST_UTILS_H_ #endif // PPAPI_SHARED_IMPL_TEST_UTILS_H_
...@@ -18,11 +18,8 @@ ...@@ -18,11 +18,8 @@
namespace { namespace {
std::string StripPrefix(const std::string& test_name) { std::string StripPrefix(const std::string& test_name) {
const char* const prefixes[] = { if (test_name.find("DISABLED_") == 0)
"FAILS_", "FLAKY_", "DISABLED_" }; return test_name.substr(strlen("DISABLED_"));
for (size_t i = 0; i < sizeof(prefixes)/sizeof(prefixes[0]); ++i)
if (test_name.find(prefixes[i]) == 0)
return test_name.substr(strlen(prefixes[i]));
return test_name; return test_name;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment