| 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 std::string extension_id; | 73 for (int i = 0; i < test()->num_clients(); ++i) |
| 74 for (auto* profile : test()->GetAllProfiles()) { | 74 InstallExtension(test()->GetProfile(i), index); |
| 75 extension_id = InstallExtension(profile, index); | 75 return InstallExtension(test()->verifier(), index); |
| 76 } | |
| 77 return extension_id; | |
| 78 } | 76 } |
| 79 | 77 |
| 80 void UninstallExtension(Profile* profile, int index) { | 78 void UninstallExtension(Profile* profile, int index) { |
| 81 return SyncExtensionHelper::GetInstance()->UninstallExtension( | 79 return SyncExtensionHelper::GetInstance()->UninstallExtension( |
| 82 profile, CreateFakeExtensionName(index)); | 80 profile, CreateFakeExtensionName(index)); |
| 83 } | 81 } |
| 84 | 82 |
| 85 std::vector<int> GetInstalledExtensions(Profile* profile) { | 83 std::vector<int> GetInstalledExtensions(Profile* profile) { |
| 86 std::vector<int> indices; | 84 std::vector<int> indices; |
| 87 std::vector<std::string> names = | 85 std::vector<std::string> names = |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 for (int i = 0; i < test()->num_clients(); ++i) { | 279 for (int i = 0; i < test()->num_clients(); ++i) { |
| 282 profiles.push_back(test()->GetProfile(i)); | 280 profiles.push_back(test()->GetProfile(i)); |
| 283 } | 281 } |
| 284 | 282 |
| 285 ExtensionsMatchChecker checker(profiles); | 283 ExtensionsMatchChecker checker(profiles); |
| 286 checker.Wait(); | 284 checker.Wait(); |
| 287 return !checker.TimedOut(); | 285 return !checker.TimedOut(); |
| 288 } | 286 } |
| 289 | 287 |
| 290 } // namespace extensions_helper | 288 } // namespace extensions_helper |
| OLD | NEW |