OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |