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

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

Issue 2666093002: Remove base::FundamentalValue (Closed)
Patch Set: Rebase Created 3 years, 9 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 <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
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::NONE: 133 case Value::Type::NONE:
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
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()));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698