OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/prefs/pref_service.h" | 5 #include "chrome/browser/prefs/pref_service.h" |
6 #include "chrome/browser/profiles/profile.h" | 6 #include "chrome/browser/profiles/profile.h" |
7 #include "chrome/browser/safe_browsing/malware_details.h" | 7 #include "chrome/browser/safe_browsing/malware_details.h" |
8 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" | 8 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" |
9 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 malware_details_proceed_delay_ms_ = 0; | 40 malware_details_proceed_delay_ms_ = 0; |
41 | 41 |
42 // Don't create a view. | 42 // Don't create a view. |
43 interstitial_page_->DontCreateViewForTesting(); | 43 interstitial_page_->DontCreateViewForTesting(); |
44 } | 44 } |
45 | 45 |
46 }; | 46 }; |
47 | 47 |
48 class TestSafeBrowsingService: public SafeBrowsingService { | 48 class TestSafeBrowsingService: public SafeBrowsingService { |
49 public: | 49 public: |
50 virtual ~TestSafeBrowsingService() {} | |
51 | |
52 virtual void SendSerializedMalwareDetails(const std::string& serialized) { | 50 virtual void SendSerializedMalwareDetails(const std::string& serialized) { |
53 details_.push_back(serialized); | 51 details_.push_back(serialized); |
54 } | 52 } |
55 | 53 |
56 std::list<std::string>* GetDetails() { | 54 std::list<std::string>* GetDetails() { |
57 return &details_; | 55 return &details_; |
58 } | 56 } |
59 | 57 |
| 58 private: |
| 59 virtual ~TestSafeBrowsingService() {} |
| 60 |
60 std::list<std::string> details_; | 61 std::list<std::string> details_; |
61 }; | 62 }; |
62 | 63 |
63 class TestSafeBrowsingBlockingPageFactory | 64 class TestSafeBrowsingBlockingPageFactory |
64 : public SafeBrowsingBlockingPageFactory { | 65 : public SafeBrowsingBlockingPageFactory { |
65 public: | 66 public: |
66 TestSafeBrowsingBlockingPageFactory() { } | 67 TestSafeBrowsingBlockingPageFactory() { } |
67 ~TestSafeBrowsingBlockingPageFactory() { } | 68 ~TestSafeBrowsingBlockingPageFactory() { } |
68 | 69 |
69 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( | 70 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 | 627 |
627 EXPECT_TRUE(profile->GetPrefs()->GetBoolean( | 628 EXPECT_TRUE(profile->GetPrefs()->GetBoolean( |
628 prefs::kSafeBrowsingReportingEnabled)); | 629 prefs::kSafeBrowsingReportingEnabled)); |
629 | 630 |
630 // Simulate the user uncheck the report agreement checkbox. | 631 // Simulate the user uncheck the report agreement checkbox. |
631 sb_interstitial->SetReportingPreference(false); | 632 sb_interstitial->SetReportingPreference(false); |
632 | 633 |
633 EXPECT_FALSE(profile->GetPrefs()->GetBoolean( | 634 EXPECT_FALSE(profile->GetPrefs()->GetBoolean( |
634 prefs::kSafeBrowsingReportingEnabled)); | 635 prefs::kSafeBrowsingReportingEnabled)); |
635 } | 636 } |
OLD | NEW |