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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc

Issue 8345033: Collect some histograms about signed binary downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: fix chromeos and valgrind Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 5
6 #include "chrome/browser/prefs/pref_service.h" 6 #include "chrome/browser/prefs/pref_service.h"
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/safe_browsing/malware_details.h" 8 #include "chrome/browser/safe_browsing/malware_details.h"
9 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" 9 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 ResetUserResponse(); 83 ResetUserResponse();
84 service_ = new TestSafeBrowsingService(); 84 service_ = new TestSafeBrowsingService();
85 } 85 }
86 86
87 virtual void SetUp() { 87 virtual void SetUp() {
88 ChromeRenderViewHostTestHarness::SetUp(); 88 ChromeRenderViewHostTestHarness::SetUp();
89 SafeBrowsingBlockingPage::RegisterFactory(&factory_); 89 SafeBrowsingBlockingPage::RegisterFactory(&factory_);
90 ResetUserResponse(); 90 ResetUserResponse();
91 } 91 }
92 92
93 virtual void TearDown() {
94 // Release the SafeBrowsingService before the BrowserThreads are destroyed.
95 service_ = NULL;
96 ChromeRenderViewHostTestHarness::TearDown();
97 }
98
93 // SafeBrowsingService::Client implementation. 99 // SafeBrowsingService::Client implementation.
94 virtual void OnUrlCheckResult(const GURL& url, 100 virtual void OnUrlCheckResult(const GURL& url,
95 SafeBrowsingService::UrlCheckResult result) { 101 SafeBrowsingService::UrlCheckResult result) {
96 } 102 }
97 virtual void OnBlockingPageComplete(bool proceed) { 103 virtual void OnBlockingPageComplete(bool proceed) {
98 if (proceed) 104 if (proceed)
99 user_response_ = OK; 105 user_response_ = OK;
100 else 106 else
101 user_response_ = CANCEL; 107 user_response_ = CANCEL;
102 } 108 }
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 592
587 EXPECT_TRUE(profile->GetPrefs()->GetBoolean( 593 EXPECT_TRUE(profile->GetPrefs()->GetBoolean(
588 prefs::kSafeBrowsingReportingEnabled)); 594 prefs::kSafeBrowsingReportingEnabled));
589 595
590 // Simulate the user uncheck the report agreement checkbox. 596 // Simulate the user uncheck the report agreement checkbox.
591 sb_interstitial->SetReportingPreference(false); 597 sb_interstitial->SetReportingPreference(false);
592 598
593 EXPECT_FALSE(profile->GetPrefs()->GetBoolean( 599 EXPECT_FALSE(profile->GetPrefs()->GetBoolean(
594 prefs::kSafeBrowsingReportingEnabled)); 600 prefs::kSafeBrowsingReportingEnabled));
595 } 601 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698