Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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 CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_TEST_NOTIFICATION_OBSERVER_H _ | |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_TEST_NOTIFICATION_OBSERVER_H _ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/callback.h" | |
|
Devlin
2016/10/06 15:52:16
needed? (this and others; please trim)
Rahul Chaturvedi
2016/10/11 20:12:35
Done.
| |
| 11 #include "base/compiler_specific.h" | |
| 12 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" | |
| 13 #include "content/public/browser/notification_details.h" | |
| 14 #include "content/public/browser/notification_observer.h" | |
| 15 #include "content/public/browser/notification_registrar.h" | |
| 16 #include "content/public/browser/notification_types.h" | |
| 17 #include "extensions/test/extension_test_notification_observer.h" | |
| 18 | |
| 19 class Browser; | |
| 20 | |
| 21 namespace content { | |
| 22 class BrowserContext; | |
| 23 class WindowedNotificationObserver; | |
| 24 } | |
| 25 | |
|
Devlin
2016/10/06 15:52:17
Can this file be in the extensions:: namespace?
Rahul Chaturvedi
2016/10/11 20:12:34
I am not sure why this wasn't in the first place,
Devlin
2016/10/11 22:53:45
Can you add a
// TODO(devlin): This should be in t
Rahul Chaturvedi
2016/10/12 20:25:53
Done.
| |
| 26 // Test helper class for observing extension-related events. | |
| 27 class ExtensionBrowserTestNotificationObserver | |
|
Devlin
2016/10/06 15:52:16
nit: The common idiom is to name chrome versions C
Rahul Chaturvedi
2016/10/11 20:12:35
Done.
| |
| 28 : public ExtensionTestNotificationObserver, | |
| 29 public extensions::ExtensionActionAPI::Observer { | |
| 30 public: | |
| 31 explicit ExtensionBrowserTestNotificationObserver(Browser*); | |
|
Devlin
2016/10/06 15:52:17
chrome style still requires variable naming in hea
Rahul Chaturvedi
2016/10/11 20:12:34
Done.
| |
| 32 ~ExtensionBrowserTestNotificationObserver() override; | |
| 33 | |
| 34 // Wait for the number of visible page actions to change to |count|. | |
|
Devlin
2016/10/06 15:52:16
Function descriptions should be descriptive, not i
Rahul Chaturvedi
2016/10/11 20:12:35
Done.
| |
| 35 bool WaitForPageActionVisibilityChangeTo(int count); | |
| 36 | |
| 37 // Waits until an extension is loaded and all view have loaded. | |
| 38 void WaitForExtensionAndViewLoad(); | |
| 39 | |
| 40 // Wait for all extension views to load. | |
| 41 bool WaitForExtensionViewsToLoad(); | |
| 42 | |
| 43 // Wait for extension to be idle. | |
| 44 bool WaitForExtensionIdle(const std::string& extension_id); | |
| 45 | |
| 46 // Wait for extension to be not idle. | |
| 47 bool WaitForExtensionNotIdle(const std::string& extension_id); | |
| 48 | |
| 49 private: | |
| 50 content::BrowserContext* GetBrowserContext(); | |
| 51 | |
| 52 // extensions::ExtensionActionAPI::Observer: | |
| 53 void OnPageActionsUpdated(content::WebContents* contents) override; | |
| 54 | |
| 55 Browser* browser_; | |
|
Devlin
2016/10/06 15:52:17
DISALLOW_COPY_AND_ASSIGN
Rahul Chaturvedi
2016/10/11 20:12:35
Done.
| |
| 56 }; | |
| 57 | |
| 58 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_TEST_NOTIFICATION_OBSERVE R_H_ | |
| OLD | NEW |