Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: chrome/browser/ssl/chrome_ssl_host_state_delegate_test.cc

Issue 2175703002: Implement a task scheduler for BrowsingDataRemover (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bdr-race-condition
Patch Set: Formatting. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/command_line.h" 10 #include "base/command_line.h"
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 540
541 // Tests to make sure that if the user deletes their browser history, SSL 541 // Tests to make sure that if the user deletes their browser history, SSL
542 // exceptions will be deleted as well. 542 // exceptions will be deleted as well.
543 class RemoveBrowsingHistorySSLHostStateDelegateTest 543 class RemoveBrowsingHistorySSLHostStateDelegateTest
544 : public ChromeSSLHostStateDelegateTest { 544 : public ChromeSSLHostStateDelegateTest {
545 public: 545 public:
546 void RemoveAndWait(Profile* profile) { 546 void RemoveAndWait(Profile* profile) {
547 BrowsingDataRemover* remover = 547 BrowsingDataRemover* remover =
548 BrowsingDataRemoverFactory::GetForBrowserContext(profile); 548 BrowsingDataRemoverFactory::GetForBrowserContext(profile);
549 BrowsingDataRemoverCompletionObserver completion_observer(remover); 549 BrowsingDataRemoverCompletionObserver completion_observer(remover);
550 remover->Remove(BrowsingDataRemover::Period(browsing_data::LAST_HOUR), 550 remover->RemoveAndReply(
551 BrowsingDataRemover::REMOVE_HISTORY, 551 BrowsingDataRemover::Period(browsing_data::LAST_HOUR),
552 BrowsingDataHelper::UNPROTECTED_WEB); 552 BrowsingDataRemover::REMOVE_HISTORY,
553 BrowsingDataHelper::UNPROTECTED_WEB, &completion_observer);
553 completion_observer.BlockUntilCompletion(); 554 completion_observer.BlockUntilCompletion();
554 } 555 }
555 }; 556 };
556 557
557 IN_PROC_BROWSER_TEST_F(RemoveBrowsingHistorySSLHostStateDelegateTest, 558 IN_PROC_BROWSER_TEST_F(RemoveBrowsingHistorySSLHostStateDelegateTest,
558 DeleteHistory) { 559 DeleteHistory) {
559 scoped_refptr<net::X509Certificate> cert = GetOkCert(); 560 scoped_refptr<net::X509Certificate> cert = GetOkCert();
560 content::WebContents* tab = 561 content::WebContents* tab =
561 browser()->tab_strip_model()->GetActiveWebContents(); 562 browser()->tab_strip_model()->GetActiveWebContents();
562 Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext()); 563 Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext());
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 EXPECT_EQ( 624 EXPECT_EQ(
624 content::SSLHostStateDelegate::ALLOWED, 625 content::SSLHostStateDelegate::ALLOWED,
625 state->QueryPolicy("localhost", *cert, 626 state->QueryPolicy("localhost", *cert,
626 net::CERT_STATUS_COMMON_NAME_INVALID, &unused_value)); 627 net::CERT_STATUS_COMMON_NAME_INVALID, &unused_value));
627 628
628 EXPECT_EQ( 629 EXPECT_EQ(
629 content::SSLHostStateDelegate::ALLOWED, 630 content::SSLHostStateDelegate::ALLOWED,
630 state->QueryPolicy("127.0.0.1", *cert, 631 state->QueryPolicy("127.0.0.1", *cert,
631 net::CERT_STATUS_COMMON_NAME_INVALID, &unused_value)); 632 net::CERT_STATUS_COMMON_NAME_INVALID, &unused_value));
632 } 633 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698