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/prefs/profile_pref_store_manager.h" | 5 #include "chrome/browser/prefs/profile_pref_store_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 void OnResetOnLoad() override { | 402 void OnResetOnLoad() override { |
403 // As-is |reset_recorded_| is only designed to remember a single reset, make | 403 // As-is |reset_recorded_| is only designed to remember a single reset, make |
404 // sure none was previously recorded (or that ClearResetRecorded() was | 404 // sure none was previously recorded (or that ClearResetRecorded() was |
405 // called). | 405 // called). |
406 EXPECT_FALSE(reset_recorded_); | 406 EXPECT_FALSE(reset_recorded_); |
407 reset_recorded_ = true; | 407 reset_recorded_ = true; |
408 } | 408 } |
409 | 409 |
410 void BindInterface(const std::string& interface_name, | 410 void BindInterface(const std::string& interface_name, |
411 mojo::ScopedMessagePipeHandle handle) { | 411 mojo::ScopedMessagePipeHandle handle) { |
412 service_manager::ServiceInfo source( | 412 service_manager::BindSourceInfo source( |
413 service_manager::Identity(content::mojom::kBrowserServiceName, | 413 service_manager::Identity(content::mojom::kBrowserServiceName, |
414 service_manager::mojom::kRootUserID), | 414 service_manager::mojom::kRootUserID), |
415 service_manager::InterfaceProviderSpecMap()); | 415 service_manager::CapabilitySet()); |
416 static_cast<service_manager::mojom::Service*>(pref_service_context_.get()) | 416 static_cast<service_manager::mojom::Service*>(pref_service_context_.get()) |
417 ->OnBindInterface(source, interface_name, std::move(handle), | 417 ->OnBindInterface(source, interface_name, std::move(handle), |
418 base::Bind(&base::DoNothing)); | 418 base::Bind(&base::DoNothing)); |
419 } | 419 } |
420 | 420 |
421 base::test::ScopedFeatureList feature_list_; | 421 base::test::ScopedFeatureList feature_list_; |
422 bool reset_recorded_; | 422 bool reset_recorded_; |
423 std::unique_ptr<base::SequencedWorkerPoolOwner> worker_pool_; | 423 std::unique_ptr<base::SequencedWorkerPoolOwner> worker_pool_; |
424 std::unique_ptr<service_manager::ServiceContext> pref_service_context_; | 424 std::unique_ptr<service_manager::ServiceContext> pref_service_context_; |
425 std::unique_ptr<service_manager::Connector> connector_; | 425 std::unique_ptr<service_manager::Connector> connector_; |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 LoadExistingPrefs(); | 628 LoadExistingPrefs(); |
629 ExpectStringValueEquals(kProtectedAtomic, kGoodbyeWorld); | 629 ExpectStringValueEquals(kProtectedAtomic, kGoodbyeWorld); |
630 VerifyResetRecorded(false); | 630 VerifyResetRecorded(false); |
631 } | 631 } |
632 | 632 |
633 // The parameter controls whether the user pref store is created within a | 633 // The parameter controls whether the user pref store is created within a |
634 // service. | 634 // service. |
635 INSTANTIATE_TEST_CASE_P(ProfilePrefStoreManagerTest, | 635 INSTANTIATE_TEST_CASE_P(ProfilePrefStoreManagerTest, |
636 ProfilePrefStoreManagerTest, | 636 ProfilePrefStoreManagerTest, |
637 testing::Bool()); | 637 testing::Bool()); |
OLD | NEW |