| 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 void SetUp() override { | 111 void SetUp() override { |
| 112 PreferenceValidationDelegateTest::SetUp(); | 112 PreferenceValidationDelegateTest::SetUp(); |
| 113 value_type_ = std::tr1::get<0>(GetParam()); | 113 value_type_ = std::tr1::get<0>(GetParam()); |
| 114 expected_value_ = std::tr1::get<1>(GetParam()); | 114 expected_value_ = std::tr1::get<1>(GetParam()); |
| 115 } | 115 } |
| 116 | 116 |
| 117 static scoped_ptr<base::Value> MakeValue(base::Value::Type value_type) { | 117 static scoped_ptr<base::Value> MakeValue(base::Value::Type value_type) { |
| 118 using base::Value; | 118 using base::Value; |
| 119 switch (value_type) { | 119 switch (value_type) { |
| 120 case Value::TYPE_NULL: | 120 case Value::TYPE_NULL: |
| 121 return make_scoped_ptr(Value::CreateNullValue()); | 121 return Value::CreateNullValue(); |
| 122 case Value::TYPE_BOOLEAN: | 122 case Value::TYPE_BOOLEAN: |
| 123 return scoped_ptr<Value>(new base::FundamentalValue(false)); | 123 return scoped_ptr<Value>(new base::FundamentalValue(false)); |
| 124 case Value::TYPE_INTEGER: | 124 case Value::TYPE_INTEGER: |
| 125 return scoped_ptr<Value>(new base::FundamentalValue(47)); | 125 return scoped_ptr<Value>(new base::FundamentalValue(47)); |
| 126 case Value::TYPE_DOUBLE: | 126 case Value::TYPE_DOUBLE: |
| 127 return scoped_ptr<Value>(new base::FundamentalValue(0.47)); | 127 return scoped_ptr<Value>(new base::FundamentalValue(0.47)); |
| 128 case Value::TYPE_STRING: | 128 case Value::TYPE_STRING: |
| 129 return scoped_ptr<Value>(new base::StringValue("i have a spleen")); | 129 return scoped_ptr<Value>(new base::StringValue("i have a spleen")); |
| 130 case Value::TYPE_DICTIONARY: { | 130 case Value::TYPE_DICTIONARY: { |
| 131 scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue()); | 131 scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue()); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 } | 280 } |
| 281 | 281 |
| 282 INSTANTIATE_TEST_CASE_P( | 282 INSTANTIATE_TEST_CASE_P( |
| 283 WithIncident, | 283 WithIncident, |
| 284 PreferenceValidationDelegateWithIncident, | 284 PreferenceValidationDelegateWithIncident, |
| 285 testing::Combine( | 285 testing::Combine( |
| 286 testing::Values(PrefHashStoreTransaction::CLEARED, | 286 testing::Values(PrefHashStoreTransaction::CLEARED, |
| 287 PrefHashStoreTransaction::CHANGED, | 287 PrefHashStoreTransaction::CHANGED, |
| 288 PrefHashStoreTransaction::UNTRUSTED_UNKNOWN_VALUE), | 288 PrefHashStoreTransaction::UNTRUSTED_UNKNOWN_VALUE), |
| 289 testing::Bool())); | 289 testing::Bool())); |
| OLD | NEW |