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 #include "chrome/browser/ssl/ssl_client_certificate_selector_test.h" | 5 #include "chrome/browser/ssl/ssl_client_certificate_selector_test.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 "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 this)); | 59 this)); |
60 | 60 |
61 io_loop_finished_event_.Wait(); | 61 io_loop_finished_event_.Wait(); |
62 | 62 |
63 content::WaitForLoadStop( | 63 content::WaitForLoadStop( |
64 browser()->tab_strip_model()->GetActiveWebContents()); | 64 browser()->tab_strip_model()->GetActiveWebContents()); |
65 } | 65 } |
66 | 66 |
67 // Have to release our reference to the auth handler during the test to allow | 67 // Have to release our reference to the auth handler during the test to allow |
68 // it to be destroyed while the Browser and its IO thread still exist. | 68 // it to be destroyed while the Browser and its IO thread still exist. |
69 void SSLClientCertificateSelectorTestBase::CleanUpOnMainThread() { | 69 void SSLClientCertificateSelectorTestBase::TearDownOnMainThread() { |
70 BrowserThread::PostTask( | 70 BrowserThread::PostTask( |
71 BrowserThread::IO, | 71 BrowserThread::IO, |
72 FROM_HERE, | 72 FROM_HERE, |
73 base::Bind(&SSLClientCertificateSelectorTestBase::CleanUpOnIOThread, | 73 base::Bind(&SSLClientCertificateSelectorTestBase::TearDownOnIOThread, |
74 this)); | 74 this)); |
75 | 75 |
76 io_loop_finished_event_.Wait(); | 76 io_loop_finished_event_.Wait(); |
77 | 77 |
78 auth_requestor_ = NULL; | 78 auth_requestor_ = NULL; |
79 } | 79 } |
80 | 80 |
81 void SSLClientCertificateSelectorTestBase::SetUpOnIOThread() { | 81 void SSLClientCertificateSelectorTestBase::SetUpOnIOThread() { |
82 url_request_ = MakeURLRequest(url_request_context_getter_.get()).release(); | 82 url_request_ = MakeURLRequest(url_request_context_getter_.get()).release(); |
83 | 83 |
84 auth_requestor_ = new StrictMock<SSLClientAuthRequestorMock>( | 84 auth_requestor_ = new StrictMock<SSLClientAuthRequestorMock>( |
85 url_request_, cert_request_info_.get()); | 85 url_request_, cert_request_info_.get()); |
86 | 86 |
87 io_loop_finished_event_.Signal(); | 87 io_loop_finished_event_.Signal(); |
88 } | 88 } |
89 | 89 |
90 void SSLClientCertificateSelectorTestBase::CleanUpOnIOThread() { | 90 void SSLClientCertificateSelectorTestBase::TearDownOnIOThread() { |
91 delete url_request_; | 91 delete url_request_; |
92 | 92 |
93 io_loop_finished_event_.Signal(); | 93 io_loop_finished_event_.Signal(); |
94 } | 94 } |
95 | 95 |
96 scoped_ptr<net::URLRequest> | 96 scoped_ptr<net::URLRequest> |
97 SSLClientCertificateSelectorTestBase::MakeURLRequest( | 97 SSLClientCertificateSelectorTestBase::MakeURLRequest( |
98 net::URLRequestContextGetter* context_getter) { | 98 net::URLRequestContextGetter* context_getter) { |
99 scoped_ptr<net::URLRequest> request = | 99 scoped_ptr<net::URLRequest> request = |
100 context_getter->GetURLRequestContext()->CreateRequest( | 100 context_getter->GetURLRequestContext()->CreateRequest( |
101 GURL("https://example"), net::DEFAULT_PRIORITY, NULL, NULL); | 101 GURL("https://example"), net::DEFAULT_PRIORITY, NULL, NULL); |
102 return request.Pass(); | 102 return request.Pass(); |
103 } | 103 } |
OLD | NEW |