| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 | 64 |
| 65 std::string InstallExtension(Profile* profile, int index) { | 65 std::string InstallExtension(Profile* profile, int index) { |
| 66 return SyncExtensionHelper::GetInstance()->InstallExtension( | 66 return SyncExtensionHelper::GetInstance()->InstallExtension( |
| 67 profile, | 67 profile, |
| 68 CreateFakeExtensionName(index), | 68 CreateFakeExtensionName(index), |
| 69 extensions::Manifest::TYPE_EXTENSION); | 69 extensions::Manifest::TYPE_EXTENSION); |
| 70 } | 70 } |
| 71 | 71 |
| 72 std::string InstallExtensionForAllProfiles(int index) { | 72 std::string InstallExtensionForAllProfiles(int index) { |
| 73 for (int i = 0; i < test()->num_clients(); ++i) | 73 std::string extension_id; |
| 74 InstallExtension(test()->GetProfile(i), index); | 74 for (auto* profile : test()->GetAllProfiles()) { |
| 75 return InstallExtension(test()->verifier(), index); | 75 extension_id = InstallExtension(profile, index); |
| 76 } |
| 77 return extension_id; |
| 76 } | 78 } |
| 77 | 79 |
| 78 void UninstallExtension(Profile* profile, int index) { | 80 void UninstallExtension(Profile* profile, int index) { |
| 79 return SyncExtensionHelper::GetInstance()->UninstallExtension( | 81 return SyncExtensionHelper::GetInstance()->UninstallExtension( |
| 80 profile, CreateFakeExtensionName(index)); | 82 profile, CreateFakeExtensionName(index)); |
| 81 } | 83 } |
| 82 | 84 |
| 83 std::vector<int> GetInstalledExtensions(Profile* profile) { | 85 std::vector<int> GetInstalledExtensions(Profile* profile) { |
| 84 std::vector<int> indices; | 86 std::vector<int> indices; |
| 85 std::vector<std::string> names = | 87 std::vector<std::string> names = |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 for (int i = 0; i < test()->num_clients(); ++i) { | 281 for (int i = 0; i < test()->num_clients(); ++i) { |
| 280 profiles.push_back(test()->GetProfile(i)); | 282 profiles.push_back(test()->GetProfile(i)); |
| 281 } | 283 } |
| 282 | 284 |
| 283 ExtensionsMatchChecker checker(profiles); | 285 ExtensionsMatchChecker checker(profiles); |
| 284 checker.Wait(); | 286 checker.Wait(); |
| 285 return !checker.TimedOut(); | 287 return !checker.TimedOut(); |
| 286 } | 288 } |
| 287 | 289 |
| 288 } // namespace extensions_helper | 290 } // namespace extensions_helper |
| OLD | NEW |