OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chrome_ssl_host_state_delegate.h" | 5 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 // Tests to make sure that if the user deletes their browser history, SSL | 613 // Tests to make sure that if the user deletes their browser history, SSL |
614 // exceptions will be deleted as well. | 614 // exceptions will be deleted as well. |
615 class RemoveBrowsingHistorySSLHostStateDelegateTest | 615 class RemoveBrowsingHistorySSLHostStateDelegateTest |
616 : public ChromeSSLHostStateDelegateTest { | 616 : public ChromeSSLHostStateDelegateTest { |
617 public: | 617 public: |
618 void RemoveAndWait(Profile* profile) { | 618 void RemoveAndWait(Profile* profile) { |
619 BrowsingDataRemover* remover = | 619 BrowsingDataRemover* remover = |
620 BrowsingDataRemoverFactory::GetForBrowserContext(profile); | 620 BrowsingDataRemoverFactory::GetForBrowserContext(profile); |
621 BrowsingDataRemoverCompletionObserver completion_observer(remover); | 621 BrowsingDataRemoverCompletionObserver completion_observer(remover); |
622 remover->RemoveAndReply( | 622 remover->RemoveAndReply( |
623 BrowsingDataRemover::Period(browsing_data::LAST_HOUR), | 623 browsing_data::CalculateBeginDeleteTime(browsing_data::LAST_HOUR), |
| 624 browsing_data::CalculateEndDeleteTime(browsing_data::LAST_HOUR), |
624 BrowsingDataRemover::REMOVE_HISTORY, | 625 BrowsingDataRemover::REMOVE_HISTORY, |
625 BrowsingDataHelper::UNPROTECTED_WEB, &completion_observer); | 626 BrowsingDataHelper::UNPROTECTED_WEB, &completion_observer); |
626 completion_observer.BlockUntilCompletion(); | 627 completion_observer.BlockUntilCompletion(); |
627 } | 628 } |
628 }; | 629 }; |
629 | 630 |
630 IN_PROC_BROWSER_TEST_F(RemoveBrowsingHistorySSLHostStateDelegateTest, | 631 IN_PROC_BROWSER_TEST_F(RemoveBrowsingHistorySSLHostStateDelegateTest, |
631 DeleteHistory) { | 632 DeleteHistory) { |
632 scoped_refptr<net::X509Certificate> cert = GetOkCert(); | 633 scoped_refptr<net::X509Certificate> cert = GetOkCert(); |
633 content::WebContents* tab = | 634 content::WebContents* tab = |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 EXPECT_EQ( | 697 EXPECT_EQ( |
697 content::SSLHostStateDelegate::ALLOWED, | 698 content::SSLHostStateDelegate::ALLOWED, |
698 state->QueryPolicy("localhost", *cert, | 699 state->QueryPolicy("localhost", *cert, |
699 net::CERT_STATUS_COMMON_NAME_INVALID, &unused_value)); | 700 net::CERT_STATUS_COMMON_NAME_INVALID, &unused_value)); |
700 | 701 |
701 EXPECT_EQ( | 702 EXPECT_EQ( |
702 content::SSLHostStateDelegate::ALLOWED, | 703 content::SSLHostStateDelegate::ALLOWED, |
703 state->QueryPolicy("127.0.0.1", *cert, | 704 state->QueryPolicy("127.0.0.1", *cert, |
704 net::CERT_STATUS_COMMON_NAME_INVALID, &unused_value)); | 705 net::CERT_STATUS_COMMON_NAME_INVALID, &unused_value)); |
705 } | 706 } |
OLD | NEW |