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

Side by Side Diff: chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate_unittest.cc

Issue 891793002: Take a Profile when adding an incident to the incident reporting service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment and formatting Created 5 years, 10 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/safe_browsing/incident_reporting/preference_validation_ delegate.h" 5 #include "chrome/browser/safe_browsing/incident_reporting/preference_validation_ delegate.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 13 matching lines...) Expand all
24 24
25 PreferenceValidationDelegateTest() 25 PreferenceValidationDelegateTest()
26 : kPrefPath_("atomic.pref"), 26 : kPrefPath_("atomic.pref"),
27 null_value_(base::Value::CreateNullValue()) {} 27 null_value_(base::Value::CreateNullValue()) {}
28 28
29 void SetUp() override { 29 void SetUp() override {
30 testing::Test::SetUp(); 30 testing::Test::SetUp();
31 invalid_keys_.push_back(std::string("one")); 31 invalid_keys_.push_back(std::string("one"));
32 invalid_keys_.push_back(std::string("two")); 32 invalid_keys_.push_back(std::string("two"));
33 instance_.reset(new safe_browsing::PreferenceValidationDelegate( 33 instance_.reset(new safe_browsing::PreferenceValidationDelegate(
34 base::Bind(&PreferenceValidationDelegateTest::AddIncident, 34 nullptr, base::Bind(&PreferenceValidationDelegateTest::AddIncident,
35 base::Unretained(this)))); 35 base::Unretained(this))));
36 } 36 }
37 37
38 void AddIncident(scoped_ptr<safe_browsing::Incident> incident) { 38 void AddIncident(Profile* profile,
39 scoped_ptr<safe_browsing::Incident> incident) {
39 incidents_.push_back(incident.release()); 40 incidents_.push_back(incident.release());
40 } 41 }
41 42
42 static void ExpectValueStatesEquate( 43 static void ExpectValueStatesEquate(
43 PrefHashStoreTransaction::ValueState store_state, 44 PrefHashStoreTransaction::ValueState store_state,
44 safe_browsing:: 45 safe_browsing::
45 ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState 46 ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState
46 incident_state) { 47 incident_state) {
47 typedef safe_browsing:: 48 typedef safe_browsing::
48 ClientIncidentReport_IncidentData_TrackedPreferenceIncident TPIncident; 49 ClientIncidentReport_IncidentData_TrackedPreferenceIncident TPIncident;
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 } 275 }
275 276
276 INSTANTIATE_TEST_CASE_P( 277 INSTANTIATE_TEST_CASE_P(
277 WithIncident, 278 WithIncident,
278 PreferenceValidationDelegateWithIncident, 279 PreferenceValidationDelegateWithIncident,
279 testing::Combine( 280 testing::Combine(
280 testing::Values(PrefHashStoreTransaction::CLEARED, 281 testing::Values(PrefHashStoreTransaction::CLEARED,
281 PrefHashStoreTransaction::CHANGED, 282 PrefHashStoreTransaction::CHANGED,
282 PrefHashStoreTransaction::UNTRUSTED_UNKNOWN_VALUE), 283 PrefHashStoreTransaction::UNTRUSTED_UNKNOWN_VALUE),
283 testing::Bool())); 284 testing::Bool()));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698