OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/views/certificate_selector.h" | 5 #include "chrome/browser/ui/views/certificate_selector.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 base::Closure on_destroy_; | 67 base::Closure on_destroy_; |
68 | 68 |
69 DISALLOW_COPY_AND_ASSIGN(TestCertificateSelector); | 69 DISALLOW_COPY_AND_ASSIGN(TestCertificateSelector); |
70 }; | 70 }; |
71 | 71 |
72 class CertificateSelectorTest : public InProcessBrowserTest { | 72 class CertificateSelectorTest : public InProcessBrowserTest { |
73 public: | 73 public: |
74 void SetUpInProcessBrowserTestFixture() override { | 74 void SetUpInProcessBrowserTestFixture() override { |
75 client_1_ = | 75 client_1_ = |
76 net::ImportCertFromFile(net::GetTestCertsDirectory(), "client_1.pem"); | 76 net::ImportCertFromFile(net::GetTestCertsDirectory(), "client_1.pem"); |
77 ASSERT_NE(nullptr, client_1_); | 77 ASSERT_TRUE(client_1_); |
78 | 78 |
79 client_2_ = | 79 client_2_ = |
80 net::ImportCertFromFile(net::GetTestCertsDirectory(), "client_2.pem"); | 80 net::ImportCertFromFile(net::GetTestCertsDirectory(), "client_2.pem"); |
81 ASSERT_NE(nullptr, client_2_); | 81 ASSERT_TRUE(client_2_); |
82 } | 82 } |
83 | 83 |
84 void SetUpOnMainThread() override { | 84 void SetUpOnMainThread() override { |
85 ASSERT_TRUE(content::WaitForLoadStop( | 85 ASSERT_TRUE(content::WaitForLoadStop( |
86 browser()->tab_strip_model()->GetActiveWebContents())); | 86 browser()->tab_strip_model()->GetActiveWebContents())); |
87 | 87 |
88 net::CertificateList certificates; | 88 net::CertificateList certificates; |
89 certificates.push_back(client_1_); | 89 certificates.push_back(client_1_); |
90 certificates.push_back(client_2_); | 90 certificates.push_back(client_2_); |
91 | 91 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 selector_->OnDoubleClick(); | 149 selector_->OnDoubleClick(); |
150 | 150 |
151 // Wait for the dialog to be closed and destroyed. | 151 // Wait for the dialog to be closed and destroyed. |
152 loop.Run(); | 152 loop.Run(); |
153 | 153 |
154 // Closing the dialog through a double click must call only the Accept() | 154 // Closing the dialog through a double click must call only the Accept() |
155 // function and not Cancel(). | 155 // function and not Cancel(). |
156 EXPECT_TRUE(accepted); | 156 EXPECT_TRUE(accepted); |
157 EXPECT_FALSE(canceled); | 157 EXPECT_FALSE(canceled); |
158 } | 158 } |
OLD | NEW |