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

Unified Diff: ppapi/shared_impl/test_utils.cc

Issue 2121513002: Replace string::find(prefix) == 0 pattern with base::StartsWith(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typos Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/shared_impl/test_utils.cc
diff --git a/ppapi/shared_impl/test_utils.cc b/ppapi/shared_impl/test_utils.cc
index 2ab8c5a27dccc43f8ee59cd1a14bd2b2d332f038..18bc9e3af325c6eed9e2e42ca4972842a5fb04ad 100644
--- a/ppapi/shared_impl/test_utils.cc
+++ b/ppapi/shared_impl/test_utils.cc
@@ -213,8 +213,11 @@ bool TestEqual(const PP_Var& expected,
}
std::string StripTestPrefixes(const std::string& test_name) {
- if (test_name.find("DISABLED_") == 0)
- return test_name.substr(strlen("DISABLED_"));
+ const char kDisabledPrefix[] = "DISABLED_";
+ if (base::StartsWith(test_name, kDisabledPrefix,
+ base::CompareCase::SENSITIVE)) {
+ return test_name.substr(sizeof(kDisabledPrefix) - 1);
+ }
return test_name;
}

Powered by Google App Engine
This is Rietveld 408576698