| 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 std::vector<Profile*> profiles = test()->GetAllProfiles(); |
| 75 return InstallExtension(test()->verifier(), index); | 75 for (std::vector<Profile*>::iterator it = profiles.begin(); |
| 76 it != profiles.end(); |
| 77 ++it) { |
| 78 extension_id = InstallExtension(*it, index); |
| 79 } |
| 80 return extension_id; |
| 76 } | 81 } |
| 77 | 82 |
| 78 void UninstallExtension(Profile* profile, int index) { | 83 void UninstallExtension(Profile* profile, int index) { |
| 79 return SyncExtensionHelper::GetInstance()->UninstallExtension( | 84 return SyncExtensionHelper::GetInstance()->UninstallExtension( |
| 80 profile, CreateFakeExtensionName(index)); | 85 profile, CreateFakeExtensionName(index)); |
| 81 } | 86 } |
| 82 | 87 |
| 83 std::vector<int> GetInstalledExtensions(Profile* profile) { | 88 std::vector<int> GetInstalledExtensions(Profile* profile) { |
| 84 std::vector<int> indices; | 89 std::vector<int> indices; |
| 85 std::vector<std::string> names = | 90 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) { | 284 for (int i = 0; i < test()->num_clients(); ++i) { |
| 280 profiles.push_back(test()->GetProfile(i)); | 285 profiles.push_back(test()->GetProfile(i)); |
| 281 } | 286 } |
| 282 | 287 |
| 283 ExtensionsMatchChecker checker(profiles); | 288 ExtensionsMatchChecker checker(profiles); |
| 284 checker.Wait(); | 289 checker.Wait(); |
| 285 return !checker.TimedOut(); | 290 return !checker.TimedOut(); |
| 286 } | 291 } |
| 287 | 292 |
| 288 } // namespace extensions_helper | 293 } // namespace extensions_helper |
| OLD | NEW |