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

Side by Side Diff: chrome/browser/sync/test/integration/extensions_helper.cc

Issue 1172183002: Move StartsWith[ASCII] to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util3
Patch Set: merger Created 5 years, 6 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/sync/test/integration/extensions_helper.h" 5 #include "chrome/browser/sync/test/integration/extensions_helper.h"
6 6
7 #include <cstring> 7 #include <cstring>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 void InstallExtensionsPendingForSync(Profile* profile) { 118 void InstallExtensionsPendingForSync(Profile* profile) {
119 SyncExtensionHelper::GetInstance()->InstallExtensionsPendingForSync(profile); 119 SyncExtensionHelper::GetInstance()->InstallExtensionsPendingForSync(profile);
120 } 120 }
121 121
122 std::string CreateFakeExtensionName(int index) { 122 std::string CreateFakeExtensionName(int index) {
123 return extension_name_prefix + base::IntToString(index); 123 return extension_name_prefix + base::IntToString(index);
124 } 124 }
125 125
126 bool ExtensionNameToIndex(const std::string& name, int* index) { 126 bool ExtensionNameToIndex(const std::string& name, int* index) {
127 if (!StartsWithASCII(name, extension_name_prefix, true) || 127 if (!base::StartsWithASCII(name, extension_name_prefix, true) ||
128 !base::StringToInt(name.substr(strlen(extension_name_prefix)), index)) { 128 !base::StringToInt(name.substr(strlen(extension_name_prefix)), index)) {
129 LOG(WARNING) << "Unable to convert extension name \"" << name 129 LOG(WARNING) << "Unable to convert extension name \"" << name
130 << "\" to index"; 130 << "\" to index";
131 return false; 131 return false;
132 } 132 }
133 return true; 133 return true;
134 } 134 }
135 135
136 namespace { 136 namespace {
137 137
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 for (int i = 0; i < test()->num_clients(); ++i) { 264 for (int i = 0; i < test()->num_clients(); ++i) {
265 profiles.push_back(test()->GetProfile(i)); 265 profiles.push_back(test()->GetProfile(i));
266 } 266 }
267 267
268 ExtensionsMatchChecker checker(profiles); 268 ExtensionsMatchChecker checker(profiles);
269 checker.Wait(); 269 checker.Wait();
270 return !checker.TimedOut(); 270 return !checker.TimedOut();
271 } 271 }
272 272
273 } // namespace extensions_helper 273 } // namespace extensions_helper
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698