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