| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
| 13 #include "base/scoped_temp_dir.h" | 13 #include "base/scoped_temp_dir.h" |
| 14 #include "chrome/test/in_process_browser_test.h" | 14 #include "chrome/test/in_process_browser_test.h" |
| 15 #include "content/common/content_notification_types.h" |
| 15 #include "content/common/notification_details.h" | 16 #include "content/common/notification_details.h" |
| 16 #include "content/common/notification_observer.h" | 17 #include "content/common/notification_observer.h" |
| 17 #include "content/common/notification_type.h" | |
| 18 | 18 |
| 19 class Extension; | 19 class Extension; |
| 20 | 20 |
| 21 // Base class for extension browser tests. Provides utilities for loading, | 21 // Base class for extension browser tests. Provides utilities for loading, |
| 22 // unloading, and installing extensions. | 22 // unloading, and installing extensions. |
| 23 class ExtensionBrowserTest | 23 class ExtensionBrowserTest |
| 24 : public InProcessBrowserTest, public NotificationObserver { | 24 : public InProcessBrowserTest, public NotificationObserver { |
| 25 protected: | 25 protected: |
| 26 ExtensionBrowserTest(); | 26 ExtensionBrowserTest(); |
| 27 | 27 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 bool WaitForExtensionInstallError(); | 105 bool WaitForExtensionInstallError(); |
| 106 | 106 |
| 107 // Waits until an extension is loaded. | 107 // Waits until an extension is loaded. |
| 108 void WaitForExtensionLoad(); | 108 void WaitForExtensionLoad(); |
| 109 | 109 |
| 110 // Wait for the specified extension to crash. Returns true if it really | 110 // Wait for the specified extension to crash. Returns true if it really |
| 111 // crashed. | 111 // crashed. |
| 112 bool WaitForExtensionCrash(const std::string& extension_id); | 112 bool WaitForExtensionCrash(const std::string& extension_id); |
| 113 | 113 |
| 114 // NotificationObserver | 114 // NotificationObserver |
| 115 virtual void Observe(NotificationType type, | 115 virtual void Observe(int type, |
| 116 const NotificationSource& source, | 116 const NotificationSource& source, |
| 117 const NotificationDetails& details); | 117 const NotificationDetails& details); |
| 118 | 118 |
| 119 bool loaded_; | 119 bool loaded_; |
| 120 bool installed_; | 120 bool installed_; |
| 121 | 121 |
| 122 // test_data/extensions. | 122 // test_data/extensions. |
| 123 FilePath test_data_dir_; | 123 FilePath test_data_dir_; |
| 124 std::string last_loaded_extension_id_; | 124 std::string last_loaded_extension_id_; |
| 125 int extension_installs_observed_; | 125 int extension_installs_observed_; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 153 // When waiting for page action count to change, we wait until it reaches this | 153 // When waiting for page action count to change, we wait until it reaches this |
| 154 // value. | 154 // value. |
| 155 int target_page_action_count_; | 155 int target_page_action_count_; |
| 156 | 156 |
| 157 // When waiting for visible page action count to change, we wait until it | 157 // When waiting for visible page action count to change, we wait until it |
| 158 // reaches this value. | 158 // reaches this value. |
| 159 int target_visible_page_action_count_; | 159 int target_visible_page_action_count_; |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ | 162 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ |
| OLD | NEW |