| 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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 | 612 |
| 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(browsing_data::CalculateBeginDeleteTime( |
| 623 browsing_data::CalculateBeginDeleteTime(browsing_data::LAST_HOUR), | 623 browsing_data::TimePeriod::LAST_HOUR), |
| 624 browsing_data::CalculateEndDeleteTime(browsing_data::LAST_HOUR), | 624 browsing_data::CalculateEndDeleteTime( |
| 625 BrowsingDataRemover::REMOVE_HISTORY, | 625 browsing_data::TimePeriod::LAST_HOUR), |
| 626 BrowsingDataHelper::UNPROTECTED_WEB, &completion_observer); | 626 BrowsingDataRemover::REMOVE_HISTORY, |
| 627 BrowsingDataHelper::UNPROTECTED_WEB, |
| 628 &completion_observer); |
| 627 completion_observer.BlockUntilCompletion(); | 629 completion_observer.BlockUntilCompletion(); |
| 628 } | 630 } |
| 629 }; | 631 }; |
| 630 | 632 |
| 631 IN_PROC_BROWSER_TEST_F(RemoveBrowsingHistorySSLHostStateDelegateTest, | 633 IN_PROC_BROWSER_TEST_F(RemoveBrowsingHistorySSLHostStateDelegateTest, |
| 632 DeleteHistory) { | 634 DeleteHistory) { |
| 633 scoped_refptr<net::X509Certificate> cert = GetOkCert(); | 635 scoped_refptr<net::X509Certificate> cert = GetOkCert(); |
| 634 content::WebContents* tab = | 636 content::WebContents* tab = |
| 635 browser()->tab_strip_model()->GetActiveWebContents(); | 637 browser()->tab_strip_model()->GetActiveWebContents(); |
| 636 Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext()); | 638 Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext()); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 EXPECT_EQ( | 699 EXPECT_EQ( |
| 698 content::SSLHostStateDelegate::ALLOWED, | 700 content::SSLHostStateDelegate::ALLOWED, |
| 699 state->QueryPolicy("localhost", *cert, | 701 state->QueryPolicy("localhost", *cert, |
| 700 net::CERT_STATUS_COMMON_NAME_INVALID, &unused_value)); | 702 net::CERT_STATUS_COMMON_NAME_INVALID, &unused_value)); |
| 701 | 703 |
| 702 EXPECT_EQ( | 704 EXPECT_EQ( |
| 703 content::SSLHostStateDelegate::ALLOWED, | 705 content::SSLHostStateDelegate::ALLOWED, |
| 704 state->QueryPolicy("127.0.0.1", *cert, | 706 state->QueryPolicy("127.0.0.1", *cert, |
| 705 net::CERT_STATUS_COMMON_NAME_INVALID, &unused_value)); | 707 net::CERT_STATUS_COMMON_NAME_INVALID, &unused_value)); |
| 706 } | 708 } |
| OLD | NEW |