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 "components/sync_driver/sync_prefs.h" | 5 #include "components/sync_driver/sync_prefs.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/prefs/pref_notifier_impl.h" | 9 #include "base/prefs/pref_notifier_impl.h" |
10 #include "base/prefs/pref_value_store.h" | 10 #include "base/prefs/pref_value_store.h" |
11 #include "base/prefs/testing_pref_service.h" | 11 #include "base/prefs/testing_pref_service.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "components/pref_registry/testing_pref_service_syncable.h" | 13 #include "components/pref_registry/testing_pref_service_syncable.h" |
14 #include "components/sync_driver/pref_names.h" | 14 #include "components/sync_driver/pref_names.h" |
15 #include "sync/internal_api/public/base/model_type.h" | 15 #include "sync/internal_api/public/base/model_type.h" |
16 #include "testing/gmock/include/gmock/gmock.h" | 16 #include "testing/gmock/include/gmock/gmock.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 | 18 |
19 namespace sync_driver { | 19 namespace sync_driver { |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 using ::testing::InSequence; | 23 using ::testing::InSequence; |
24 using ::testing::StrictMock; | 24 using ::testing::StrictMock; |
25 | 25 |
26 class SyncPrefsTest : public testing::Test { | 26 class SyncPrefsTest : public testing::Test { |
27 protected: | 27 protected: |
28 virtual void SetUp() override { | 28 void SetUp() override { |
29 SyncPrefs::RegisterProfilePrefs(pref_service_.registry()); | 29 SyncPrefs::RegisterProfilePrefs(pref_service_.registry()); |
30 } | 30 } |
31 | 31 |
32 user_prefs::TestingPrefServiceSyncable pref_service_; | 32 user_prefs::TestingPrefServiceSyncable pref_service_; |
33 | 33 |
34 private: | 34 private: |
35 base::MessageLoop loop_; | 35 base::MessageLoop loop_; |
36 }; | 36 }; |
37 | 37 |
38 TEST_F(SyncPrefsTest, Basic) { | 38 TEST_F(SyncPrefsTest, Basic) { |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 sync_prefs.ClearPreferences(); | 228 sync_prefs.ClearPreferences(); |
229 | 229 |
230 EXPECT_FALSE(sync_prefs.HasSyncSetupCompleted()); | 230 EXPECT_FALSE(sync_prefs.HasSyncSetupCompleted()); |
231 EXPECT_EQ(base::Time(), sync_prefs.GetLastSyncedTime()); | 231 EXPECT_EQ(base::Time(), sync_prefs.GetLastSyncedTime()); |
232 EXPECT_TRUE(sync_prefs.GetEncryptionBootstrapToken().empty()); | 232 EXPECT_TRUE(sync_prefs.GetEncryptionBootstrapToken().empty()); |
233 } | 233 } |
234 | 234 |
235 } // namespace | 235 } // namespace |
236 | 236 |
237 } // namespace sync_driver | 237 } // namespace sync_driver |
OLD | NEW |