Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: sync/internal_api/js_sync_manager_observer_unittest.cc

Issue 11314008: sync: Follow-up to conflict resolution refactor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sync/engine/syncer_unittest.cc ('k') | sync/internal_api/public/engine/sync_status.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 WeakHandle<JsBackend>(), true, restored_types); 70 WeakHandle<JsBackend>(), true, restored_types);
71 PumpLoop(); 71 PumpLoop();
72 } 72 }
73 73
74 TEST_F(JsSyncManagerObserverTest, OnSyncCycleCompleted) { 74 TEST_F(JsSyncManagerObserverTest, OnSyncCycleCompleted) {
75 sessions::SyncSessionSnapshot snapshot(sessions::ModelNeutralState(), 75 sessions::SyncSessionSnapshot snapshot(sessions::ModelNeutralState(),
76 false, 76 false,
77 ModelTypeSet(), 77 ModelTypeSet(),
78 ProgressMarkerMap(), 78 ProgressMarkerMap(),
79 false, 79 false,
80 true,
81 8,
82 5, 80 5,
83 2, 81 2,
84 7, 82 7,
85 sessions::SyncSourceInfo(), 83 sessions::SyncSourceInfo(),
86 false, 84 false,
87 0, 85 0,
88 base::Time::Now()); 86 base::Time::Now());
89 DictionaryValue expected_details; 87 DictionaryValue expected_details;
90 expected_details.Set("snapshot", snapshot.ToValue()); 88 expected_details.Set("snapshot", snapshot.ToValue());
91 89
92 EXPECT_CALL(mock_js_event_handler_, 90 EXPECT_CALL(mock_js_event_handler_,
93 HandleJsEvent("onSyncCycleCompleted", 91 HandleJsEvent("onSyncCycleCompleted",
94 HasDetailsAsDictionary(expected_details))); 92 HasDetailsAsDictionary(expected_details)));
95 93
96 js_sync_manager_observer_.OnSyncCycleCompleted(snapshot); 94 js_sync_manager_observer_.OnSyncCycleCompleted(snapshot);
97 PumpLoop(); 95 PumpLoop();
98 } 96 }
99 97
100 TEST_F(JsSyncManagerObserverTest, OnActionableError) { 98 TEST_F(JsSyncManagerObserverTest, OnActionableError) {
101 SyncProtocolError sync_error; 99 SyncProtocolError sync_error;
102 sync_error.action = CLEAR_USER_DATA_AND_RESYNC; 100 sync_error.action = CLEAR_USER_DATA_AND_RESYNC;
103 sync_error.error_type = TRANSIENT_ERROR; 101 sync_error.error_type = TRANSIENT_ERROR;
104 DictionaryValue expected_details; 102 DictionaryValue expected_details;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 EXPECT_CALL(mock_js_event_handler_, 134 EXPECT_CALL(mock_js_event_handler_,
137 HandleJsEvent("onUpdatedToken", 135 HandleJsEvent("onUpdatedToken",
138 HasDetailsAsDictionary(redacted_token_details))); 136 HasDetailsAsDictionary(redacted_token_details)));
139 137
140 js_sync_manager_observer_.OnUpdatedToken("sensitive_token"); 138 js_sync_manager_observer_.OnUpdatedToken("sensitive_token");
141 PumpLoop(); 139 PumpLoop();
142 } 140 }
143 141
144 } // namespace 142 } // namespace
145 } // namespace syncer 143 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/engine/syncer_unittest.cc ('k') | sync/internal_api/public/engine/sync_status.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698