OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/extensions/browser_action_test_util.h" | 5 #include "chrome/browser/extensions/browser_action_test_util.h" |
6 #include "chrome/browser/extensions/extension_action.h" | 6 #include "chrome/browser/extensions/extension_action.h" |
7 #include "chrome/browser/extensions/extension_action_manager.h" | 7 #include "chrome/browser/extensions/extension_action_manager.h" |
8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/extension_toolbar_model.h" | 10 #include "chrome/browser/extensions/extension_toolbar_model.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 } | 73 } |
74 }; | 74 }; |
75 | 75 |
76 // Tests opening a popup using the chrome.browserAction.openPopup API. This test | 76 // Tests opening a popup using the chrome.browserAction.openPopup API. This test |
77 // opens a popup in the starting window, closes the popup, creates a new window | 77 // opens a popup in the starting window, closes the popup, creates a new window |
78 // and opens a popup in the new window. Both popups should succeed in opening. | 78 // and opens a popup in the new window. Both popups should succeed in opening. |
79 IN_PROC_BROWSER_TEST_F(BrowserActionInteractiveTest, TestOpenPopup) { | 79 IN_PROC_BROWSER_TEST_F(BrowserActionInteractiveTest, TestOpenPopup) { |
80 if (!ShouldRunPopupTest()) | 80 if (!ShouldRunPopupTest()) |
81 return; | 81 return; |
82 | 82 |
83 BrowserActionTestUtil browserActionBar = BrowserActionTestUtil(browser()); | 83 BrowserActionTestUtil browserActionBar(browser()); |
84 // Setup extension message listener to wait for javascript to finish running. | 84 // Setup extension message listener to wait for javascript to finish running. |
85 ExtensionTestMessageListener listener("ready", true); | 85 ExtensionTestMessageListener listener("ready", true); |
86 { | 86 { |
87 OpenExtensionPopupViaAPI(); | 87 OpenExtensionPopupViaAPI(); |
88 EXPECT_TRUE(browserActionBar.HasPopup()); | 88 EXPECT_TRUE(browserActionBar.HasPopup()); |
89 browserActionBar.HidePopup(); | 89 browserActionBar.HidePopup(); |
90 } | 90 } |
91 | 91 |
92 EXPECT_TRUE(listener.WaitUntilSatisfied()); | 92 EXPECT_TRUE(listener.WaitUntilSatisfied()); |
93 Browser* new_browser = NULL; | 93 Browser* new_browser = NULL; |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 | 361 |
362 // Forcibly closing the browser HWND should not cause a crash. | 362 // Forcibly closing the browser HWND should not cause a crash. |
363 EXPECT_EQ(TRUE, ::CloseWindow(hwnd)); | 363 EXPECT_EQ(TRUE, ::CloseWindow(hwnd)); |
364 EXPECT_EQ(TRUE, ::DestroyWindow(hwnd)); | 364 EXPECT_EQ(TRUE, ::DestroyWindow(hwnd)); |
365 EXPECT_EQ(FALSE, ::IsWindow(hwnd)); | 365 EXPECT_EQ(FALSE, ::IsWindow(hwnd)); |
366 } | 366 } |
367 #endif // OS_WIN | 367 #endif // OS_WIN |
368 | 368 |
369 } // namespace | 369 } // namespace |
370 } // namespace extensions | 370 } // namespace extensions |
OLD | NEW |