| 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 "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" | 5 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_tabstrip.h" | 9 #include "chrome/browser/ui/browser_tabstrip.h" |
| 10 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 // If a tab has never been shown then the associated tab view for the web | 93 // If a tab has never been shown then the associated tab view for the web |
| 94 // content will not be created. Verify that adding a constrained window to such | 94 // content will not be created. Verify that adding a constrained window to such |
| 95 // a tab works correctly. | 95 // a tab works correctly. |
| 96 IN_PROC_BROWSER_TEST_F(ConstrainedWindowMacTest, ShowInUninitializedTab) { | 96 IN_PROC_BROWSER_TEST_F(ConstrainedWindowMacTest, ShowInUninitializedTab) { |
| 97 std::unique_ptr<content::WebContents> web_contents( | 97 std::unique_ptr<content::WebContents> web_contents( |
| 98 content::WebContents::Create( | 98 content::WebContents::Create( |
| 99 content::WebContents::CreateParams(browser()->profile()))); | 99 content::WebContents::CreateParams(browser()->profile()))); |
| 100 bool was_blocked = false; | 100 bool was_blocked = false; |
| 101 chrome::AddWebContents(browser(), NULL, web_contents.release(), | 101 chrome::AddWebContents(browser(), NULL, web_contents.release(), |
| 102 NEW_BACKGROUND_TAB, gfx::Rect(), false, &was_blocked); | 102 WindowOpenDisposition::NEW_BACKGROUND_TAB, gfx::Rect(), |
| 103 false, &was_blocked); |
| 103 content::WebContents* tab2 = | 104 content::WebContents* tab2 = |
| 104 browser()->tab_strip_model()->GetWebContentsAt(2); | 105 browser()->tab_strip_model()->GetWebContentsAt(2); |
| 105 ASSERT_TRUE(tab2); | 106 ASSERT_TRUE(tab2); |
| 106 EXPECT_FALSE([tab2->GetNativeView() superview]); | 107 EXPECT_FALSE([tab2->GetNativeView() superview]); |
| 107 | 108 |
| 108 // Show dialog and verify that it's not visible yet. | 109 // Show dialog and verify that it's not visible yet. |
| 109 NiceMock<ConstrainedWindowDelegateMock> delegate; | 110 NiceMock<ConstrainedWindowDelegateMock> delegate; |
| 110 std::unique_ptr<ConstrainedWindowMac> dialog = | 111 std::unique_ptr<ConstrainedWindowMac> dialog = |
| 111 CreateAndShowWebModalDialogMac(&delegate, tab2, sheet_); | 112 CreateAndShowWebModalDialogMac(&delegate, tab2, sheet_); |
| 112 EXPECT_FALSE([sheet_window_ isVisible]); | 113 EXPECT_FALSE([sheet_window_ isVisible]); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 ->exclusive_access_manager() | 183 ->exclusive_access_manager() |
| 183 ->fullscreen_controller() | 184 ->fullscreen_controller() |
| 184 ->ToggleBrowserFullscreenMode(); | 185 ->ToggleBrowserFullscreenMode(); |
| 185 waiter->Wait(); | 186 waiter->Wait(); |
| 186 } | 187 } |
| 187 EXPECT_EQ(1.0, [sheet_window_ alphaValue]); | 188 EXPECT_EQ(1.0, [sheet_window_ alphaValue]); |
| 188 } | 189 } |
| 189 | 190 |
| 190 dialog->CloseWebContentsModalDialog(); | 191 dialog->CloseWebContentsModalDialog(); |
| 191 } | 192 } |
| OLD | NEW |