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/memory/scoped_temp_dir.h" |
13 #include "chrome/test/in_process_browser_test.h" | 14 #include "chrome/test/in_process_browser_test.h" |
14 #include "content/common/notification_details.h" | 15 #include "content/common/notification_details.h" |
15 #include "content/common/notification_observer.h" | 16 #include "content/common/notification_observer.h" |
16 #include "content/common/notification_type.h" | 17 #include "content/common/notification_type.h" |
17 | 18 |
18 // Base class for extension browser tests. Provides utilities for loading, | 19 // Base class for extension browser tests. Provides utilities for loading, |
19 // unloading, and installing extensions. | 20 // unloading, and installing extensions. |
20 class ExtensionBrowserTest | 21 class ExtensionBrowserTest |
21 : public InProcessBrowserTest, public NotificationObserver { | 22 : public InProcessBrowserTest, public NotificationObserver { |
22 protected: | 23 protected: |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 116 |
116 bool loaded_; | 117 bool loaded_; |
117 bool installed_; | 118 bool installed_; |
118 | 119 |
119 // test_data/extensions. | 120 // test_data/extensions. |
120 FilePath test_data_dir_; | 121 FilePath test_data_dir_; |
121 std::string last_loaded_extension_id_; | 122 std::string last_loaded_extension_id_; |
122 int extension_installs_observed_; | 123 int extension_installs_observed_; |
123 | 124 |
124 private: | 125 private: |
| 126 // Temporary directory for testing. |
| 127 ScopedTempDir temp_dir_; |
| 128 |
125 // Specifies the type of UI (if any) to show during installation and what | 129 // Specifies the type of UI (if any) to show during installation and what |
126 // user action to simulate. | 130 // user action to simulate. |
127 enum InstallUIType { | 131 enum InstallUIType { |
128 INSTALL_UI_TYPE_NONE, | 132 INSTALL_UI_TYPE_NONE, |
129 INSTALL_UI_TYPE_CANCEL, | 133 INSTALL_UI_TYPE_CANCEL, |
130 INSTALL_UI_TYPE_NORMAL, | 134 INSTALL_UI_TYPE_NORMAL, |
131 INSTALL_UI_TYPE_AUTO_CONFIRM, | 135 INSTALL_UI_TYPE_AUTO_CONFIRM, |
132 }; | 136 }; |
133 | 137 |
134 bool InstallOrUpdateExtension(const std::string& id, const FilePath& path, | 138 bool InstallOrUpdateExtension(const std::string& id, const FilePath& path, |
(...skipping 11 matching lines...) Expand all Loading... |
146 // When waiting for page action count to change, we wait until it reaches this | 150 // When waiting for page action count to change, we wait until it reaches this |
147 // value. | 151 // value. |
148 int target_page_action_count_; | 152 int target_page_action_count_; |
149 | 153 |
150 // When waiting for visible page action count to change, we wait until it | 154 // When waiting for visible page action count to change, we wait until it |
151 // reaches this value. | 155 // reaches this value. |
152 int target_visible_page_action_count_; | 156 int target_visible_page_action_count_; |
153 }; | 157 }; |
154 | 158 |
155 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ | 159 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ |
OLD | NEW |