OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/memory/scoped_vector.h" | 6 #include "base/memory/scoped_vector.h" |
7 #include "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
9 #include "chrome/browser/extensions/extension_test_message_listener.h" | 9 #include "chrome/browser/extensions/extension_test_message_listener.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 test_strings.push_back("content_tab"); | 219 test_strings.push_back("content_tab"); |
220 test_strings.push_back("content_panel"); | 220 test_strings.push_back("content_panel"); |
221 test_strings.push_back("content_popup"); | 221 test_strings.push_back("content_popup"); |
222 | 222 |
223 ScopedVector<ExtensionTestMessageListener> listeners; | 223 ScopedVector<ExtensionTestMessageListener> listeners; |
224 for (size_t i = 0; i < test_strings.size(); ++i) { | 224 for (size_t i = 0; i < test_strings.size(); ++i) { |
225 listeners.push_back( | 225 listeners.push_back( |
226 new ExtensionTestMessageListener(test_strings[i], false)); | 226 new ExtensionTestMessageListener(test_strings[i], false)); |
227 } | 227 } |
228 | 228 |
229 const Extension* extension = LoadExtension( | 229 const extensions::Extension* extension = LoadExtension( |
230 test_data_dir_.AppendASCII("window_open").AppendASCII( | 230 test_data_dir_.AppendASCII("window_open").AppendASCII( |
231 "close_panels_on_uninstall")); | 231 "close_panels_on_uninstall")); |
232 ASSERT_TRUE(extension); | 232 ASSERT_TRUE(extension); |
233 | 233 |
234 // Two tabs. One in extension domain and one in non-extension domain. | 234 // Two tabs. One in extension domain and one in non-extension domain. |
235 // Two popups - one in extension domain and one in non-extension domain. | 235 // Two popups - one in extension domain and one in non-extension domain. |
236 // Two panels - one in extension domain and one in non-extension domain. | 236 // Two panels - one in extension domain and one in non-extension domain. |
237 WaitForTabsAndPopups(browser(), 2, 2, 2); | 237 WaitForTabsAndPopups(browser(), 2, 2, 2); |
238 | 238 |
239 // Wait on test messages to make sure the pages loaded. | 239 // Wait on test messages to make sure the pages loaded. |
240 for (size_t i = 0; i < listeners.size(); ++i) | 240 for (size_t i = 0; i < listeners.size(); ++i) |
241 ASSERT_TRUE(listeners[i]->WaitUntilSatisfied()); | 241 ASSERT_TRUE(listeners[i]->WaitUntilSatisfied()); |
242 | 242 |
243 UninstallExtension(extension->id()); | 243 UninstallExtension(extension->id()); |
244 | 244 |
245 // Wait for one tab and one popup in non-extension domain to stay open. | 245 // Wait for one tab and one popup in non-extension domain to stay open. |
246 // Expect everything else, including panels, to close. | 246 // Expect everything else, including panels, to close. |
247 WaitForTabsAndPopups(browser(), 1, 1, 0); | 247 WaitForTabsAndPopups(browser(), 1, 1, 0); |
248 } | 248 } |
249 | 249 |
250 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_WindowOpener) { | 250 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_WindowOpener) { |
251 ASSERT_TRUE(RunExtensionTest("window_open/opener")) << message_; | 251 ASSERT_TRUE(RunExtensionTest("window_open/opener")) << message_; |
252 } | 252 } |
OLD | NEW |