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

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

Issue 1220963005: Update base::StartsWith calls to new form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@starts_with
Patch Set: Created 5 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) 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 (!base::StartsWithASCII(name, extension_name_prefix, true) || 127 if (!base::StartsWith(name, extension_name_prefix,
128 base::CompareCase::SENSITIVE) ||
128 !base::StringToInt(name.substr(strlen(extension_name_prefix)), index)) { 129 !base::StringToInt(name.substr(strlen(extension_name_prefix)), index)) {
129 LOG(WARNING) << "Unable to convert extension name \"" << name 130 LOG(WARNING) << "Unable to convert extension name \"" << name
130 << "\" to index"; 131 << "\" to index";
131 return false; 132 return false;
132 } 133 }
133 return true; 134 return true;
134 } 135 }
135 136
136 namespace { 137 namespace {
137 138
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 for (int i = 0; i < test()->num_clients(); ++i) { 265 for (int i = 0; i < test()->num_clients(); ++i) {
265 profiles.push_back(test()->GetProfile(i)); 266 profiles.push_back(test()->GetProfile(i));
266 } 267 }
267 268
268 ExtensionsMatchChecker checker(profiles); 269 ExtensionsMatchChecker checker(profiles);
269 checker.Wait(); 270 checker.Wait();
270 return !checker.TimedOut(); 271 return !checker.TimedOut();
271 } 272 }
272 273
273 } // namespace extensions_helper 274 } // namespace extensions_helper
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698