| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #import "chrome/browser/certificate_viewer.h" | 5 #import "chrome/browser/certificate_viewer.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
| 8 #include "chrome/browser/ui/browser_commands.h" | 8 #include "chrome/browser/ui/browser_commands.h" |
| 9 #include "chrome/browser/ui/cocoa/certificate_viewer_mac.h" | 9 #include "chrome/browser/ui/cocoa/certificate_viewer_mac.h" |
| 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 11 #include "chrome/test/base/in_process_browser_test.h" | 11 #include "chrome/test/base/in_process_browser_test.h" |
| 12 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 12 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
| 14 #include "content/public/test/test_utils.h" | 14 #include "content/public/test/test_utils.h" |
| 15 #include "net/cert/x509_certificate.h" | 15 #include "net/cert/x509_certificate.h" |
| 16 #include "net/test/cert_test_util.h" | 16 #include "net/test/cert_test_util.h" |
| 17 #include "net/test/test_data_directory.h" | 17 #include "net/test/test_data_directory.h" |
| 18 #import "testing/gtest_mac.h" | 18 #import "testing/gtest_mac.h" |
| 19 #include "ui/base/cocoa/window_size_constants.h" | 19 #include "ui/base/cocoa/window_size_constants.h" |
| 20 | 20 |
| 21 using web_modal::WebContentsModalDialogManager; | 21 using web_modal::WebContentsModalDialogManager; |
| 22 | 22 |
| 23 typedef InProcessBrowserTest SSLCertificateViewerMacTest; | 23 using SSLCertificateViewerMacTest = InProcessBrowserTest; |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 scoped_refptr<net::X509Certificate> GetSampleCertificate() { | 27 scoped_refptr<net::X509Certificate> GetSampleCertificate() { |
| 28 return net::ImportCertFromFile(net::GetTestCertsDirectory(), | 28 return net::ImportCertFromFile(net::GetTestCertsDirectory(), |
| 29 "mit.davidben.der"); | 29 "mit.davidben.der"); |
| 30 } | 30 } |
| 31 | 31 |
| 32 void CheckCertificateViewerVisibility(NSWindow* overlay_window, | 32 void CheckCertificateViewerVisibility(NSWindow* overlay_window, |
| 33 NSWindow* dialog_sheet, | 33 NSWindow* dialog_sheet, |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // are not blocking mouse events, and |dialog_sheet| is hidden. | 100 // are not blocking mouse events, and |dialog_sheet| is hidden. |
| 101 AddBlankTabAndShow(browser()); | 101 AddBlankTabAndShow(browser()); |
| 102 CheckCertificateViewerVisibility(overlay_window, dialog_sheet, false); | 102 CheckCertificateViewerVisibility(overlay_window, dialog_sheet, false); |
| 103 EXPECT_NSEQ(sheet_frame, [dialog_sheet frame]); | 103 EXPECT_NSEQ(sheet_frame, [dialog_sheet frame]); |
| 104 | 104 |
| 105 // Switch back and verify that the sheet is shown. | 105 // Switch back and verify that the sheet is shown. |
| 106 chrome::SelectNumberedTab(browser(), 0); | 106 chrome::SelectNumberedTab(browser(), 0); |
| 107 content::RunAllPendingInMessageLoop(); | 107 content::RunAllPendingInMessageLoop(); |
| 108 CheckCertificateViewerVisibility(overlay_window, dialog_sheet, true); | 108 CheckCertificateViewerVisibility(overlay_window, dialog_sheet, true); |
| 109 } | 109 } |
| OLD | NEW |