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

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

Issue 6611023: The optional Malware Details also collects HTTP cache information. See design... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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 | 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 20 matching lines...) Expand all
31 31
32 // Overriden from InterstitialPage. Don't create a view. 32 // Overriden from InterstitialPage. Don't create a view.
33 virtual TabContentsView* CreateTabContentsView() { 33 virtual TabContentsView* CreateTabContentsView() {
34 return NULL; 34 return NULL;
35 } 35 }
36 }; 36 };
37 37
38 class TestSafeBrowsingService: public SafeBrowsingService { 38 class TestSafeBrowsingService: public SafeBrowsingService {
39 public: 39 public:
40 virtual ~TestSafeBrowsingService() {} 40 virtual ~TestSafeBrowsingService() {}
41 virtual void ReportMalwareDetails(scoped_refptr<MalwareDetails> details) { 41
42 details_.push_back(details); 42 virtual void SendSerializedMalwareDetails(const std::string& serialized) {
43 details_.push_back(serialized);
43 } 44 }
44 45
45 std::list<scoped_refptr<MalwareDetails> >* GetDetails() { 46 std::list<std::string>* GetDetails() {
46 return &details_; 47 return &details_;
47 } 48 }
48 49
49 std::list<scoped_refptr<MalwareDetails> > details_; 50 std::list<std::string> details_;
50 }; 51 };
51 52
52 class TestSafeBrowsingBlockingPageFactory 53 class TestSafeBrowsingBlockingPageFactory
53 : public SafeBrowsingBlockingPageFactory { 54 : public SafeBrowsingBlockingPageFactory {
54 public: 55 public:
55 TestSafeBrowsingBlockingPageFactory() { } 56 TestSafeBrowsingBlockingPageFactory() { }
56 ~TestSafeBrowsingBlockingPageFactory() { } 57 ~TestSafeBrowsingBlockingPageFactory() { }
57 58
58 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( 59 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage(
59 SafeBrowsingService* service, 60 SafeBrowsingService* service,
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 578
578 EXPECT_TRUE(contents()->profile()->GetPrefs()->GetBoolean( 579 EXPECT_TRUE(contents()->profile()->GetPrefs()->GetBoolean(
579 prefs::kSafeBrowsingReportingEnabled)); 580 prefs::kSafeBrowsingReportingEnabled));
580 581
581 // Simulate the user uncheck the report agreement checkbox. 582 // Simulate the user uncheck the report agreement checkbox.
582 sb_interstitial->SetReportingPreference(false); 583 sb_interstitial->SetReportingPreference(false);
583 584
584 EXPECT_FALSE(contents()->profile()->GetPrefs()->GetBoolean( 585 EXPECT_FALSE(contents()->profile()->GetPrefs()->GetBoolean(
585 prefs::kSafeBrowsingReportingEnabled)); 586 prefs::kSafeBrowsingReportingEnabled));
586 } 587 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698