diff options
author | tommycli <tommycli@chromium.org> | 2015-05-14 10:54:01 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-14 17:54:08 +0000 |
commit | a88b609ba9a3df0f5cb9950a0564c9ee463f6f69 (patch) | |
tree | 7ce44328795e9675fca6b972eaf0c921dbad9410 /ppapi | |
parent | 5b9b392da0f2fb995f14bea06c11f87a3c33510a (diff) | |
download | chromium_src-a88b609ba9a3df0f5cb9950a0564c9ee463f6f69.zip chromium_src-a88b609ba9a3df0f5cb9950a0564c9ee463f6f69.tar.gz chromium_src-a88b609ba9a3df0f5cb9950a0564c9ee463f6f69.tar.bz2 |
PPAPI Testing: Clean up location of ppapi::StripTestPrefixes
BUG=478309
Review URL: https://codereview.chromium.org/1140953003
Cr-Commit-Position: refs/heads/master@{#329874}
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/ppapi_tests.gypi | 4 | ||||
-rw-r--r-- | ppapi/proxy/raw_var_data_unittest.cc | 2 | ||||
-rw-r--r-- | ppapi/shared_impl/BUILD.gn | 4 | ||||
-rw-r--r-- | ppapi/shared_impl/test_utils.cc (renamed from ppapi/shared_impl/unittest_utils.cc) | 8 | ||||
-rw-r--r-- | ppapi/shared_impl/test_utils.h (renamed from ppapi/shared_impl/unittest_utils.h) | 10 | ||||
-rw-r--r-- | ppapi/tests/test_case.cc | 7 |
6 files changed, 21 insertions, 14 deletions
diff --git a/ppapi/ppapi_tests.gypi b/ppapi/ppapi_tests.gypi index 6b23986..830933e 100644 --- a/ppapi/ppapi_tests.gypi +++ b/ppapi/ppapi_tests.gypi @@ -122,8 +122,8 @@ 'proxy/resource_message_test_sink.h', 'shared_impl/test_globals.cc', 'shared_impl/test_globals.h', - 'shared_impl/unittest_utils.cc', - 'shared_impl/unittest_utils.h', + 'shared_impl/test_utils.cc', + 'shared_impl/test_utils.h', ], }, diff --git a/ppapi/proxy/raw_var_data_unittest.cc b/ppapi/proxy/raw_var_data_unittest.cc index 3539d675..f555990 100644 --- a/ppapi/proxy/raw_var_data_unittest.cc +++ b/ppapi/proxy/raw_var_data_unittest.cc @@ -17,7 +17,7 @@ #include "ppapi/shared_impl/resource_var.h" #include "ppapi/shared_impl/scoped_pp_var.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_tracker.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/ppapi/shared_impl/BUILD.gn b/ppapi/shared_impl/BUILD.gn index 4226009..9d205ec 100644 --- a/ppapi/shared_impl/BUILD.gn +++ b/ppapi/shared_impl/BUILD.gn @@ -193,8 +193,8 @@ source_set("test_support") { sources = [ "test_globals.cc", "test_globals.h", - "unittest_utils.cc", - "unittest_utils.h", + "test_utils.cc", + "test_utils.h", ] deps = [ diff --git a/ppapi/shared_impl/unittest_utils.cc b/ppapi/shared_impl/test_utils.cc index af90432..6f85fce 100644 --- a/ppapi/shared_impl/unittest_utils.cc +++ b/ppapi/shared_impl/test_utils.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ppapi/shared_impl/unittest_utils.h" +#include "ppapi/shared_impl/test_utils.h" #include <cmath> @@ -209,4 +209,10 @@ bool TestEqual(const PP_Var& expected, 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 diff --git a/ppapi/shared_impl/unittest_utils.h b/ppapi/shared_impl/test_utils.h index a6fb296..876b934 100644 --- a/ppapi/shared_impl/unittest_utils.h +++ b/ppapi/shared_impl/test_utils.h @@ -2,8 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef PPAPI_SHARED_IMPL_UNITTEST_UTILS_H_ -#define PPAPI_SHARED_IMPL_UNITTEST_UTILS_H_ +#ifndef PPAPI_SHARED_IMPL_TEST_UTILS_H_ +#define PPAPI_SHARED_IMPL_TEST_UTILS_H_ + +#include <string> #include "ppapi/c/pp_var.h" @@ -19,6 +21,8 @@ bool TestEqual(const PP_Var& expected, const PP_Var& actual, bool test_string_references); +std::string StripTestPrefixes(const std::string& test_name); + } // namespace ppapi -#endif // PPAPI_SHARED_IMPL_UNITTEST_UTILS_H_ +#endif // PPAPI_SHARED_IMPL_TEST_UTILS_H_ diff --git a/ppapi/tests/test_case.cc b/ppapi/tests/test_case.cc index a257556..307dd38 100644 --- a/ppapi/tests/test_case.cc +++ b/ppapi/tests/test_case.cc @@ -18,11 +18,8 @@ namespace { std::string StripPrefix(const std::string& test_name) { - const char* const prefixes[] = { - "FAILS_", "FLAKY_", "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])); + if (test_name.find("DISABLED_") == 0) + return test_name.substr(strlen("DISABLED_")); return test_name; } |