| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 #include "chrome/browser/extensions/browser_action_test_util.h" | 6 #include "chrome/browser/extensions/browser_action_test_util.h" |
| 7 #include "chrome/browser/extensions/extension_action.h" | 7 #include "chrome/browser/extensions/extension_action.h" |
| 8 #include "chrome/browser/extensions/extension_action_manager.h" | 8 #include "chrome/browser/extensions/extension_action_manager.h" |
| 9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 "open_popup_succeeds.html")) << message_; | 250 "open_popup_succeeds.html")) << message_; |
| 251 frame_observer.Wait(); | 251 frame_observer.Wait(); |
| 252 EXPECT_TRUE(BrowserActionTestUtil(browser()).HasPopup()); | 252 EXPECT_TRUE(BrowserActionTestUtil(browser()).HasPopup()); |
| 253 | 253 |
| 254 // Click on the omnibox to close the extension popup. | 254 // Click on the omnibox to close the extension popup. |
| 255 ui_test_utils::ClickOnView(browser(), VIEW_ID_OMNIBOX); | 255 ui_test_utils::ClickOnView(browser(), VIEW_ID_OMNIBOX); |
| 256 EXPECT_FALSE(BrowserActionTestUtil(browser()).HasPopup()); | 256 EXPECT_FALSE(BrowserActionTestUtil(browser()).HasPopup()); |
| 257 } | 257 } |
| 258 | 258 |
| 259 // Test that the extension popup is closed when the browser window is clicked. | 259 // Test that the extension popup is closed when the browser window is clicked. |
| 260 IN_PROC_BROWSER_TEST_F(BrowserActionInteractiveTest, BrowserClickClosesPopup2) { | 260 #if defined(OS_WIN) |
| 261 // Flaky on Windows: http://crbug.com/639130 |
| 262 #define MAYBE_BrowserClickClosesPopup2 DISABLED_BrowserClickClosesPopup2 |
| 263 #else |
| 264 #define MAYBE_BrowserClickClosesPopup2 BrowserClickClosesPopup2 |
| 265 #endif |
| 266 IN_PROC_BROWSER_TEST_F(BrowserActionInteractiveTest, |
| 267 MAYBE_BrowserClickClosesPopup2) { |
| 261 if (!ShouldRunPopupTest()) | 268 if (!ShouldRunPopupTest()) |
| 262 return; | 269 return; |
| 263 | 270 |
| 264 // Load a first extension that can open a popup. | 271 // Load a first extension that can open a popup. |
| 265 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII( | 272 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII( |
| 266 "browser_action/popup"))); | 273 "browser_action/popup"))); |
| 267 const Extension* extension = GetSingleLoadedExtension(); | 274 const Extension* extension = GetSingleLoadedExtension(); |
| 268 ASSERT_TRUE(extension) << message_; | 275 ASSERT_TRUE(extension) << message_; |
| 269 | 276 |
| 270 // Open an extension popup by clicking the browser action button. | 277 // Open an extension popup by clicking the browser action button. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 | 383 |
| 377 // Forcibly closing the browser HWND should not cause a crash. | 384 // Forcibly closing the browser HWND should not cause a crash. |
| 378 EXPECT_EQ(TRUE, ::CloseWindow(hwnd)); | 385 EXPECT_EQ(TRUE, ::CloseWindow(hwnd)); |
| 379 EXPECT_EQ(TRUE, ::DestroyWindow(hwnd)); | 386 EXPECT_EQ(TRUE, ::DestroyWindow(hwnd)); |
| 380 EXPECT_EQ(FALSE, ::IsWindow(hwnd)); | 387 EXPECT_EQ(FALSE, ::IsWindow(hwnd)); |
| 381 } | 388 } |
| 382 #endif // OS_WIN | 389 #endif // OS_WIN |
| 383 | 390 |
| 384 } // namespace | 391 } // namespace |
| 385 } // namespace extensions | 392 } // namespace extensions |
| OLD | NEW |