OLD | NEW |
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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 value_type_ = std::tr1::get<0>(GetParam()); | 126 value_type_ = std::tr1::get<0>(GetParam()); |
127 expected_value_ = std::tr1::get<1>(GetParam()); | 127 expected_value_ = std::tr1::get<1>(GetParam()); |
128 } | 128 } |
129 | 129 |
130 static std::unique_ptr<base::Value> MakeValue(base::Value::Type value_type) { | 130 static std::unique_ptr<base::Value> MakeValue(base::Value::Type value_type) { |
131 using base::Value; | 131 using base::Value; |
132 switch (value_type) { | 132 switch (value_type) { |
133 case Value::TYPE_NULL: | 133 case Value::TYPE_NULL: |
134 return Value::CreateNullValue(); | 134 return Value::CreateNullValue(); |
135 case Value::TYPE_BOOLEAN: | 135 case Value::TYPE_BOOLEAN: |
136 return std::unique_ptr<Value>(new base::FundamentalValue(false)); | 136 return std::unique_ptr<Value>(new base::Value(false)); |
137 case Value::TYPE_INTEGER: | 137 case Value::TYPE_INTEGER: |
138 return std::unique_ptr<Value>(new base::FundamentalValue(47)); | 138 return std::unique_ptr<Value>(new base::Value(47)); |
139 case Value::TYPE_DOUBLE: | 139 case Value::TYPE_DOUBLE: |
140 return std::unique_ptr<Value>(new base::FundamentalValue(0.47)); | 140 return std::unique_ptr<Value>(new base::Value(0.47)); |
141 case Value::TYPE_STRING: | 141 case Value::TYPE_STRING: |
142 return std::unique_ptr<Value>(new base::StringValue("i have a spleen")); | 142 return std::unique_ptr<Value>(new base::StringValue("i have a spleen")); |
143 case Value::TYPE_DICTIONARY: { | 143 case Value::TYPE_DICTIONARY: { |
144 std::unique_ptr<base::DictionaryValue> value( | 144 std::unique_ptr<base::DictionaryValue> value( |
145 new base::DictionaryValue()); | 145 new base::DictionaryValue()); |
146 value->SetInteger("twenty-two", 22); | 146 value->SetInteger("twenty-two", 22); |
147 value->SetInteger("forty-seven", 47); | 147 value->SetInteger("forty-seven", 47); |
148 return std::move(value); | 148 return std::move(value); |
149 } | 149 } |
150 case Value::TYPE_LIST: { | 150 case Value::TYPE_LIST: { |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 INSTANTIATE_TEST_CASE_P( | 342 INSTANTIATE_TEST_CASE_P( |
343 WithIncidentIgnoreBypass, | 343 WithIncidentIgnoreBypass, |
344 PreferenceValidationDelegateWithIncident, | 344 PreferenceValidationDelegateWithIncident, |
345 testing::Combine( | 345 testing::Combine( |
346 testing::Values(PrefHashStoreTransaction::CLEARED, | 346 testing::Values(PrefHashStoreTransaction::CLEARED, |
347 PrefHashStoreTransaction::CHANGED, | 347 PrefHashStoreTransaction::CHANGED, |
348 PrefHashStoreTransaction::UNTRUSTED_UNKNOWN_VALUE), | 348 PrefHashStoreTransaction::UNTRUSTED_UNKNOWN_VALUE), |
349 testing::Values(PrefHashStoreTransaction::CHANGED, | 349 testing::Values(PrefHashStoreTransaction::CHANGED, |
350 PrefHashStoreTransaction::CLEARED), | 350 PrefHashStoreTransaction::CLEARED), |
351 testing::Bool())); | 351 testing::Bool())); |
OLD | NEW |