OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/synchronization/waitable_event.h" | 7 #include "base/synchronization/waitable_event.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/views/ssl_client_certificate_selector.h" | 10 #include "chrome/browser/ui/views/ssl_client_certificate_selector.h" |
11 #include "chrome/test/base/in_process_browser_test.h" | 11 #include "chrome/test/base/in_process_browser_test.h" |
12 #include "chrome/test/base/ui_test_utils.h" | 12 #include "chrome/test/base/ui_test_utils.h" |
13 #include "content/browser/ssl/ssl_client_auth_handler_mock.h" | 13 #include "content/browser/ssl/ssl_client_auth_handler_mock.h" |
14 #include "net/base/cert_test_util.h" | 14 #include "net/base/cert_test_util.h" |
15 #include "net/base/x509_certificate.h" | 15 #include "net/base/x509_certificate.h" |
16 #include "net/url_request/url_request.h" | 16 #include "net/url_request/url_request.h" |
17 #include "net/url_request/url_request_context.h" | 17 #include "net/url_request/url_request_context.h" |
18 #include "net/url_request/url_request_context_getter.h" | 18 #include "net/url_request/url_request_context_getter.h" |
19 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
21 | 21 |
22 using ::testing::Mock; | 22 using ::testing::Mock; |
23 using ::testing::StrictMock; | 23 using ::testing::StrictMock; |
| 24 using content::BrowserThread; |
24 | 25 |
25 // We don't have a way to do end-to-end SSL client auth testing, so this test | 26 // We don't have a way to do end-to-end SSL client auth testing, so this test |
26 // creates a certificate selector_ manually with a mocked | 27 // creates a certificate selector_ manually with a mocked |
27 // SSLClientAuthHandler. | 28 // SSLClientAuthHandler. |
28 | 29 |
29 class SSLClientCertificateSelectorTest : public InProcessBrowserTest { | 30 class SSLClientCertificateSelectorTest : public InProcessBrowserTest { |
30 public: | 31 public: |
31 SSLClientCertificateSelectorTest() : io_loop_finished_event_(false, false) { | 32 SSLClientCertificateSelectorTest() : io_loop_finished_event_(false, false) { |
32 } | 33 } |
33 | 34 |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 EXPECT_TRUE(ui_test_utils::SendKeyPressSync( | 351 EXPECT_TRUE(ui_test_utils::SendKeyPressSync( |
351 browser_1_, ui::VKEY_RETURN, false, false, false, false)); | 352 browser_1_, ui::VKEY_RETURN, false, false, false, false)); |
352 | 353 |
353 Mock::VerifyAndClear(auth_handler_); | 354 Mock::VerifyAndClear(auth_handler_); |
354 Mock::VerifyAndClear(auth_handler_1_); | 355 Mock::VerifyAndClear(auth_handler_1_); |
355 | 356 |
356 // Now let the default selection for auth_handler_ mock get checked on | 357 // Now let the default selection for auth_handler_ mock get checked on |
357 // destruction. | 358 // destruction. |
358 EXPECT_CALL(*auth_handler_, CertificateSelectedNoNotify(NULL)); | 359 EXPECT_CALL(*auth_handler_, CertificateSelectedNoNotify(NULL)); |
359 } | 360 } |
OLD | NEW |