| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 137 |
| 138 // A helper class to implement waiting for a set of profiles to have matching | 138 // A helper class to implement waiting for a set of profiles to have matching |
| 139 // extensions lists. | 139 // extensions lists. |
| 140 class ExtensionsMatchChecker : public StatusChangeChecker, | 140 class ExtensionsMatchChecker : public StatusChangeChecker, |
| 141 public extensions::ExtensionRegistryObserver { | 141 public extensions::ExtensionRegistryObserver { |
| 142 public: | 142 public: |
| 143 explicit ExtensionsMatchChecker(const std::vector<Profile*>& profiles); | 143 explicit ExtensionsMatchChecker(const std::vector<Profile*>& profiles); |
| 144 virtual ~ExtensionsMatchChecker(); | 144 virtual ~ExtensionsMatchChecker(); |
| 145 | 145 |
| 146 // StatusChangeChecker implementation. | 146 // StatusChangeChecker implementation. |
| 147 virtual std::string GetDebugMessage() const OVERRIDE; | 147 virtual std::string GetDebugMessage() const override; |
| 148 virtual bool IsExitConditionSatisfied() OVERRIDE; | 148 virtual bool IsExitConditionSatisfied() override; |
| 149 | 149 |
| 150 // extensions::ExtensionRegistryObserver implementation. | 150 // extensions::ExtensionRegistryObserver implementation. |
| 151 virtual void OnExtensionLoaded( | 151 virtual void OnExtensionLoaded( |
| 152 content::BrowserContext* context, | 152 content::BrowserContext* context, |
| 153 const extensions::Extension* extension) OVERRIDE; | 153 const extensions::Extension* extension) override; |
| 154 virtual void OnExtensionUnloaded( | 154 virtual void OnExtensionUnloaded( |
| 155 content::BrowserContext* context, | 155 content::BrowserContext* context, |
| 156 const extensions::Extension* extenion, | 156 const extensions::Extension* extenion, |
| 157 extensions::UnloadedExtensionInfo::Reason reason) OVERRIDE; | 157 extensions::UnloadedExtensionInfo::Reason reason) override; |
| 158 virtual void OnExtensionInstalled( | 158 virtual void OnExtensionInstalled( |
| 159 content::BrowserContext* browser_context, | 159 content::BrowserContext* browser_context, |
| 160 const extensions::Extension* extension, | 160 const extensions::Extension* extension, |
| 161 bool is_update) OVERRIDE; | 161 bool is_update) override; |
| 162 virtual void OnExtensionUninstalled( | 162 virtual void OnExtensionUninstalled( |
| 163 content::BrowserContext* browser_context, | 163 content::BrowserContext* browser_context, |
| 164 const extensions::Extension* extension, | 164 const extensions::Extension* extension, |
| 165 extensions::UninstallReason reason) OVERRIDE; | 165 extensions::UninstallReason reason) override; |
| 166 | 166 |
| 167 void Wait(); | 167 void Wait(); |
| 168 | 168 |
| 169 private: | 169 private: |
| 170 std::vector<Profile*> profiles_; | 170 std::vector<Profile*> profiles_; |
| 171 ScopedVector<SyncedExtensionInstaller> synced_extension_installers_; | 171 ScopedVector<SyncedExtensionInstaller> synced_extension_installers_; |
| 172 bool observing_; | 172 bool observing_; |
| 173 | 173 |
| 174 DISALLOW_COPY_AND_ASSIGN(ExtensionsMatchChecker); | 174 DISALLOW_COPY_AND_ASSIGN(ExtensionsMatchChecker); |
| 175 }; | 175 }; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 for (int i = 0; i < test()->num_clients(); ++i) { | 267 for (int i = 0; i < test()->num_clients(); ++i) { |
| 268 profiles.push_back(test()->GetProfile(i)); | 268 profiles.push_back(test()->GetProfile(i)); |
| 269 } | 269 } |
| 270 | 270 |
| 271 ExtensionsMatchChecker checker(profiles); | 271 ExtensionsMatchChecker checker(profiles); |
| 272 checker.Wait(); | 272 checker.Wait(); |
| 273 return !checker.TimedOut(); | 273 return !checker.TimedOut(); |
| 274 } | 274 } |
| 275 | 275 |
| 276 } // namespace extensions_helper | 276 } // namespace extensions_helper |
| OLD | NEW |