| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 TEST_F(JsSyncManagerObserverTest, NoArgNotifiations) { | 46 TEST_F(JsSyncManagerObserverTest, NoArgNotifiations) { |
| 47 InSequence dummy; | 47 InSequence dummy; |
| 48 | 48 |
| 49 EXPECT_CALL(mock_js_event_handler_, | 49 EXPECT_CALL(mock_js_event_handler_, |
| 50 HandleJsEvent("onInitializationComplete", | 50 HandleJsEvent("onInitializationComplete", |
| 51 HasDetails(JsEventDetails()))); | 51 HasDetails(JsEventDetails()))); |
| 52 EXPECT_CALL(mock_js_event_handler_, | 52 EXPECT_CALL(mock_js_event_handler_, |
| 53 HandleJsEvent("onStopSyncingPermanently", | 53 HandleJsEvent("onStopSyncingPermanently", |
| 54 HasDetails(JsEventDetails()))); | 54 HasDetails(JsEventDetails()))); |
| 55 EXPECT_CALL(mock_js_event_handler_, | 55 EXPECT_CALL(mock_js_event_handler_, |
| 56 HandleJsEvent("onClearServerDataSucceeded", | |
| 57 HasDetails(JsEventDetails()))); | |
| 58 EXPECT_CALL(mock_js_event_handler_, | |
| 59 HandleJsEvent("onClearServerDataFailed", | |
| 60 HasDetails(JsEventDetails()))); | |
| 61 EXPECT_CALL(mock_js_event_handler_, | |
| 62 HandleJsEvent("onEncryptionComplete", | 56 HandleJsEvent("onEncryptionComplete", |
| 63 HasDetails(JsEventDetails()))); | 57 HasDetails(JsEventDetails()))); |
| 64 | 58 |
| 65 js_sync_manager_observer_.OnInitializationComplete(WeakHandle<JsBackend>(), | 59 js_sync_manager_observer_.OnInitializationComplete(WeakHandle<JsBackend>(), |
| 66 true); | 60 true); |
| 67 js_sync_manager_observer_.OnStopSyncingPermanently(); | 61 js_sync_manager_observer_.OnStopSyncingPermanently(); |
| 68 js_sync_manager_observer_.OnClearServerDataSucceeded(); | |
| 69 js_sync_manager_observer_.OnClearServerDataFailed(); | |
| 70 js_sync_manager_observer_.OnEncryptionComplete(); | 62 js_sync_manager_observer_.OnEncryptionComplete(); |
| 71 PumpLoop(); | 63 PumpLoop(); |
| 72 } | 64 } |
| 73 | 65 |
| 74 TEST_F(JsSyncManagerObserverTest, OnSyncCycleCompleted) { | 66 TEST_F(JsSyncManagerObserverTest, OnSyncCycleCompleted) { |
| 75 syncable::ModelTypePayloadMap download_progress_markers; | 67 syncable::ModelTypePayloadMap download_progress_markers; |
| 76 sessions::SyncSessionSnapshot snapshot(sessions::SyncerStatus(), | 68 sessions::SyncSessionSnapshot snapshot(sessions::SyncerStatus(), |
| 77 sessions::ErrorCounters(), | 69 sessions::ErrorCounters(), |
| 78 100, | 70 100, |
| 79 false, | 71 false, |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 HandleJsEvent("onEncryptedTypesChanged", | 202 HandleJsEvent("onEncryptedTypesChanged", |
| 211 HasDetailsAsDictionary(expected_details))); | 203 HasDetailsAsDictionary(expected_details))); |
| 212 | 204 |
| 213 js_sync_manager_observer_.OnEncryptedTypesChanged( | 205 js_sync_manager_observer_.OnEncryptedTypesChanged( |
| 214 encrypted_types, encrypt_everything); | 206 encrypted_types, encrypt_everything); |
| 215 PumpLoop(); | 207 PumpLoop(); |
| 216 } | 208 } |
| 217 | 209 |
| 218 } // namespace | 210 } // namespace |
| 219 } // namespace browser_sync | 211 } // namespace browser_sync |
| OLD | NEW |