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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ppapi/shared_impl/test_utils.h" 5 #include "ppapi/shared_impl/test_utils.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <cmath> 10 #include <cmath>
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 } // namespace 206 } // namespace
207 207
208 bool TestEqual(const PP_Var& expected, 208 bool TestEqual(const PP_Var& expected,
209 const PP_Var& actual, 209 const PP_Var& actual,
210 bool test_string_references) { 210 bool test_string_references) {
211 base::hash_map<int64_t, int64_t> visited_map; 211 base::hash_map<int64_t, int64_t> visited_map;
212 return Equals(expected, actual, test_string_references, &visited_map); 212 return Equals(expected, actual, test_string_references, &visited_map);
213 } 213 }
214 214
215 std::string StripTestPrefixes(const std::string& test_name) { 215 std::string StripTestPrefixes(const std::string& test_name) {
216 if (test_name.find("DISABLED_") == 0) 216 const char kDisabledPrefix[] = "DISABLED_";
217 return test_name.substr(strlen("DISABLED_")); 217 if (base::StartsWith(test_name, kDisabledPrefix,
218 base::CompareCase::SENSITIVE)) {
219 return test_name.substr(sizeof(kDisabledPrefix) - 1);
220 }
218 return test_name; 221 return test_name;
219 } 222 }
220 223
221 } // namespace ppapi 224 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698