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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/callback.h" | 6 #include "base/callback.h" |
7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/prefs/testing_pref_store.h" | 8 #include "base/prefs/testing_pref_store.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "chrome/browser/supervised_user/supervised_user_settings_service.h" | 10 #include "chrome/browser/supervised_user/supervised_user_settings_service.h" |
11 #include "sync/api/fake_sync_change_processor.h" | 11 #include "sync/api/fake_sync_change_processor.h" |
12 #include "sync/api/sync_change.h" | 12 #include "sync/api/sync_change.h" |
13 #include "sync/api/sync_change_processor_wrapper_for_test.h" | 13 #include "sync/api/sync_change_processor_wrapper_for_test.h" |
14 #include "sync/api/sync_error_factory_mock.h" | 14 #include "sync/api/sync_error_factory_mock.h" |
15 #include "sync/protocol/sync.pb.h" | 15 #include "sync/protocol/sync.pb.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 class MockSyncErrorFactory : public syncer::SyncErrorFactory { | 20 class MockSyncErrorFactory : public syncer::SyncErrorFactory { |
21 public: | 21 public: |
22 explicit MockSyncErrorFactory(syncer::ModelType type); | 22 explicit MockSyncErrorFactory(syncer::ModelType type); |
23 virtual ~MockSyncErrorFactory(); | 23 ~MockSyncErrorFactory() override; |
24 | 24 |
25 // SyncErrorFactory implementation: | 25 // SyncErrorFactory implementation: |
26 virtual syncer::SyncError CreateAndUploadError( | 26 syncer::SyncError CreateAndUploadError( |
27 const tracked_objects::Location& location, | 27 const tracked_objects::Location& location, |
28 const std::string& message) override; | 28 const std::string& message) override; |
29 | 29 |
30 private: | 30 private: |
31 syncer::ModelType type_; | 31 syncer::ModelType type_; |
32 | 32 |
33 DISALLOW_COPY_AND_ASSIGN(MockSyncErrorFactory); | 33 DISALLOW_COPY_AND_ASSIGN(MockSyncErrorFactory); |
34 }; | 34 }; |
35 | 35 |
36 MockSyncErrorFactory::MockSyncErrorFactory(syncer::ModelType type) | 36 MockSyncErrorFactory::MockSyncErrorFactory(syncer::ModelType type) |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 // The uploaded items should not show up as settings. | 282 // The uploaded items should not show up as settings. |
283 const base::Value* value = NULL; | 283 const base::Value* value = NULL; |
284 EXPECT_FALSE(settings_->GetWithoutPathExpansion(kAtomicItemName, &value)); | 284 EXPECT_FALSE(settings_->GetWithoutPathExpansion(kAtomicItemName, &value)); |
285 EXPECT_FALSE(settings_->GetWithoutPathExpansion(kSplitItemName, &value)); | 285 EXPECT_FALSE(settings_->GetWithoutPathExpansion(kSplitItemName, &value)); |
286 | 286 |
287 // Restarting sync should not create any new changes. | 287 // Restarting sync should not create any new changes. |
288 settings_service_.StopSyncing(syncer::SUPERVISED_USER_SETTINGS); | 288 settings_service_.StopSyncing(syncer::SUPERVISED_USER_SETTINGS); |
289 StartSyncing(sync_data); | 289 StartSyncing(sync_data); |
290 ASSERT_EQ(0u, sync_processor_->changes().size()); | 290 ASSERT_EQ(0u, sync_processor_->changes().size()); |
291 } | 291 } |
OLD | NEW |