OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef EXTENSIONS_BROWSER_EXTENSION_TEST_REGISTRY_OBSERVER_H_ | |
6 #define EXTENSIONS_BROWSER_EXTENSION_TEST_REGISTRY_OBSERVER_H_ | |
7 | |
8 #include "base/scoped_observer.h" | |
9 #include "content/public/test/test_utils.h" | |
10 #include "extensions/browser/extension_registry_observer.h" | |
11 | |
12 namespace extensions { | |
13 class ExtensionRegistry; | |
14 | |
15 // A helper class that listen for ExtensionRegistry notifications. | |
16 class ExtensionTestRegistryObserver : public ExtensionRegistryObserver { | |
Yoyo Zhou
2014/06/17 02:29:54
nit: TestExtensionRegistryObserver?
limasdf
2014/06/17 17:20:55
Done.
| |
17 public: | |
18 explicit ExtensionTestRegistryObserver(ExtensionRegistry* registry); | |
19 virtual ~ExtensionTestRegistryObserver(); | |
20 | |
21 void WaitForAnyExtensionWillBeInstalled(); | |
Yoyo Zhou
2014/06/17 02:29:54
These should be documented.
What do you think of c
limasdf
2014/06/17 17:20:55
Done.
| |
22 void WaitForAnyExtensionUninstalled(); | |
23 | |
24 private: | |
25 class Waiter; | |
26 | |
27 // ExtensionRegistryObserver. | |
28 virtual void OnExtensionWillBeInstalled( | |
29 content::BrowserContext* browser_context, | |
30 const Extension* extension, | |
31 bool is_update, | |
32 bool from_ephemeral, | |
33 const std::string& old_name) OVERRIDE; | |
34 virtual void OnExtensionUninstalled(content::BrowserContext* browser_context, | |
35 const Extension* extension) OVERRIDE; | |
36 | |
37 scoped_ptr<Waiter> installed_waiter_; | |
Yoyo Zhou
2014/06/17 02:29:54
should be will_be_uninstalled_ for consistency.
limasdf
2014/06/17 17:20:56
Done.
| |
38 scoped_ptr<Waiter> uninstalled_waiter_; | |
39 | |
40 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | |
41 extension_registry_observer_; | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(ExtensionTestRegistryObserver); | |
44 }; | |
45 | |
46 } // namespace extensions | |
47 | |
48 #endif // EXTENSIONS_BROWSER_EXTENSION_TEST_REGISTRY_OBSERVER_H_ | |
OLD | NEW |