| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef EXTENSIONS_TEST_EXTENSION_TEST_NOTIFICATION_OBSERVER_H_ | 5 #ifndef EXTENSIONS_TEST_EXTENSION_TEST_NOTIFICATION_OBSERVER_H_ |
| 6 #define EXTENSIONS_TEST_EXTENSION_TEST_NOTIFICATION_OBSERVER_H_ | 6 #define EXTENSIONS_TEST_EXTENSION_TEST_NOTIFICATION_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 void WaitForExtensionLoad(); | 39 void WaitForExtensionLoad(); |
| 40 | 40 |
| 41 // Waits for an extension load error. Returns true if the error really | 41 // Waits for an extension load error. Returns true if the error really |
| 42 // happened. | 42 // happened. |
| 43 bool WaitForExtensionLoadError(); | 43 bool WaitForExtensionLoadError(); |
| 44 | 44 |
| 45 // Wait for the specified extension to crash. Returns true if it really | 45 // Wait for the specified extension to crash. Returns true if it really |
| 46 // crashed. | 46 // crashed. |
| 47 bool WaitForExtensionCrash(const std::string& extension_id); | 47 bool WaitForExtensionCrash(const std::string& extension_id); |
| 48 | 48 |
| 49 // Wait for the crx installer to be done. Returns true if it has finished | 49 // Wait for the crx installer to be done. Returns true if it really is done. |
| 50 // successfully. | |
| 51 bool WaitForCrxInstallerDone(); | 50 bool WaitForCrxInstallerDone(); |
| 52 | 51 |
| 53 // Watch for the given event type from the given source. | 52 // Watch for the given event type from the given source. |
| 54 // After calling this method, call Wait() to ensure that RunMessageLoop() is | 53 // After calling this method, call Wait() to ensure that RunMessageLoop() is |
| 55 // called appropriately and cleanup is performed. | 54 // called appropriately and cleanup is performed. |
| 56 void Watch(int type, const content::NotificationSource& source); | 55 void Watch(int type, const content::NotificationSource& source); |
| 57 | 56 |
| 58 // After registering one or more event types with Watch(), call | 57 // After registering one or more event types with Watch(), call |
| 59 // this method to run the message loop and perform cleanup. | 58 // this method to run the message loop and perform cleanup. |
| 60 void Wait(); | 59 void Wait(); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 134 |
| 136 // The closure to quit the currently-running message loop. | 135 // The closure to quit the currently-running message loop. |
| 137 base::Closure quit_closure_; | 136 base::Closure quit_closure_; |
| 138 | 137 |
| 139 DISALLOW_COPY_AND_ASSIGN(ExtensionTestNotificationObserver); | 138 DISALLOW_COPY_AND_ASSIGN(ExtensionTestNotificationObserver); |
| 140 }; | 139 }; |
| 141 | 140 |
| 142 } // namespace extensions | 141 } // namespace extensions |
| 143 | 142 |
| 144 #endif // EXTENSIONS_TEST_EXTENSION_TEST_NOTIFICATION_OBSERVER_H_ | 143 #endif // EXTENSIONS_TEST_EXTENSION_TEST_NOTIFICATION_OBSERVER_H_ |
| OLD | NEW |