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

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

Issue 153643006: sync: Remove dead code related to ClearUserData (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months 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/internal_api/js_sync_manager_observer.cc ('k') | sync/internal_api/public/sync_manager.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/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 26 matching lines...) Expand all
37 37
38 protected: 38 protected:
39 StrictMock<MockJsEventHandler> mock_js_event_handler_; 39 StrictMock<MockJsEventHandler> mock_js_event_handler_;
40 JsSyncManagerObserver js_sync_manager_observer_; 40 JsSyncManagerObserver js_sync_manager_observer_;
41 41
42 void PumpLoop() { 42 void PumpLoop() {
43 message_loop_.RunUntilIdle(); 43 message_loop_.RunUntilIdle();
44 } 44 }
45 }; 45 };
46 46
47 TEST_F(JsSyncManagerObserverTest, NoArgNotifiations) {
48 InSequence dummy;
49
50 EXPECT_CALL(mock_js_event_handler_,
51 HandleJsEvent("onStopSyncingPermanently",
52 HasDetails(JsEventDetails())));
53
54 js_sync_manager_observer_.OnStopSyncingPermanently();
55 PumpLoop();
56 }
57
58 TEST_F(JsSyncManagerObserverTest, OnInitializationComplete) { 47 TEST_F(JsSyncManagerObserverTest, OnInitializationComplete) {
59 base::DictionaryValue expected_details; 48 base::DictionaryValue expected_details;
60 syncer::ModelTypeSet restored_types; 49 syncer::ModelTypeSet restored_types;
61 restored_types.Put(BOOKMARKS); 50 restored_types.Put(BOOKMARKS);
62 restored_types.Put(NIGORI); 51 restored_types.Put(NIGORI);
63 expected_details.Set("restoredTypes", ModelTypeSetToValue(restored_types)); 52 expected_details.Set("restoredTypes", ModelTypeSetToValue(restored_types));
64 53
65 EXPECT_CALL(mock_js_event_handler_, 54 EXPECT_CALL(mock_js_event_handler_,
66 HandleJsEvent("onInitializationComplete", 55 HandleJsEvent("onInitializationComplete",
67 HasDetailsAsDictionary(expected_details))); 56 HasDetailsAsDictionary(expected_details)));
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 EXPECT_CALL(mock_js_event_handler_, 113 EXPECT_CALL(mock_js_event_handler_,
125 HandleJsEvent("onConnectionStatusChange", 114 HandleJsEvent("onConnectionStatusChange",
126 HasDetailsAsDictionary(expected_details))); 115 HasDetailsAsDictionary(expected_details)));
127 116
128 js_sync_manager_observer_.OnConnectionStatusChange(kStatus); 117 js_sync_manager_observer_.OnConnectionStatusChange(kStatus);
129 PumpLoop(); 118 PumpLoop();
130 } 119 }
131 120
132 } // namespace 121 } // namespace
133 } // namespace syncer 122 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/js_sync_manager_observer.cc ('k') | sync/internal_api/public/sync_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698