| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 EXPECT_EQ(entry.write_flags, flag_checker->GetLastFlagsAndClear()); | 323 EXPECT_EQ(entry.write_flags, flag_checker->GetLastFlagsAndClear()); |
| 324 | 324 |
| 325 prefs->ReportUserPrefChanged(entry.pref_name); | 325 prefs->ReportUserPrefChanged(entry.pref_name); |
| 326 EXPECT_TRUE(flag_checker->last_write_flags_set()); | 326 EXPECT_TRUE(flag_checker->last_write_flags_set()); |
| 327 EXPECT_EQ(entry.write_flags, flag_checker->GetLastFlagsAndClear()); | 327 EXPECT_EQ(entry.write_flags, flag_checker->GetLastFlagsAndClear()); |
| 328 | 328 |
| 329 prefs->ClearPref(entry.pref_name); | 329 prefs->ClearPref(entry.pref_name); |
| 330 EXPECT_TRUE(flag_checker->last_write_flags_set()); | 330 EXPECT_TRUE(flag_checker->last_write_flags_set()); |
| 331 EXPECT_EQ(entry.write_flags, flag_checker->GetLastFlagsAndClear()); | 331 EXPECT_EQ(entry.write_flags, flag_checker->GetLastFlagsAndClear()); |
| 332 | 332 |
| 333 prefs->SetUserPrefValue(entry.pref_name, new base::DictionaryValue()); | 333 prefs->SetUserPrefValue(entry.pref_name, |
| 334 base::MakeUnique<base::DictionaryValue>()); |
| 334 EXPECT_TRUE(flag_checker->last_write_flags_set()); | 335 EXPECT_TRUE(flag_checker->last_write_flags_set()); |
| 335 EXPECT_EQ(entry.write_flags, flag_checker->GetLastFlagsAndClear()); | 336 EXPECT_EQ(entry.write_flags, flag_checker->GetLastFlagsAndClear()); |
| 336 } | 337 } |
| 337 } | 338 } |
| 338 | 339 |
| 339 class PrefServiceSetValueTest : public testing::Test { | 340 class PrefServiceSetValueTest : public testing::Test { |
| 340 protected: | 341 protected: |
| 341 static const char kName[]; | 342 static const char kName[]; |
| 342 static const char kValue[]; | 343 static const char kValue[]; |
| 343 | 344 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 | 419 |
| 419 EXPECT_CALL(observer_, OnPreferenceChanged(_)).Times(0); | 420 EXPECT_CALL(observer_, OnPreferenceChanged(_)).Times(0); |
| 420 prefs_.Set(kName, new_value); | 421 prefs_.Set(kName, new_value); |
| 421 Mock::VerifyAndClearExpectations(&observer_); | 422 Mock::VerifyAndClearExpectations(&observer_); |
| 422 | 423 |
| 423 base::ListValue empty; | 424 base::ListValue empty; |
| 424 observer_.Expect(kName, &empty); | 425 observer_.Expect(kName, &empty); |
| 425 prefs_.Set(kName, empty); | 426 prefs_.Set(kName, empty); |
| 426 Mock::VerifyAndClearExpectations(&observer_); | 427 Mock::VerifyAndClearExpectations(&observer_); |
| 427 } | 428 } |
| OLD | NEW |