OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/sync/js/js_sync_manager_observer.h" | 5 #include "chrome/browser/sync/js/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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 EXPECT_CALL(mock_js_event_handler_, | 90 EXPECT_CALL(mock_js_event_handler_, |
91 HandleJsEvent("onSyncCycleCompleted", | 91 HandleJsEvent("onSyncCycleCompleted", |
92 HasDetailsAsDictionary(expected_details))); | 92 HasDetailsAsDictionary(expected_details))); |
93 | 93 |
94 js_sync_manager_observer_.OnSyncCycleCompleted(&snapshot); | 94 js_sync_manager_observer_.OnSyncCycleCompleted(&snapshot); |
95 PumpLoop(); | 95 PumpLoop(); |
96 } | 96 } |
97 | 97 |
98 TEST_F(JsSyncManagerObserverTest, OnActionableError) { | 98 TEST_F(JsSyncManagerObserverTest, OnActionableError) { |
99 browser_sync::SyncProtocolError sync_error; | 99 browser_sync::SyncOperationResult sync_error; |
100 sync_error.action = browser_sync::CLEAR_USER_DATA_AND_RESYNC; | 100 sync_error.action = browser_sync::CLEAR_USER_DATA_AND_RESYNC; |
101 sync_error.error_type = browser_sync::TRANSIENT_ERROR; | 101 sync_error.error_type = browser_sync::TRANSIENT_ERROR; |
102 DictionaryValue expected_details; | 102 DictionaryValue expected_details; |
103 expected_details.Set("syncError", sync_error.ToValue()); | 103 expected_details.Set("syncError", sync_error.ToValue()); |
104 | 104 |
105 EXPECT_CALL(mock_js_event_handler_, | 105 EXPECT_CALL(mock_js_event_handler_, |
106 HandleJsEvent("onActionableError", | 106 HandleJsEvent("onActionableError", |
107 HasDetailsAsDictionary(expected_details))); | 107 HasDetailsAsDictionary(expected_details))); |
108 | 108 |
109 js_sync_manager_observer_.OnActionableError(sync_error); | 109 js_sync_manager_observer_.OnActionableError(sync_error); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 EXPECT_CALL(mock_js_event_handler_, | 207 EXPECT_CALL(mock_js_event_handler_, |
208 HandleJsEvent("onEncryptionComplete", | 208 HandleJsEvent("onEncryptionComplete", |
209 HasDetailsAsDictionary(expected_details))); | 209 HasDetailsAsDictionary(expected_details))); |
210 | 210 |
211 js_sync_manager_observer_.OnEncryptionComplete(encrypted_types); | 211 js_sync_manager_observer_.OnEncryptionComplete(encrypted_types); |
212 PumpLoop(); | 212 PumpLoop(); |
213 } | 213 } |
214 | 214 |
215 } // namespace | 215 } // namespace |
216 } // namespace browser_sync | 216 } // namespace browser_sync |
OLD | NEW |