| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 browserActionBar.HidePopup(); | 90 browserActionBar.HidePopup(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 EXPECT_TRUE(listener.WaitUntilSatisfied()); | 93 EXPECT_TRUE(listener.WaitUntilSatisfied()); |
| 94 Browser* new_browser = NULL; | 94 Browser* new_browser = NULL; |
| 95 { | 95 { |
| 96 content::WindowedNotificationObserver frame_observer( | 96 content::WindowedNotificationObserver frame_observer( |
| 97 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, | 97 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, |
| 98 content::NotificationService::AllSources()); | 98 content::NotificationService::AllSources()); |
| 99 // Open a new window. | 99 // Open a new window. |
| 100 new_browser = chrome::FindBrowserWithWebContents( | 100 new_browser = chrome::FindBrowserWithWebContents(browser()->OpenURL( |
| 101 browser()->OpenURL(content::OpenURLParams( | 101 content::OpenURLParams(GURL("about:"), content::Referrer(), |
| 102 GURL("about:"), content::Referrer(), NEW_WINDOW, | 102 WindowOpenDisposition::NEW_WINDOW, |
| 103 ui::PAGE_TRANSITION_TYPED, false))); | 103 ui::PAGE_TRANSITION_TYPED, false))); |
| 104 // Hide all the buttons to test that it opens even when the browser action | 104 // Hide all the buttons to test that it opens even when the browser action |
| 105 // is in the overflow bucket. | 105 // is in the overflow bucket. |
| 106 ToolbarActionsModel::Get(profile())->SetVisibleIconCount(0); | 106 ToolbarActionsModel::Get(profile())->SetVisibleIconCount(0); |
| 107 frame_observer.Wait(); | 107 frame_observer.Wait(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 EXPECT_TRUE(new_browser != NULL); | 110 EXPECT_TRUE(new_browser != NULL); |
| 111 | 111 |
| 112 // Flaky on non-aura linux http://crbug.com/309749 | 112 // Flaky on non-aura linux http://crbug.com/309749 |
| 113 #if !(defined(OS_LINUX) && !defined(USE_AURA)) | 113 #if !(defined(OS_LINUX) && !defined(USE_AURA)) |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 BrowserActionTestUtil test_util(browser()); | 371 BrowserActionTestUtil test_util(browser()); |
| 372 const gfx::NativeView view = test_util.GetPopupNativeView(); | 372 const gfx::NativeView view = test_util.GetPopupNativeView(); |
| 373 EXPECT_NE(static_cast<gfx::NativeView>(NULL), view); | 373 EXPECT_NE(static_cast<gfx::NativeView>(NULL), view); |
| 374 const HWND hwnd = views::HWNDForNativeView(view); | 374 const HWND hwnd = views::HWNDForNativeView(view); |
| 375 EXPECT_EQ(hwnd, | 375 EXPECT_EQ(hwnd, |
| 376 views::HWNDForNativeView(browser()->window()->GetNativeWindow())); | 376 views::HWNDForNativeView(browser()->window()->GetNativeWindow())); |
| 377 EXPECT_EQ(TRUE, ::IsWindow(hwnd)); | 377 EXPECT_EQ(TRUE, ::IsWindow(hwnd)); |
| 378 | 378 |
| 379 // Create a new browser window to prevent the message loop from terminating. | 379 // Create a new browser window to prevent the message loop from terminating. |
| 380 browser()->OpenURL(content::OpenURLParams(GURL("about:"), content::Referrer(), | 380 browser()->OpenURL(content::OpenURLParams(GURL("about:"), content::Referrer(), |
| 381 NEW_WINDOW, | 381 WindowOpenDisposition::NEW_WINDOW, |
| 382 ui::PAGE_TRANSITION_TYPED, false)); | 382 ui::PAGE_TRANSITION_TYPED, false)); |
| 383 | 383 |
| 384 // Forcibly closing the browser HWND should not cause a crash. | 384 // Forcibly closing the browser HWND should not cause a crash. |
| 385 EXPECT_EQ(TRUE, ::CloseWindow(hwnd)); | 385 EXPECT_EQ(TRUE, ::CloseWindow(hwnd)); |
| 386 EXPECT_EQ(TRUE, ::DestroyWindow(hwnd)); | 386 EXPECT_EQ(TRUE, ::DestroyWindow(hwnd)); |
| 387 EXPECT_EQ(FALSE, ::IsWindow(hwnd)); | 387 EXPECT_EQ(FALSE, ::IsWindow(hwnd)); |
| 388 } | 388 } |
| 389 #endif // OS_WIN | 389 #endif // OS_WIN |
| 390 | 390 |
| 391 } // namespace | 391 } // namespace |
| 392 } // namespace extensions | 392 } // namespace extensions |
| OLD | NEW |