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 <map> | 5 #include <map> |
6 #include <set> | 6 #include <set> |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 #include "content/public/browser/notification_observer.h" | 48 #include "content/public/browser/notification_observer.h" |
49 #include "content/public/browser/notification_registrar.h" | 49 #include "content/public/browser/notification_registrar.h" |
50 #include "content/public/browser/notification_service.h" | 50 #include "content/public/browser/notification_service.h" |
51 #include "content/public/browser/notification_types.h" | 51 #include "content/public/browser/notification_types.h" |
52 #include "content/public/browser/render_frame_host.h" | 52 #include "content/public/browser/render_frame_host.h" |
53 #include "content/public/browser/web_contents.h" | 53 #include "content/public/browser/web_contents.h" |
54 #include "content/public/common/url_constants.h" | 54 #include "content/public/common/url_constants.h" |
55 #include "content/public/test/browser_test_utils.h" | 55 #include "content/public/test/browser_test_utils.h" |
56 #include "net/base/net_errors.h" | 56 #include "net/base/net_errors.h" |
57 #include "net/http/transport_security_state.h" | 57 #include "net/http/transport_security_state.h" |
58 #include "net/test/test_certificate_data.h" | |
58 #include "net/test/url_request/url_request_failed_job.h" | 59 #include "net/test/url_request/url_request_failed_job.h" |
59 #include "net/test/url_request/url_request_mock_http_job.h" | 60 #include "net/test/url_request/url_request_mock_http_job.h" |
60 #include "net/url_request/url_request.h" | 61 #include "net/url_request/url_request.h" |
61 #include "net/url_request/url_request_context.h" | 62 #include "net/url_request/url_request_context.h" |
62 #include "net/url_request/url_request_context_getter.h" | 63 #include "net/url_request/url_request_context_getter.h" |
63 #include "net/url_request/url_request_filter.h" | 64 #include "net/url_request/url_request_filter.h" |
64 #include "net/url_request/url_request_interceptor.h" | 65 #include "net/url_request/url_request_interceptor.h" |
65 #include "net/url_request/url_request_job.h" | 66 #include "net/url_request/url_request_job.h" |
66 #include "net/url_request/url_request_status.h" | 67 #include "net/url_request/url_request_status.h" |
67 #include "testing/gtest/include/gtest/gtest.h" | 68 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
338 // it from the job list before the error. | 339 // it from the job list before the error. |
339 EXPECT_TRUE(job->RemoveFromList()); | 340 EXPECT_TRUE(job->RemoveFromList()); |
340 if (end_job_operation == FAIL_JOBS) { | 341 if (end_job_operation == FAIL_JOBS) { |
341 job->NotifyStartError(net::URLRequestStatus( | 342 job->NotifyStartError(net::URLRequestStatus( |
342 net::URLRequestStatus::FAILED, | 343 net::URLRequestStatus::FAILED, |
343 net::ERR_CONNECTION_TIMED_OUT)); | 344 net::ERR_CONNECTION_TIMED_OUT)); |
344 } else if (end_job_operation == FAIL_JOBS_WITH_CERT_ERROR) { | 345 } else if (end_job_operation == FAIL_JOBS_WITH_CERT_ERROR) { |
345 DCHECK(job->request()->url().SchemeIsCryptographic()); | 346 DCHECK(job->request()->url().SchemeIsCryptographic()); |
346 net::SSLInfo info; | 347 net::SSLInfo info; |
347 info.cert_status = net::CERT_STATUS_COMMON_NAME_INVALID; | 348 info.cert_status = net::CERT_STATUS_COMMON_NAME_INVALID; |
348 info.cert = new net::X509Certificate( | 349 info.cert = net::X509Certificate::CreateFromBytes( |
mmenke
2015/07/31 15:16:49
While you're here, mind adding whatever header X50
Bhanu Dev
2015/07/31 18:20:38
Done.
| |
349 "bad.host", "CA", base::Time::Max(), base::Time::Max()); | 350 reinterpret_cast<const char*>(google_der), sizeof(google_der)); |
mmenke
2015/07/31 15:16:49
google_der is a global constant? Its naming viola
Bhanu Dev
2015/07/31 18:20:38
I have added a bug for this at crbug.com/515969. B
| |
350 job->NotifySSLCertificateError(info, true); | 351 job->NotifySSLCertificateError(info, true); |
351 } | 352 } |
352 } | 353 } |
353 | 354 |
354 EXPECT_EQ(expected_num_jobs, num_jobs_started_); | 355 EXPECT_EQ(expected_num_jobs, num_jobs_started_); |
355 EXPECT_EQ(expected_num_jobs, num_jobs); | 356 EXPECT_EQ(expected_num_jobs, num_jobs); |
356 | 357 |
357 num_jobs_started_ -= expected_num_jobs; | 358 num_jobs_started_ -= expected_num_jobs; |
358 } | 359 } |
359 | 360 |
(...skipping 2499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2859 | 2860 |
2860 EXPECT_EQ(CaptivePortalTabReloader::STATE_NEEDS_RELOAD, | 2861 EXPECT_EQ(CaptivePortalTabReloader::STATE_NEEDS_RELOAD, |
2861 GetStateOfTabReloaderAt(browser(), broken_tab_index)); | 2862 GetStateOfTabReloaderAt(browser(), broken_tab_index)); |
2862 | 2863 |
2863 WaitForInterstitialAttach(broken_tab_contents); | 2864 WaitForInterstitialAttach(broken_tab_contents); |
2864 portal_observer.WaitForResults(1); | 2865 portal_observer.WaitForResults(1); |
2865 | 2866 |
2866 EXPECT_EQ(SSLBlockingPage::kTypeForTesting, | 2867 EXPECT_EQ(SSLBlockingPage::kTypeForTesting, |
2867 GetInterstitialType(broken_tab_contents)); | 2868 GetInterstitialType(broken_tab_contents)); |
2868 } | 2869 } |
OLD | NEW |