| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <set> | 5 #include <set> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/policy/configuration_policy_pref_store.h" | 10 #include "chrome/browser/policy/configuration_policy_pref_store.h" |
| 11 #include "chrome/browser/policy/dummy_configuration_policy_provider.h" | 11 #include "chrome/browser/policy/dummy_configuration_policy_provider.h" |
| 12 #include "chrome/browser/prefs/pref_model_associator.h" |
| 12 #include "chrome/browser/prefs/pref_notifier.h" | 13 #include "chrome/browser/prefs/pref_notifier.h" |
| 13 #include "chrome/browser/prefs/pref_value_store.h" | 14 #include "chrome/browser/prefs/pref_value_store.h" |
| 14 #include "chrome/browser/prefs/testing_pref_store.h" | 15 #include "chrome/browser/prefs/testing_pref_store.h" |
| 15 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 16 #include "content/browser/browser_thread.h" | 17 #include "content/browser/browser_thread.h" |
| 17 #include "testing/gmock/include/gmock/gmock.h" | 18 #include "testing/gmock/include/gmock/gmock.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 20 |
| 20 using testing::_; | 21 using testing::_; |
| 21 using testing::AnyNumber; | 22 using testing::AnyNumber; |
| 22 using testing::Mock; | 23 using testing::Mock; |
| 23 using testing::Invoke; | 24 using testing::Invoke; |
| 24 | 25 |
| 25 namespace { | 26 namespace { |
| 26 | 27 |
| 27 // Allows to capture pref notifications through gmock. | 28 // Allows to capture pref notifications through gmock. |
| 28 class MockPrefNotifier : public PrefNotifier { | 29 class MockPrefNotifier : public PrefNotifier { |
| 29 public: | 30 public: |
| 30 MOCK_METHOD1(OnPreferenceChanged, void(const std::string&)); | 31 MOCK_METHOD1(OnPreferenceChanged, void(const std::string&)); |
| 31 MOCK_METHOD0(OnInitializationCompleted, void()); | 32 MOCK_METHOD0(OnInitializationCompleted, void()); |
| 32 }; | 33 }; |
| 33 | 34 |
| 35 // Allows to capture sync model associator interaction. |
| 36 class MockPrefModelAssociator : public PrefModelAssociator { |
| 37 public: |
| 38 MOCK_METHOD1(ProcessPrefChange, void(const std::string&)); |
| 39 }; |
| 40 |
| 34 } // namespace | 41 } // namespace |
| 35 | 42 |
| 36 // Names of the preferences used in this test. | 43 // Names of the preferences used in this test. |
| 37 namespace prefs { | 44 namespace prefs { |
| 38 const char kManagedPlatformPref[] = "this.pref.managed_platform"; | 45 const char kManagedPlatformPref[] = "this.pref.managed_platform"; |
| 39 const char kManagedCloudPref[] = "this.pref.managed_cloud"; | 46 const char kManagedCloudPref[] = "this.pref.managed_cloud"; |
| 40 const char kCommandLinePref[] = "this.pref.command_line"; | 47 const char kCommandLinePref[] = "this.pref.command_line"; |
| 41 const char kExtensionPref[] = "this.pref.extension"; | 48 const char kExtensionPref[] = "this.pref.extension"; |
| 42 const char kUserPref[] = "this.pref.user"; | 49 const char kUserPref[] = "this.pref.user"; |
| 43 const char kRecommendedPlatformPref[] = "this.pref.recommended_platform"; | 50 const char kRecommendedPlatformPref[] = "this.pref.recommended_platform"; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 virtual void SetUp() { | 121 virtual void SetUp() { |
| 115 // Create TestingPrefStores. | 122 // Create TestingPrefStores. |
| 116 CreateManagedPlatformPrefs(); | 123 CreateManagedPlatformPrefs(); |
| 117 CreateManagedCloudPrefs(); | 124 CreateManagedCloudPrefs(); |
| 118 CreateExtensionPrefs(); | 125 CreateExtensionPrefs(); |
| 119 CreateCommandLinePrefs(); | 126 CreateCommandLinePrefs(); |
| 120 CreateUserPrefs(); | 127 CreateUserPrefs(); |
| 121 CreateRecommendedPlatformPrefs(); | 128 CreateRecommendedPlatformPrefs(); |
| 122 CreateRecommendedCloudPrefs(); | 129 CreateRecommendedCloudPrefs(); |
| 123 CreateDefaultPrefs(); | 130 CreateDefaultPrefs(); |
| 131 sync_associator_.reset(new MockPrefModelAssociator()); |
| 124 | 132 |
| 125 // Create a fresh PrefValueStore. | 133 // Create a fresh PrefValueStore. |
| 126 pref_value_store_.reset(new PrefValueStore( | 134 pref_value_store_.reset(new PrefValueStore( |
| 127 managed_platform_pref_store_, | 135 managed_platform_pref_store_, |
| 128 managed_cloud_pref_store_, | 136 managed_cloud_pref_store_, |
| 129 extension_pref_store_, | 137 extension_pref_store_, |
| 130 command_line_pref_store_, | 138 command_line_pref_store_, |
| 131 user_pref_store_, | 139 user_pref_store_, |
| 132 recommended_platform_pref_store_, | 140 recommended_platform_pref_store_, |
| 133 recommended_cloud_pref_store_, | 141 recommended_cloud_pref_store_, |
| 134 default_pref_store_, | 142 default_pref_store_, |
| 143 sync_associator_.get(), |
| 135 &pref_notifier_)); | 144 &pref_notifier_)); |
| 136 } | 145 } |
| 137 | 146 |
| 138 void CreateManagedPlatformPrefs() { | 147 void CreateManagedPlatformPrefs() { |
| 139 managed_platform_pref_store_ = new TestingPrefStore; | 148 managed_platform_pref_store_ = new TestingPrefStore; |
| 140 managed_platform_pref_store_->SetString( | 149 managed_platform_pref_store_->SetString( |
| 141 prefs::kManagedPlatformPref, | 150 prefs::kManagedPlatformPref, |
| 142 managed_platform_pref::kManagedPlatformValue); | 151 managed_platform_pref::kManagedPlatformValue); |
| 143 } | 152 } |
| 144 | 153 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 default_pref::kRecommendedPlatformValue); | 278 default_pref::kRecommendedPlatformValue); |
| 270 default_pref_store_->SetString( | 279 default_pref_store_->SetString( |
| 271 prefs::kRecommendedCloudPref, | 280 prefs::kRecommendedCloudPref, |
| 272 default_pref::kRecommendedCloudValue); | 281 default_pref::kRecommendedCloudValue); |
| 273 default_pref_store_->SetString( | 282 default_pref_store_->SetString( |
| 274 prefs::kDefaultPref, | 283 prefs::kDefaultPref, |
| 275 default_pref::kDefaultValue); | 284 default_pref::kDefaultValue); |
| 276 } | 285 } |
| 277 | 286 |
| 278 MockPrefNotifier pref_notifier_; | 287 MockPrefNotifier pref_notifier_; |
| 288 scoped_ptr<MockPrefModelAssociator> sync_associator_; |
| 279 scoped_ptr<PrefValueStore> pref_value_store_; | 289 scoped_ptr<PrefValueStore> pref_value_store_; |
| 280 | 290 |
| 281 scoped_refptr<TestingPrefStore> managed_platform_pref_store_; | 291 scoped_refptr<TestingPrefStore> managed_platform_pref_store_; |
| 282 scoped_refptr<TestingPrefStore> managed_cloud_pref_store_; | 292 scoped_refptr<TestingPrefStore> managed_cloud_pref_store_; |
| 283 scoped_refptr<TestingPrefStore> extension_pref_store_; | 293 scoped_refptr<TestingPrefStore> extension_pref_store_; |
| 284 scoped_refptr<TestingPrefStore> command_line_pref_store_; | 294 scoped_refptr<TestingPrefStore> command_line_pref_store_; |
| 285 scoped_refptr<TestingPrefStore> user_pref_store_; | 295 scoped_refptr<TestingPrefStore> user_pref_store_; |
| 286 scoped_refptr<TestingPrefStore> recommended_platform_pref_store_; | 296 scoped_refptr<TestingPrefStore> recommended_platform_pref_store_; |
| 287 scoped_refptr<TestingPrefStore> recommended_cloud_pref_store_; | 297 scoped_refptr<TestingPrefStore> recommended_cloud_pref_store_; |
| 288 scoped_refptr<TestingPrefStore> default_pref_store_; | 298 scoped_refptr<TestingPrefStore> default_pref_store_; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 FundamentalValue tmp_dummy_value(true); | 368 FundamentalValue tmp_dummy_value(true); |
| 359 value = &tmp_dummy_value; | 369 value = &tmp_dummy_value; |
| 360 ASSERT_FALSE(pref_value_store_->GetValue(prefs::kMissingPref, | 370 ASSERT_FALSE(pref_value_store_->GetValue(prefs::kMissingPref, |
| 361 Value::TYPE_STRING, &value)); | 371 Value::TYPE_STRING, &value)); |
| 362 ASSERT_TRUE(value == NULL); | 372 ASSERT_TRUE(value == NULL); |
| 363 } | 373 } |
| 364 | 374 |
| 365 TEST_F(PrefValueStoreTest, PrefChanges) { | 375 TEST_F(PrefValueStoreTest, PrefChanges) { |
| 366 // Check pref controlled by highest-priority store. | 376 // Check pref controlled by highest-priority store. |
| 367 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kManagedPlatformPref)); | 377 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kManagedPlatformPref)); |
| 378 EXPECT_CALL(*sync_associator_, |
| 379 ProcessPrefChange(prefs::kManagedPlatformPref)); |
| 368 managed_platform_pref_store_->NotifyPrefValueChanged( | 380 managed_platform_pref_store_->NotifyPrefValueChanged( |
| 369 prefs::kManagedPlatformPref); | 381 prefs::kManagedPlatformPref); |
| 370 Mock::VerifyAndClearExpectations(&pref_notifier_); | 382 Mock::VerifyAndClearExpectations(&pref_notifier_); |
| 383 Mock::VerifyAndClearExpectations(sync_associator_.get()); |
| 371 | 384 |
| 372 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(_)).Times(0); | 385 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(_)).Times(0); |
| 386 EXPECT_CALL(*sync_associator_, ProcessPrefChange(_)).Times(0); |
| 373 managed_cloud_pref_store_->NotifyPrefValueChanged( | 387 managed_cloud_pref_store_->NotifyPrefValueChanged( |
| 374 prefs::kManagedPlatformPref); | 388 prefs::kManagedPlatformPref); |
| 375 extension_pref_store_->NotifyPrefValueChanged( | 389 extension_pref_store_->NotifyPrefValueChanged( |
| 376 prefs::kManagedPlatformPref); | 390 prefs::kManagedPlatformPref); |
| 377 command_line_pref_store_->NotifyPrefValueChanged( | 391 command_line_pref_store_->NotifyPrefValueChanged( |
| 378 prefs::kManagedPlatformPref); | 392 prefs::kManagedPlatformPref); |
| 379 user_pref_store_->NotifyPrefValueChanged( | 393 user_pref_store_->NotifyPrefValueChanged( |
| 380 prefs::kManagedPlatformPref); | 394 prefs::kManagedPlatformPref); |
| 381 recommended_platform_pref_store_->NotifyPrefValueChanged( | 395 recommended_platform_pref_store_->NotifyPrefValueChanged( |
| 382 prefs::kManagedPlatformPref); | 396 prefs::kManagedPlatformPref); |
| 383 recommended_cloud_pref_store_->NotifyPrefValueChanged( | 397 recommended_cloud_pref_store_->NotifyPrefValueChanged( |
| 384 prefs::kManagedPlatformPref); | 398 prefs::kManagedPlatformPref); |
| 385 default_pref_store_->NotifyPrefValueChanged( | 399 default_pref_store_->NotifyPrefValueChanged( |
| 386 prefs::kManagedPlatformPref); | 400 prefs::kManagedPlatformPref); |
| 387 Mock::VerifyAndClearExpectations(&pref_notifier_); | 401 Mock::VerifyAndClearExpectations(&pref_notifier_); |
| 402 Mock::VerifyAndClearExpectations(sync_associator_.get()); |
| 388 | 403 |
| 389 // Check pref controlled by user store. | 404 // Check pref controlled by user store. |
| 390 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kUserPref)); | 405 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kUserPref)); |
| 406 EXPECT_CALL(*sync_associator_, ProcessPrefChange(prefs::kUserPref)); |
| 391 managed_platform_pref_store_->NotifyPrefValueChanged(prefs::kUserPref); | 407 managed_platform_pref_store_->NotifyPrefValueChanged(prefs::kUserPref); |
| 392 Mock::VerifyAndClearExpectations(&pref_notifier_); | 408 Mock::VerifyAndClearExpectations(&pref_notifier_); |
| 409 Mock::VerifyAndClearExpectations(sync_associator_.get()); |
| 393 | 410 |
| 394 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kUserPref)); | 411 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kUserPref)); |
| 412 EXPECT_CALL(*sync_associator_, ProcessPrefChange(prefs::kUserPref)); |
| 395 managed_cloud_pref_store_->NotifyPrefValueChanged(prefs::kUserPref); | 413 managed_cloud_pref_store_->NotifyPrefValueChanged(prefs::kUserPref); |
| 396 Mock::VerifyAndClearExpectations(&pref_notifier_); | 414 Mock::VerifyAndClearExpectations(&pref_notifier_); |
| 415 Mock::VerifyAndClearExpectations(sync_associator_.get()); |
| 397 | 416 |
| 398 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kUserPref)); | 417 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kUserPref)); |
| 418 EXPECT_CALL(*sync_associator_, ProcessPrefChange(prefs::kUserPref)); |
| 399 extension_pref_store_->NotifyPrefValueChanged(prefs::kUserPref); | 419 extension_pref_store_->NotifyPrefValueChanged(prefs::kUserPref); |
| 400 Mock::VerifyAndClearExpectations(&pref_notifier_); | 420 Mock::VerifyAndClearExpectations(&pref_notifier_); |
| 421 Mock::VerifyAndClearExpectations(sync_associator_.get()); |
| 401 | 422 |
| 402 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kUserPref)); | 423 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kUserPref)); |
| 424 EXPECT_CALL(*sync_associator_, ProcessPrefChange(prefs::kUserPref)); |
| 403 command_line_pref_store_->NotifyPrefValueChanged(prefs::kUserPref); | 425 command_line_pref_store_->NotifyPrefValueChanged(prefs::kUserPref); |
| 404 Mock::VerifyAndClearExpectations(&pref_notifier_); | 426 Mock::VerifyAndClearExpectations(&pref_notifier_); |
| 427 Mock::VerifyAndClearExpectations(sync_associator_.get()); |
| 405 | 428 |
| 406 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kUserPref)); | 429 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kUserPref)); |
| 430 EXPECT_CALL(*sync_associator_, ProcessPrefChange(prefs::kUserPref)); |
| 407 user_pref_store_->NotifyPrefValueChanged(prefs::kUserPref); | 431 user_pref_store_->NotifyPrefValueChanged(prefs::kUserPref); |
| 408 Mock::VerifyAndClearExpectations(&pref_notifier_); | 432 Mock::VerifyAndClearExpectations(&pref_notifier_); |
| 433 Mock::VerifyAndClearExpectations(sync_associator_.get()); |
| 409 | 434 |
| 410 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(_)).Times(0); | 435 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(_)).Times(0); |
| 436 EXPECT_CALL(*sync_associator_, ProcessPrefChange(_)).Times(0); |
| 411 recommended_platform_pref_store_->NotifyPrefValueChanged( | 437 recommended_platform_pref_store_->NotifyPrefValueChanged( |
| 412 prefs::kUserPref); | 438 prefs::kUserPref); |
| 413 recommended_cloud_pref_store_->NotifyPrefValueChanged( | 439 recommended_cloud_pref_store_->NotifyPrefValueChanged( |
| 414 prefs::kUserPref); | 440 prefs::kUserPref); |
| 415 default_pref_store_->NotifyPrefValueChanged( | 441 default_pref_store_->NotifyPrefValueChanged( |
| 416 prefs::kUserPref); | 442 prefs::kUserPref); |
| 417 Mock::VerifyAndClearExpectations(&pref_notifier_); | 443 Mock::VerifyAndClearExpectations(&pref_notifier_); |
| 444 Mock::VerifyAndClearExpectations(sync_associator_.get()); |
| 418 | 445 |
| 419 // Check pref controlled by default-pref store. | 446 // Check pref controlled by default-pref store. |
| 420 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kDefaultPref)); | 447 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kDefaultPref)); |
| 448 EXPECT_CALL(*sync_associator_, ProcessPrefChange(prefs::kDefaultPref)); |
| 421 managed_platform_pref_store_->NotifyPrefValueChanged(prefs::kDefaultPref); | 449 managed_platform_pref_store_->NotifyPrefValueChanged(prefs::kDefaultPref); |
| 422 Mock::VerifyAndClearExpectations(&pref_notifier_); | 450 Mock::VerifyAndClearExpectations(&pref_notifier_); |
| 451 Mock::VerifyAndClearExpectations(sync_associator_.get()); |
| 423 | 452 |
| 424 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kDefaultPref)); | 453 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kDefaultPref)); |
| 454 EXPECT_CALL(*sync_associator_, ProcessPrefChange(prefs::kDefaultPref)); |
| 425 managed_cloud_pref_store_->NotifyPrefValueChanged(prefs::kDefaultPref); | 455 managed_cloud_pref_store_->NotifyPrefValueChanged(prefs::kDefaultPref); |
| 426 Mock::VerifyAndClearExpectations(&pref_notifier_); | 456 Mock::VerifyAndClearExpectations(&pref_notifier_); |
| 457 Mock::VerifyAndClearExpectations(sync_associator_.get()); |
| 427 | 458 |
| 428 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kDefaultPref)); | 459 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kDefaultPref)); |
| 460 EXPECT_CALL(*sync_associator_, ProcessPrefChange(prefs::kDefaultPref)); |
| 429 extension_pref_store_->NotifyPrefValueChanged(prefs::kDefaultPref); | 461 extension_pref_store_->NotifyPrefValueChanged(prefs::kDefaultPref); |
| 430 Mock::VerifyAndClearExpectations(&pref_notifier_); | 462 Mock::VerifyAndClearExpectations(&pref_notifier_); |
| 463 Mock::VerifyAndClearExpectations(sync_associator_.get()); |
| 431 | 464 |
| 432 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kDefaultPref)); | 465 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kDefaultPref)); |
| 466 EXPECT_CALL(*sync_associator_, ProcessPrefChange(prefs::kDefaultPref)); |
| 433 command_line_pref_store_->NotifyPrefValueChanged(prefs::kDefaultPref); | 467 command_line_pref_store_->NotifyPrefValueChanged(prefs::kDefaultPref); |
| 434 Mock::VerifyAndClearExpectations(&pref_notifier_); | 468 Mock::VerifyAndClearExpectations(&pref_notifier_); |
| 469 Mock::VerifyAndClearExpectations(sync_associator_.get()); |
| 435 | 470 |
| 436 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kDefaultPref)); | 471 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kDefaultPref)); |
| 472 EXPECT_CALL(*sync_associator_, ProcessPrefChange(prefs::kDefaultPref)); |
| 437 user_pref_store_->NotifyPrefValueChanged(prefs::kDefaultPref); | 473 user_pref_store_->NotifyPrefValueChanged(prefs::kDefaultPref); |
| 438 Mock::VerifyAndClearExpectations(&pref_notifier_); | 474 Mock::VerifyAndClearExpectations(&pref_notifier_); |
| 475 Mock::VerifyAndClearExpectations(sync_associator_.get()); |
| 439 | 476 |
| 440 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kDefaultPref)); | 477 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kDefaultPref)); |
| 478 EXPECT_CALL(*sync_associator_, ProcessPrefChange(prefs::kDefaultPref)); |
| 441 recommended_platform_pref_store_->NotifyPrefValueChanged(prefs::kDefaultPref); | 479 recommended_platform_pref_store_->NotifyPrefValueChanged(prefs::kDefaultPref); |
| 442 Mock::VerifyAndClearExpectations(&pref_notifier_); | 480 Mock::VerifyAndClearExpectations(&pref_notifier_); |
| 481 Mock::VerifyAndClearExpectations(sync_associator_.get()); |
| 443 | 482 |
| 444 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kDefaultPref)); | 483 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kDefaultPref)); |
| 484 EXPECT_CALL(*sync_associator_, ProcessPrefChange(prefs::kDefaultPref)); |
| 445 recommended_cloud_pref_store_->NotifyPrefValueChanged(prefs::kDefaultPref); | 485 recommended_cloud_pref_store_->NotifyPrefValueChanged(prefs::kDefaultPref); |
| 446 Mock::VerifyAndClearExpectations(&pref_notifier_); | 486 Mock::VerifyAndClearExpectations(&pref_notifier_); |
| 487 Mock::VerifyAndClearExpectations(sync_associator_.get()); |
| 447 | 488 |
| 448 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kDefaultPref)); | 489 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(prefs::kDefaultPref)); |
| 490 EXPECT_CALL(*sync_associator_, ProcessPrefChange(prefs::kDefaultPref)); |
| 449 default_pref_store_->NotifyPrefValueChanged(prefs::kDefaultPref); | 491 default_pref_store_->NotifyPrefValueChanged(prefs::kDefaultPref); |
| 450 Mock::VerifyAndClearExpectations(&pref_notifier_); | 492 Mock::VerifyAndClearExpectations(&pref_notifier_); |
| 493 Mock::VerifyAndClearExpectations(sync_associator_.get()); |
| 451 } | 494 } |
| 452 | 495 |
| 453 TEST_F(PrefValueStoreTest, OnInitializationCompleted) { | 496 TEST_F(PrefValueStoreTest, OnInitializationCompleted) { |
| 454 EXPECT_CALL(pref_notifier_, OnInitializationCompleted()).Times(0); | 497 EXPECT_CALL(pref_notifier_, OnInitializationCompleted()).Times(0); |
| 455 managed_platform_pref_store_->SetInitializationCompleted(); | 498 managed_platform_pref_store_->SetInitializationCompleted(); |
| 456 managed_cloud_pref_store_->SetInitializationCompleted(); | 499 managed_cloud_pref_store_->SetInitializationCompleted(); |
| 457 extension_pref_store_->SetInitializationCompleted(); | 500 extension_pref_store_->SetInitializationCompleted(); |
| 458 command_line_pref_store_->SetInitializationCompleted(); | 501 command_line_pref_store_->SetInitializationCompleted(); |
| 459 recommended_platform_pref_store_->SetInitializationCompleted(); | 502 recommended_platform_pref_store_->SetInitializationCompleted(); |
| 460 recommended_cloud_pref_store_->SetInitializationCompleted(); | 503 recommended_cloud_pref_store_->SetInitializationCompleted(); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 prefs::kUserPref)); | 670 prefs::kUserPref)); |
| 628 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable( | 671 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable( |
| 629 prefs::kRecommendedPlatformPref)); | 672 prefs::kRecommendedPlatformPref)); |
| 630 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable( | 673 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable( |
| 631 prefs::kRecommendedCloudPref)); | 674 prefs::kRecommendedCloudPref)); |
| 632 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable( | 675 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable( |
| 633 prefs::kDefaultPref)); | 676 prefs::kDefaultPref)); |
| 634 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable( | 677 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable( |
| 635 prefs::kMissingPref)); | 678 prefs::kMissingPref)); |
| 636 } | 679 } |
| OLD | NEW |