Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(425)

Side by Side Diff: chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa_browsertest.mm

Issue 23815006: [Cleanup] rename WebContentsModalDialogManager::IsShowingDialog() to IsDialogActive() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/ssl_client_certificate_selector_cocoa.h" 5 #import "chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.h"
6 6
7 #import <SecurityInterface/SFChooseIdentityPanel.h> 7 #import <SecurityInterface/SFChooseIdentityPanel.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #import "base/mac/mac_util.h" 10 #import "base/mac/mac_util.h"
(...skipping 26 matching lines...) Expand all
37 37
38 IN_PROC_BROWSER_TEST_F(SSLClientCertificateSelectorCocoaTest, Basic) { 38 IN_PROC_BROWSER_TEST_F(SSLClientCertificateSelectorCocoaTest, Basic) {
39 // TODO(kbr): re-enable: http://crbug.com/222296 39 // TODO(kbr): re-enable: http://crbug.com/222296
40 if (base::mac::IsOSMountainLionOrLater()) 40 if (base::mac::IsOSMountainLionOrLater())
41 return; 41 return;
42 42
43 content::WebContents* web_contents = 43 content::WebContents* web_contents =
44 browser()->tab_strip_model()->GetActiveWebContents(); 44 browser()->tab_strip_model()->GetActiveWebContents();
45 WebContentsModalDialogManager* web_contents_modal_dialog_manager = 45 WebContentsModalDialogManager* web_contents_modal_dialog_manager =
46 WebContentsModalDialogManager::FromWebContents(web_contents); 46 WebContentsModalDialogManager::FromWebContents(web_contents);
47 EXPECT_FALSE(web_contents_modal_dialog_manager->IsShowingDialog()); 47 EXPECT_FALSE(web_contents_modal_dialog_manager->IsDialogActive());
48 48
49 net::X509Certificate* cert = NULL; 49 net::X509Certificate* cert = NULL;
50 int count = 0; 50 int count = 0;
51 SSLClientCertificateSelectorCocoa* selector = 51 SSLClientCertificateSelectorCocoa* selector =
52 [[SSLClientCertificateSelectorCocoa alloc] 52 [[SSLClientCertificateSelectorCocoa alloc]
53 initWithNetworkSession:auth_requestor_->http_network_session_ 53 initWithNetworkSession:auth_requestor_->http_network_session_
54 certRequestInfo:auth_requestor_->cert_request_info_ 54 certRequestInfo:auth_requestor_->cert_request_info_
55 callback:base::Bind(&OnCertificateSelected, 55 callback:base::Bind(&OnCertificateSelected,
56 &cert, 56 &cert,
57 &count)]; 57 &count)];
58 [selector displayForWebContents:web_contents]; 58 [selector displayForWebContents:web_contents];
59 content::RunAllPendingInMessageLoop(); 59 content::RunAllPendingInMessageLoop();
60 EXPECT_TRUE([selector panel]); 60 EXPECT_TRUE([selector panel]);
61 EXPECT_TRUE(web_contents_modal_dialog_manager->IsShowingDialog()); 61 EXPECT_TRUE(web_contents_modal_dialog_manager->IsDialogActive());
62 62
63 WebContentsModalDialogManager::TestApi test_api( 63 WebContentsModalDialogManager::TestApi test_api(
64 web_contents_modal_dialog_manager); 64 web_contents_modal_dialog_manager);
65 test_api.CloseAllDialogs(); 65 test_api.CloseAllDialogs();
66 content::RunAllPendingInMessageLoop(); 66 content::RunAllPendingInMessageLoop();
67 EXPECT_FALSE(web_contents_modal_dialog_manager->IsShowingDialog()); 67 EXPECT_FALSE(web_contents_modal_dialog_manager->IsDialogActive());
68 68
69 EXPECT_EQ(NULL, cert); 69 EXPECT_EQ(NULL, cert);
70 EXPECT_EQ(1, count); 70 EXPECT_EQ(1, count);
71 } 71 }
72 72
73 // Test that switching to another tab correctly hides the sheet. 73 // Test that switching to another tab correctly hides the sheet.
74 IN_PROC_BROWSER_TEST_F(SSLClientCertificateSelectorCocoaTest, HideShow) { 74 IN_PROC_BROWSER_TEST_F(SSLClientCertificateSelectorCocoaTest, HideShow) {
75 SSLClientCertificateSelectorCocoa* selector = 75 SSLClientCertificateSelectorCocoa* selector =
76 [[SSLClientCertificateSelectorCocoa alloc] 76 [[SSLClientCertificateSelectorCocoa alloc]
77 initWithNetworkSession:auth_requestor_->http_network_session_ 77 initWithNetworkSession:auth_requestor_->http_network_session_
(...skipping 12 matching lines...) Expand all
90 AddBlankTabAndShow(browser()); 90 AddBlankTabAndShow(browser());
91 EXPECT_EQ(0.0, [sheetWindow alphaValue]); 91 EXPECT_EQ(0.0, [sheetWindow alphaValue]);
92 EXPECT_TRUE(NSEqualRects(ui::kWindowSizeDeterminedLater, 92 EXPECT_TRUE(NSEqualRects(ui::kWindowSizeDeterminedLater,
93 [sheetWindow frame])); 93 [sheetWindow frame]));
94 94
95 // Switch back and verify that the sheet is shown. 95 // Switch back and verify that the sheet is shown.
96 chrome::SelectNumberedTab(browser(), 0); 96 chrome::SelectNumberedTab(browser(), 0);
97 EXPECT_EQ(1.0, [sheetWindow alphaValue]); 97 EXPECT_EQ(1.0, [sheetWindow alphaValue]);
98 EXPECT_TRUE(NSEqualRects(sheetFrame, [sheetWindow frame])); 98 EXPECT_TRUE(NSEqualRects(sheetFrame, [sheetWindow frame]));
99 } 99 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm ('k') | chrome/browser/ui/tabs/tab_strip_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698