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 "sync/internal_api/js_sync_manager_observer.h" | 5 #include "sync/internal_api/js_sync_manager_observer.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 js_sync_manager_observer_.OnInitializationComplete( | 69 js_sync_manager_observer_.OnInitializationComplete( |
70 WeakHandle<JsBackend>(), | 70 WeakHandle<JsBackend>(), |
71 WeakHandle<DataTypeDebugInfoListener>(), | 71 WeakHandle<DataTypeDebugInfoListener>(), |
72 true, | 72 true, |
73 restored_types); | 73 restored_types); |
74 PumpLoop(); | 74 PumpLoop(); |
75 } | 75 } |
76 | 76 |
77 TEST_F(JsSyncManagerObserverTest, OnSyncCycleCompleted) { | 77 TEST_F(JsSyncManagerObserverTest, OnSyncCycleCompleted) { |
78 sessions::SyncSessionSnapshot snapshot(sessions::ModelNeutralState(), | 78 sessions::SyncSessionSnapshot snapshot( |
79 false, | 79 sessions::ModelNeutralState(), |
80 ModelTypeSet(), | 80 false, |
81 ProgressMarkerMap(), | 81 ModelTypeSet(), |
82 false, | 82 ProgressMarkerMap(), |
83 5, | 83 false, |
84 2, | 84 5, |
85 7, | 85 2, |
86 sessions::SyncSourceInfo(), | 86 7, |
87 false, | 87 sessions::SyncSourceInfo(), |
88 0, | 88 std::vector<sessions::SyncSourceInfo>(), |
89 base::Time::Now(), | 89 false, |
90 std::vector<int>(MODEL_TYPE_COUNT, 0), | 90 0, |
91 std::vector<int>(MODEL_TYPE_COUNT, 0)); | 91 base::Time::Now(), |
| 92 std::vector<int>(MODEL_TYPE_COUNT, 0), |
| 93 std::vector<int>(MODEL_TYPE_COUNT, 0)); |
92 DictionaryValue expected_details; | 94 DictionaryValue expected_details; |
93 expected_details.Set("snapshot", snapshot.ToValue()); | 95 expected_details.Set("snapshot", snapshot.ToValue()); |
94 | 96 |
95 EXPECT_CALL(mock_js_event_handler_, | 97 EXPECT_CALL(mock_js_event_handler_, |
96 HandleJsEvent("onSyncCycleCompleted", | 98 HandleJsEvent("onSyncCycleCompleted", |
97 HasDetailsAsDictionary(expected_details))); | 99 HasDetailsAsDictionary(expected_details))); |
98 | 100 |
99 js_sync_manager_observer_.OnSyncCycleCompleted(snapshot); | 101 js_sync_manager_observer_.OnSyncCycleCompleted(snapshot); |
100 PumpLoop(); | 102 PumpLoop(); |
101 } | 103 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 EXPECT_CALL(mock_js_event_handler_, | 141 EXPECT_CALL(mock_js_event_handler_, |
140 HandleJsEvent("onUpdatedToken", | 142 HandleJsEvent("onUpdatedToken", |
141 HasDetailsAsDictionary(redacted_token_details))); | 143 HasDetailsAsDictionary(redacted_token_details))); |
142 | 144 |
143 js_sync_manager_observer_.OnUpdatedToken("sensitive_token"); | 145 js_sync_manager_observer_.OnUpdatedToken("sensitive_token"); |
144 PumpLoop(); | 146 PumpLoop(); |
145 } | 147 } |
146 | 148 |
147 } // namespace | 149 } // namespace |
148 } // namespace syncer | 150 } // namespace syncer |
OLD | NEW |