| 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> |
| 11 #include <utility> | 11 #include <utility> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/values.h" | 16 #include "base/values.h" |
| 17 #include "chrome/browser/safe_browsing/incident_reporting/incident.h" | 17 #include "chrome/browser/safe_browsing/incident_reporting/incident.h" |
| 18 #include "chrome/browser/safe_browsing/incident_reporting/mock_incident_receiver
.h" | 18 #include "chrome/browser/safe_browsing/incident_reporting/mock_incident_receiver
.h" |
| 19 #include "components/safe_browsing/csd.pb.h" | 19 #include "components/safe_browsing/csd.pb.h" |
| 20 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 22 | 22 |
| 23 using ::testing::_; | 23 using ::testing::_; |
| 24 using ::testing::IsNull; | 24 using ::testing::IsNull; |
| 25 using ::testing::NiceMock; | 25 using ::testing::NiceMock; |
| 26 using ::testing::WithArg; | 26 using ::testing::WithArg; |
| 27 | 27 |
| 28 using ValueState = |
| 29 prefs::mojom::TrackedPreferenceValidationDelegate::ValueState; |
| 30 |
| 28 namespace { | 31 namespace { |
| 29 const char kPrefPath[] = "atomic.pref"; | 32 const char kPrefPath[] = "atomic.pref"; |
| 30 } | 33 } |
| 31 | 34 |
| 32 // A basic test harness that creates a delegate instance for which it stores all | 35 // A basic test harness that creates a delegate instance for which it stores all |
| 33 // incidents. Tests can push data to the delegate and verify that the test | 36 // incidents. Tests can push data to the delegate and verify that the test |
| 34 // instance was provided with the expected data. | 37 // instance was provided with the expected data. |
| 35 class PreferenceValidationDelegateTest : public testing::Test { | 38 class PreferenceValidationDelegateTest : public testing::Test { |
| 36 protected: | 39 protected: |
| 37 typedef std::vector<std::unique_ptr<safe_browsing::Incident>> IncidentVector; | 40 typedef std::vector<std::unique_ptr<safe_browsing::Incident>> IncidentVector; |
| 38 | 41 |
| 39 void SetUp() override { | 42 void SetUp() override { |
| 40 testing::Test::SetUp(); | 43 testing::Test::SetUp(); |
| 41 invalid_keys_.push_back(std::string("one")); | 44 invalid_keys_.push_back(std::string("one")); |
| 42 invalid_keys_.push_back(std::string("two")); | 45 invalid_keys_.push_back(std::string("two")); |
| 43 external_validation_invalid_keys_.push_back(std::string("three")); | 46 external_validation_invalid_keys_.push_back(std::string("three")); |
| 44 std::unique_ptr<safe_browsing::MockIncidentReceiver> receiver( | 47 std::unique_ptr<safe_browsing::MockIncidentReceiver> receiver( |
| 45 new NiceMock<safe_browsing::MockIncidentReceiver>()); | 48 new NiceMock<safe_browsing::MockIncidentReceiver>()); |
| 46 ON_CALL(*receiver, DoAddIncidentForProfile(IsNull(), _)) | 49 ON_CALL(*receiver, DoAddIncidentForProfile(IsNull(), _)) |
| 47 .WillByDefault(WithArg<1>(TakeIncidentToVector(&incidents_))); | 50 .WillByDefault(WithArg<1>(TakeIncidentToVector(&incidents_))); |
| 48 instance_.reset(new safe_browsing::PreferenceValidationDelegate( | 51 instance_.reset(new safe_browsing::PreferenceValidationDelegate( |
| 49 nullptr, std::move(receiver))); | 52 nullptr, std::move(receiver))); |
| 50 } | 53 } |
| 51 | 54 |
| 52 static void ExpectValueStatesEquate( | 55 static void ExpectValueStatesEquate( |
| 53 PrefHashStoreTransaction::ValueState store_state, | 56 ValueState store_state, |
| 54 PrefHashStoreTransaction::ValueState external_validation_value_state, | 57 ValueState external_validation_value_state, |
| 55 safe_browsing:: | 58 safe_browsing:: |
| 56 ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState | 59 ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState |
| 57 incident_state) { | 60 incident_state) { |
| 58 typedef safe_browsing:: | 61 typedef safe_browsing:: |
| 59 ClientIncidentReport_IncidentData_TrackedPreferenceIncident TPIncident; | 62 ClientIncidentReport_IncidentData_TrackedPreferenceIncident TPIncident; |
| 60 switch (store_state) { | 63 switch (store_state) { |
| 61 case PrefHashStoreTransaction::CLEARED: | 64 case ValueState::CLEARED: |
| 62 EXPECT_EQ(TPIncident::CLEARED, incident_state); | 65 EXPECT_EQ(TPIncident::CLEARED, incident_state); |
| 63 break; | 66 break; |
| 64 case PrefHashStoreTransaction::CHANGED: | 67 case ValueState::CHANGED: |
| 65 EXPECT_EQ(TPIncident::CHANGED, incident_state); | 68 EXPECT_EQ(TPIncident::CHANGED, incident_state); |
| 66 break; | 69 break; |
| 67 case PrefHashStoreTransaction::UNTRUSTED_UNKNOWN_VALUE: | 70 case ValueState::UNTRUSTED_UNKNOWN_VALUE: |
| 68 EXPECT_EQ(TPIncident::UNTRUSTED_UNKNOWN_VALUE, incident_state); | 71 EXPECT_EQ(TPIncident::UNTRUSTED_UNKNOWN_VALUE, incident_state); |
| 69 break; | 72 break; |
| 70 default: | 73 default: |
| 71 if (external_validation_value_state == | 74 if (external_validation_value_state == ValueState::CLEARED) { |
| 72 PrefHashStoreTransaction::CLEARED) { | |
| 73 EXPECT_EQ(TPIncident::BYPASS_CLEARED, incident_state); | 75 EXPECT_EQ(TPIncident::BYPASS_CLEARED, incident_state); |
| 74 } else if (external_validation_value_state == | 76 } else if (external_validation_value_state == ValueState::CHANGED) { |
| 75 PrefHashStoreTransaction::CHANGED) { | |
| 76 EXPECT_EQ(TPIncident::BYPASS_CHANGED, incident_state); | 77 EXPECT_EQ(TPIncident::BYPASS_CHANGED, incident_state); |
| 77 } else { | 78 } else { |
| 78 FAIL() << "unexpected store state"; | 79 FAIL() << "unexpected store state"; |
| 79 } | 80 } |
| 80 break; | 81 break; |
| 81 } | 82 } |
| 82 } | 83 } |
| 83 | 84 |
| 84 static void ExpectKeysEquate( | 85 static void ExpectKeysEquate( |
| 85 const std::vector<std::string>& store_keys, | 86 const std::vector<std::string>& store_keys, |
| 86 const google::protobuf::RepeatedPtrField<std::string>& incident_keys) { | 87 const google::protobuf::RepeatedPtrField<std::string>& incident_keys) { |
| 87 ASSERT_EQ(store_keys.size(), static_cast<size_t>(incident_keys.size())); | 88 ASSERT_EQ(store_keys.size(), static_cast<size_t>(incident_keys.size())); |
| 88 for (int i = 0; i < incident_keys.size(); ++i) { | 89 for (int i = 0; i < incident_keys.size(); ++i) { |
| 89 EXPECT_EQ(store_keys[i], incident_keys.Get(i)); | 90 EXPECT_EQ(store_keys[i], incident_keys.Get(i)); |
| 90 } | 91 } |
| 91 } | 92 } |
| 92 | 93 |
| 93 IncidentVector incidents_; | 94 IncidentVector incidents_; |
| 94 std::vector<std::string> invalid_keys_; | 95 std::vector<std::string> invalid_keys_; |
| 95 std::vector<std::string> external_validation_invalid_keys_; | 96 std::vector<std::string> external_validation_invalid_keys_; |
| 96 std::unique_ptr<prefs::mojom::TrackedPreferenceValidationDelegate> instance_; | 97 std::unique_ptr<prefs::mojom::TrackedPreferenceValidationDelegate> instance_; |
| 97 }; | 98 }; |
| 98 | 99 |
| 99 // Tests that a NULL value results in an incident with no value. | 100 // Tests that a NULL value results in an incident with no value. |
| 100 TEST_F(PreferenceValidationDelegateTest, NullValue) { | 101 TEST_F(PreferenceValidationDelegateTest, NullValue) { |
| 101 instance_->OnAtomicPreferenceValidation( | 102 instance_->OnAtomicPreferenceValidation(kPrefPath, NULL, ValueState::CLEARED, |
| 102 kPrefPath, NULL, PrefHashStoreTransaction::CLEARED, | 103 ValueState::UNSUPPORTED, |
| 103 PrefHashStoreTransaction::UNSUPPORTED, false /* is_personal */); | 104 false /* is_personal */); |
| 104 std::unique_ptr<safe_browsing::ClientIncidentReport_IncidentData> incident( | 105 std::unique_ptr<safe_browsing::ClientIncidentReport_IncidentData> incident( |
| 105 incidents_.back()->TakePayload()); | 106 incidents_.back()->TakePayload()); |
| 106 EXPECT_FALSE(incident->tracked_preference().has_atomic_value()); | 107 EXPECT_FALSE(incident->tracked_preference().has_atomic_value()); |
| 107 EXPECT_EQ( | 108 EXPECT_EQ( |
| 108 safe_browsing:: | 109 safe_browsing:: |
| 109 ClientIncidentReport_IncidentData_TrackedPreferenceIncident::CLEARED, | 110 ClientIncidentReport_IncidentData_TrackedPreferenceIncident::CLEARED, |
| 110 incident->tracked_preference().value_state()); | 111 incident->tracked_preference().value_state()); |
| 111 } | 112 } |
| 112 | 113 |
| 113 // Tests that all supported value types can be stringified into an incident. The | 114 // Tests that all supported value types can be stringified into an incident. The |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 } | 156 } |
| 156 return std::unique_ptr<Value>(); | 157 return std::unique_ptr<Value>(); |
| 157 } | 158 } |
| 158 | 159 |
| 159 base::Value::Type value_type_; | 160 base::Value::Type value_type_; |
| 160 const char* expected_value_; | 161 const char* expected_value_; |
| 161 }; | 162 }; |
| 162 | 163 |
| 163 TEST_P(PreferenceValidationDelegateValues, Value) { | 164 TEST_P(PreferenceValidationDelegateValues, Value) { |
| 164 instance_->OnAtomicPreferenceValidation( | 165 instance_->OnAtomicPreferenceValidation( |
| 165 kPrefPath, MakeValue(value_type_), PrefHashStoreTransaction::CLEARED, | 166 kPrefPath, MakeValue(value_type_), ValueState::CLEARED, |
| 166 PrefHashStoreTransaction::UNSUPPORTED, false /* is_personal */); | 167 ValueState::UNSUPPORTED, false /* is_personal */); |
| 167 ASSERT_EQ(1U, incidents_.size()); | 168 ASSERT_EQ(1U, incidents_.size()); |
| 168 std::unique_ptr<safe_browsing::ClientIncidentReport_IncidentData> incident( | 169 std::unique_ptr<safe_browsing::ClientIncidentReport_IncidentData> incident( |
| 169 incidents_.back()->TakePayload()); | 170 incidents_.back()->TakePayload()); |
| 170 EXPECT_EQ(std::string(expected_value_), | 171 EXPECT_EQ(std::string(expected_value_), |
| 171 incident->tracked_preference().atomic_value()); | 172 incident->tracked_preference().atomic_value()); |
| 172 } | 173 } |
| 173 | 174 |
| 174 INSTANTIATE_TEST_CASE_P( | 175 INSTANTIATE_TEST_CASE_P( |
| 175 Values, | 176 Values, |
| 176 PreferenceValidationDelegateValues, | 177 PreferenceValidationDelegateValues, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 190 const_cast<char*>("i have a spleen")), | 191 const_cast<char*>("i have a spleen")), |
| 191 std::tr1::make_tuple(base::Value::Type::DICTIONARY, | 192 std::tr1::make_tuple(base::Value::Type::DICTIONARY, |
| 192 const_cast<char*>("{\"forty-seven\":47,\"twenty-two\":22}")), | 193 const_cast<char*>("{\"forty-seven\":47,\"twenty-two\":22}")), |
| 193 std::tr1::make_tuple(base::Value::Type::LIST, | 194 std::tr1::make_tuple(base::Value::Type::LIST, |
| 194 const_cast<char*>("[22,47]")))); | 195 const_cast<char*>("[22,47]")))); |
| 195 | 196 |
| 196 // Tests that no incidents are reported for relevant combinations of ValueState. | 197 // Tests that no incidents are reported for relevant combinations of ValueState. |
| 197 class PreferenceValidationDelegateNoIncident | 198 class PreferenceValidationDelegateNoIncident |
| 198 : public PreferenceValidationDelegateTest, | 199 : public PreferenceValidationDelegateTest, |
| 199 public testing::WithParamInterface< | 200 public testing::WithParamInterface< |
| 200 std::tr1::tuple<PrefHashStoreTransaction::ValueState, | 201 std::tr1::tuple<ValueState, ValueState>> { |
| 201 PrefHashStoreTransaction::ValueState>> { | |
| 202 protected: | 202 protected: |
| 203 void SetUp() override { | 203 void SetUp() override { |
| 204 PreferenceValidationDelegateTest::SetUp(); | 204 PreferenceValidationDelegateTest::SetUp(); |
| 205 value_state_ = std::tr1::get<0>(GetParam()); | 205 value_state_ = std::tr1::get<0>(GetParam()); |
| 206 external_validation_value_state_ = std::tr1::get<1>(GetParam()); | 206 external_validation_value_state_ = std::tr1::get<1>(GetParam()); |
| 207 } | 207 } |
| 208 | 208 |
| 209 PrefHashStoreTransaction::ValueState value_state_; | 209 ValueState value_state_; |
| 210 PrefHashStoreTransaction::ValueState external_validation_value_state_; | 210 ValueState external_validation_value_state_; |
| 211 }; | 211 }; |
| 212 | 212 |
| 213 TEST_P(PreferenceValidationDelegateNoIncident, Atomic) { | 213 TEST_P(PreferenceValidationDelegateNoIncident, Atomic) { |
| 214 instance_->OnAtomicPreferenceValidation( | 214 instance_->OnAtomicPreferenceValidation( |
| 215 kPrefPath, base::Value::CreateNullValue(), value_state_, | 215 kPrefPath, base::Value::CreateNullValue(), value_state_, |
| 216 external_validation_value_state_, false /* is_personal */); | 216 external_validation_value_state_, false /* is_personal */); |
| 217 EXPECT_EQ(0U, incidents_.size()); | 217 EXPECT_EQ(0U, incidents_.size()); |
| 218 } | 218 } |
| 219 | 219 |
| 220 TEST_P(PreferenceValidationDelegateNoIncident, Split) { | 220 TEST_P(PreferenceValidationDelegateNoIncident, Split) { |
| 221 instance_->OnSplitPreferenceValidation( | 221 instance_->OnSplitPreferenceValidation( |
| 222 kPrefPath, invalid_keys_, external_validation_invalid_keys_, value_state_, | 222 kPrefPath, invalid_keys_, external_validation_invalid_keys_, value_state_, |
| 223 external_validation_value_state_, false /* is_personal */); | 223 external_validation_value_state_, false /* is_personal */); |
| 224 EXPECT_EQ(0U, incidents_.size()); | 224 EXPECT_EQ(0U, incidents_.size()); |
| 225 } | 225 } |
| 226 | 226 |
| 227 INSTANTIATE_TEST_CASE_P( | 227 INSTANTIATE_TEST_CASE_P( |
| 228 NoIncident, | 228 NoIncident, |
| 229 PreferenceValidationDelegateNoIncident, | 229 PreferenceValidationDelegateNoIncident, |
| 230 testing::Combine( | 230 testing::Combine(testing::Values(ValueState::UNCHANGED, |
| 231 testing::Values(PrefHashStoreTransaction::UNCHANGED, | 231 ValueState::SECURE_LEGACY, |
| 232 PrefHashStoreTransaction::SECURE_LEGACY, | 232 ValueState::TRUSTED_UNKNOWN_VALUE), |
| 233 PrefHashStoreTransaction::TRUSTED_UNKNOWN_VALUE), | 233 testing::Values(ValueState::UNCHANGED, |
| 234 testing::Values(PrefHashStoreTransaction::UNCHANGED, | 234 ValueState::UNSUPPORTED, |
| 235 PrefHashStoreTransaction::UNSUPPORTED, | 235 ValueState::UNTRUSTED_UNKNOWN_VALUE))); |
| 236 PrefHashStoreTransaction::UNTRUSTED_UNKNOWN_VALUE))); | |
| 237 | 236 |
| 238 // Tests that incidents are reported for relevant combinations of ValueState and | 237 // Tests that incidents are reported for relevant combinations of ValueState and |
| 239 // impersonal/personal. | 238 // impersonal/personal. |
| 240 class PreferenceValidationDelegateWithIncident | 239 class PreferenceValidationDelegateWithIncident |
| 241 : public PreferenceValidationDelegateTest, | 240 : public PreferenceValidationDelegateTest, |
| 242 public testing::WithParamInterface< | 241 public testing::WithParamInterface< |
| 243 std::tr1::tuple<PrefHashStoreTransaction::ValueState, | 242 std::tr1::tuple<ValueState, ValueState, bool>> { |
| 244 PrefHashStoreTransaction::ValueState, | |
| 245 bool>> { | |
| 246 protected: | 243 protected: |
| 247 void SetUp() override { | 244 void SetUp() override { |
| 248 PreferenceValidationDelegateTest::SetUp(); | 245 PreferenceValidationDelegateTest::SetUp(); |
| 249 value_state_ = std::tr1::get<0>(GetParam()); | 246 value_state_ = std::tr1::get<0>(GetParam()); |
| 250 external_validation_value_state_ = std::tr1::get<1>(GetParam()); | 247 external_validation_value_state_ = std::tr1::get<1>(GetParam()); |
| 251 is_personal_ = std::tr1::get<2>(GetParam()); | 248 is_personal_ = std::tr1::get<2>(GetParam()); |
| 252 } | 249 } |
| 253 | 250 |
| 254 PrefHashStoreTransaction::ValueState value_state_; | 251 ValueState value_state_; |
| 255 PrefHashStoreTransaction::ValueState external_validation_value_state_; | 252 ValueState external_validation_value_state_; |
| 256 bool is_personal_; | 253 bool is_personal_; |
| 257 }; | 254 }; |
| 258 | 255 |
| 259 TEST_P(PreferenceValidationDelegateWithIncident, Atomic) { | 256 TEST_P(PreferenceValidationDelegateWithIncident, Atomic) { |
| 260 instance_->OnAtomicPreferenceValidation( | 257 instance_->OnAtomicPreferenceValidation( |
| 261 kPrefPath, base::Value::CreateNullValue(), value_state_, | 258 kPrefPath, base::Value::CreateNullValue(), value_state_, |
| 262 external_validation_value_state_, is_personal_); | 259 external_validation_value_state_, is_personal_); |
| 263 ASSERT_EQ(1U, incidents_.size()); | 260 ASSERT_EQ(1U, incidents_.size()); |
| 264 std::unique_ptr<safe_browsing::ClientIncidentReport_IncidentData> incident( | 261 std::unique_ptr<safe_browsing::ClientIncidentReport_IncidentData> incident( |
| 265 incidents_.back()->TakePayload()); | 262 incidents_.back()->TakePayload()); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 287 ASSERT_EQ(1U, incidents_.size()); | 284 ASSERT_EQ(1U, incidents_.size()); |
| 288 std::unique_ptr<safe_browsing::ClientIncidentReport_IncidentData> incident( | 285 std::unique_ptr<safe_browsing::ClientIncidentReport_IncidentData> incident( |
| 289 incidents_.back()->TakePayload()); | 286 incidents_.back()->TakePayload()); |
| 290 EXPECT_TRUE(incident->has_tracked_preference()); | 287 EXPECT_TRUE(incident->has_tracked_preference()); |
| 291 const safe_browsing:: | 288 const safe_browsing:: |
| 292 ClientIncidentReport_IncidentData_TrackedPreferenceIncident& tp_incident = | 289 ClientIncidentReport_IncidentData_TrackedPreferenceIncident& tp_incident = |
| 293 incident->tracked_preference(); | 290 incident->tracked_preference(); |
| 294 EXPECT_EQ(kPrefPath, tp_incident.path()); | 291 EXPECT_EQ(kPrefPath, tp_incident.path()); |
| 295 EXPECT_FALSE(tp_incident.has_atomic_value()); | 292 EXPECT_FALSE(tp_incident.has_atomic_value()); |
| 296 if (!is_personal_) { | 293 if (!is_personal_) { |
| 297 if (value_state_ == PrefHashStoreTransaction::CLEARED || | 294 if (value_state_ == ValueState::CLEARED || |
| 298 value_state_ == PrefHashStoreTransaction::CHANGED || | 295 value_state_ == ValueState::CHANGED || |
| 299 value_state_ == PrefHashStoreTransaction::UNTRUSTED_UNKNOWN_VALUE) { | 296 value_state_ == ValueState::UNTRUSTED_UNKNOWN_VALUE) { |
| 300 ExpectKeysEquate(invalid_keys_, tp_incident.split_key()); | 297 ExpectKeysEquate(invalid_keys_, tp_incident.split_key()); |
| 301 } else { | 298 } else { |
| 302 ExpectKeysEquate(external_validation_invalid_keys_, | 299 ExpectKeysEquate(external_validation_invalid_keys_, |
| 303 tp_incident.split_key()); | 300 tp_incident.split_key()); |
| 304 } | 301 } |
| 305 } else { | 302 } else { |
| 306 EXPECT_EQ(0, tp_incident.split_key_size()); | 303 EXPECT_EQ(0, tp_incident.split_key_size()); |
| 307 } | 304 } |
| 308 EXPECT_TRUE(tp_incident.has_value_state()); | 305 EXPECT_TRUE(tp_incident.has_value_state()); |
| 309 ExpectValueStatesEquate(value_state_, external_validation_value_state_, | 306 ExpectValueStatesEquate(value_state_, external_validation_value_state_, |
| 310 tp_incident.value_state()); | 307 tp_incident.value_state()); |
| 311 } | 308 } |
| 312 | 309 |
| 313 INSTANTIATE_TEST_CASE_P( | 310 INSTANTIATE_TEST_CASE_P( |
| 314 WithIncident, | 311 WithIncident, |
| 315 PreferenceValidationDelegateWithIncident, | 312 PreferenceValidationDelegateWithIncident, |
| 316 testing::Combine( | 313 testing::Combine(testing::Values(ValueState::CLEARED, |
| 317 testing::Values(PrefHashStoreTransaction::CLEARED, | 314 ValueState::CHANGED, |
| 318 PrefHashStoreTransaction::CHANGED, | 315 ValueState::UNTRUSTED_UNKNOWN_VALUE), |
| 319 PrefHashStoreTransaction::UNTRUSTED_UNKNOWN_VALUE), | 316 testing::Values(ValueState::UNCHANGED, |
| 320 testing::Values(PrefHashStoreTransaction::UNCHANGED, | 317 ValueState::UNSUPPORTED, |
| 321 PrefHashStoreTransaction::UNSUPPORTED, | 318 ValueState::UNTRUSTED_UNKNOWN_VALUE), |
| 322 PrefHashStoreTransaction::UNTRUSTED_UNKNOWN_VALUE), | 319 testing::Bool())); |
| 323 testing::Bool())); | |
| 324 | 320 |
| 325 INSTANTIATE_TEST_CASE_P( | 321 INSTANTIATE_TEST_CASE_P( |
| 326 WithBypassIncident, | 322 WithBypassIncident, |
| 327 PreferenceValidationDelegateWithIncident, | 323 PreferenceValidationDelegateWithIncident, |
| 328 testing::Combine( | 324 testing::Combine(testing::Values(ValueState::UNCHANGED, |
| 329 testing::Values(PrefHashStoreTransaction::UNCHANGED, | 325 ValueState::SECURE_LEGACY, |
| 330 PrefHashStoreTransaction::SECURE_LEGACY, | 326 ValueState::TRUSTED_UNKNOWN_VALUE), |
| 331 PrefHashStoreTransaction::TRUSTED_UNKNOWN_VALUE), | 327 testing::Values(ValueState::CHANGED, ValueState::CLEARED), |
| 332 testing::Values(PrefHashStoreTransaction::CHANGED, | 328 testing::Bool())); |
| 333 PrefHashStoreTransaction::CLEARED), | |
| 334 testing::Bool())); | |
| 335 | 329 |
| 336 INSTANTIATE_TEST_CASE_P( | 330 INSTANTIATE_TEST_CASE_P( |
| 337 WithIncidentIgnoreBypass, | 331 WithIncidentIgnoreBypass, |
| 338 PreferenceValidationDelegateWithIncident, | 332 PreferenceValidationDelegateWithIncident, |
| 339 testing::Combine( | 333 testing::Combine(testing::Values(ValueState::CLEARED, |
| 340 testing::Values(PrefHashStoreTransaction::CLEARED, | 334 ValueState::CHANGED, |
| 341 PrefHashStoreTransaction::CHANGED, | 335 ValueState::UNTRUSTED_UNKNOWN_VALUE), |
| 342 PrefHashStoreTransaction::UNTRUSTED_UNKNOWN_VALUE), | 336 testing::Values(ValueState::CHANGED, ValueState::CLEARED), |
| 343 testing::Values(PrefHashStoreTransaction::CHANGED, | 337 testing::Bool())); |
| 344 PrefHashStoreTransaction::CLEARED), | |
| 345 testing::Bool())); | |
| OLD | NEW |