| 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 #import "chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h" | 5 #import "chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/browser_tabstrip.h" | 7 #include "chrome/browser/ui/browser_tabstrip.h" |
| 8 #include "chrome/browser/ui/constrained_window_tab_helper.h" | 8 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" |
| 9 #include "chrome/test/base/in_process_browser_test.h" | 9 #include "chrome/test/base/in_process_browser_test.h" |
| 10 #include "content/public/test/test_utils.h" | 10 #include "content/public/test/test_utils.h" |
| 11 | 11 |
| 12 typedef InProcessBrowserTest CollectedCookiesMacTest; | 12 typedef InProcessBrowserTest CollectedCookiesMacTest; |
| 13 | 13 |
| 14 IN_PROC_BROWSER_TEST_F(CollectedCookiesMacTest, Close) { | 14 IN_PROC_BROWSER_TEST_F(CollectedCookiesMacTest, Close) { |
| 15 content::WebContents* web_contents = chrome::GetActiveWebContents(browser()); | 15 content::WebContents* web_contents = chrome::GetActiveWebContents(browser()); |
| 16 ConstrainedWindowTabHelper* constrained_window_tab_helper = | 16 WebContentsModalDialogManager* web_contents_modal_dialog_manager = |
| 17 ConstrainedWindowTabHelper::FromWebContents(web_contents); | 17 WebContentsModalDialogManager::FromWebContents(web_contents); |
| 18 EXPECT_EQ(0u, constrained_window_tab_helper->constrained_window_count()); | 18 EXPECT_EQ(0u, web_contents_modal_dialog_manager->dialog_count()); |
| 19 | 19 |
| 20 // Deletes itself. | 20 // Deletes itself. |
| 21 CollectedCookiesMac* dialog = | 21 CollectedCookiesMac* dialog = |
| 22 new CollectedCookiesMac(chrome::GetActiveWebContents(browser())); | 22 new CollectedCookiesMac(chrome::GetActiveWebContents(browser())); |
| 23 EXPECT_EQ(1u, constrained_window_tab_helper->constrained_window_count()); | 23 EXPECT_EQ(1u, web_contents_modal_dialog_manager->dialog_count()); |
| 24 | 24 |
| 25 dialog->PerformClose(); | 25 dialog->PerformClose(); |
| 26 content::RunAllPendingInMessageLoop(); | 26 content::RunAllPendingInMessageLoop(); |
| 27 EXPECT_EQ(0u, constrained_window_tab_helper->constrained_window_count()); | 27 EXPECT_EQ(0u, web_contents_modal_dialog_manager->dialog_count()); |
| 28 } | 28 } |
| 29 | 29 |
| 30 IN_PROC_BROWSER_TEST_F(CollectedCookiesMacTest, Outlets) { | 30 IN_PROC_BROWSER_TEST_F(CollectedCookiesMacTest, Outlets) { |
| 31 // Deletes itself. | 31 // Deletes itself. |
| 32 CollectedCookiesMac* dialog = | 32 CollectedCookiesMac* dialog = |
| 33 new CollectedCookiesMac(chrome::GetActiveWebContents(browser())); | 33 new CollectedCookiesMac(chrome::GetActiveWebContents(browser())); |
| 34 CollectedCookiesWindowController* sheet_controller = | 34 CollectedCookiesWindowController* sheet_controller = |
| 35 dialog->sheet_controller(); | 35 dialog->sheet_controller(); |
| 36 | 36 |
| 37 EXPECT_TRUE([sheet_controller allowedTreeController]); | 37 EXPECT_TRUE([sheet_controller allowedTreeController]); |
| 38 EXPECT_TRUE([sheet_controller blockedTreeController]); | 38 EXPECT_TRUE([sheet_controller blockedTreeController]); |
| 39 EXPECT_TRUE([sheet_controller allowedOutlineView]); | 39 EXPECT_TRUE([sheet_controller allowedOutlineView]); |
| 40 EXPECT_TRUE([sheet_controller blockedOutlineView]); | 40 EXPECT_TRUE([sheet_controller blockedOutlineView]); |
| 41 EXPECT_TRUE([sheet_controller infoBar]); | 41 EXPECT_TRUE([sheet_controller infoBar]); |
| 42 EXPECT_TRUE([sheet_controller infoBarIcon]); | 42 EXPECT_TRUE([sheet_controller infoBarIcon]); |
| 43 EXPECT_TRUE([sheet_controller infoBarText]); | 43 EXPECT_TRUE([sheet_controller infoBarText]); |
| 44 EXPECT_TRUE([sheet_controller tabView]); | 44 EXPECT_TRUE([sheet_controller tabView]); |
| 45 EXPECT_TRUE([sheet_controller blockedScrollView]); | 45 EXPECT_TRUE([sheet_controller blockedScrollView]); |
| 46 EXPECT_TRUE([sheet_controller blockedCookiesText]); | 46 EXPECT_TRUE([sheet_controller blockedCookiesText]); |
| 47 EXPECT_TRUE([sheet_controller cookieDetailsViewPlaceholder]); | 47 EXPECT_TRUE([sheet_controller cookieDetailsViewPlaceholder]); |
| 48 | 48 |
| 49 [sheet_controller closeSheet:nil]; | 49 [sheet_controller closeSheet:nil]; |
| 50 content::RunAllPendingInMessageLoop(); | 50 content::RunAllPendingInMessageLoop(); |
| 51 } | 51 } |
| OLD | NEW |