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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "chrome/browser/supervised_user/supervised_user_shared_settings_service
.h" | 10 #include "chrome/browser/supervised_user/supervised_user_shared_settings_service
.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 using syncer::SyncDataList; | 31 using syncer::SyncDataList; |
32 using syncer::SyncError; | 32 using syncer::SyncError; |
33 using syncer::SyncErrorFactory; | 33 using syncer::SyncErrorFactory; |
34 using syncer::SyncMergeResult; | 34 using syncer::SyncMergeResult; |
35 | 35 |
36 namespace { | 36 namespace { |
37 | 37 |
38 class MockSyncErrorFactory : public syncer::SyncErrorFactory { | 38 class MockSyncErrorFactory : public syncer::SyncErrorFactory { |
39 public: | 39 public: |
40 explicit MockSyncErrorFactory(syncer::ModelType type); | 40 explicit MockSyncErrorFactory(syncer::ModelType type); |
41 virtual ~MockSyncErrorFactory(); | 41 ~MockSyncErrorFactory() override; |
42 | 42 |
43 // SyncErrorFactory implementation: | 43 // SyncErrorFactory implementation: |
44 virtual syncer::SyncError CreateAndUploadError( | 44 syncer::SyncError CreateAndUploadError( |
45 const tracked_objects::Location& location, | 45 const tracked_objects::Location& location, |
46 const std::string& message) override; | 46 const std::string& message) override; |
47 | 47 |
48 private: | 48 private: |
49 syncer::ModelType type_; | 49 syncer::ModelType type_; |
50 | 50 |
51 DISALLOW_COPY_AND_ASSIGN(MockSyncErrorFactory); | 51 DISALLOW_COPY_AND_ASSIGN(MockSyncErrorFactory); |
52 }; | 52 }; |
53 | 53 |
54 MockSyncErrorFactory::MockSyncErrorFactory(syncer::ModelType type) | 54 MockSyncErrorFactory::MockSyncErrorFactory(syncer::ModelType type) |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 settings_service_.GetAllSyncData(SUPERVISED_USER_SHARED_SETTINGS).size()); | 263 settings_service_.GetAllSyncData(SUPERVISED_USER_SHARED_SETTINGS).size()); |
264 EXPECT_EQ(ToJson(&name), | 264 EXPECT_EQ(ToJson(&name), |
265 ToJson(settings_service_.GetValue(kIdA, "name"))); | 265 ToJson(settings_service_.GetValue(kIdA, "name"))); |
266 EXPECT_EQ(ToJson(&age), ToJson(settings_service_.GetValue(kIdA, "age"))); | 266 EXPECT_EQ(ToJson(&age), ToJson(settings_service_.GetValue(kIdA, "age"))); |
267 EXPECT_EQ(ToJson(&bar), ToJson(settings_service_.GetValue(kIdB, "foo"))); | 267 EXPECT_EQ(ToJson(&bar), ToJson(settings_service_.GetValue(kIdB, "foo"))); |
268 EXPECT_EQ(ToJson(&blurp), ToJson(settings_service_.GetValue(kIdC, "baz"))); | 268 EXPECT_EQ(ToJson(&blurp), ToJson(settings_service_.GetValue(kIdC, "baz"))); |
269 EXPECT_FALSE(settings_service_.GetValue(kIdA, "foo")); | 269 EXPECT_FALSE(settings_service_.GetValue(kIdA, "foo")); |
270 EXPECT_FALSE(settings_service_.GetValue(kIdB, "name")); | 270 EXPECT_FALSE(settings_service_.GetValue(kIdB, "name")); |
271 EXPECT_FALSE(settings_service_.GetValue(kIdC, "name")); | 271 EXPECT_FALSE(settings_service_.GetValue(kIdC, "name")); |
272 } | 272 } |
OLD | NEW |