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 15 matching lines...) Expand all Loading... |
26 class JsSyncManagerObserverTest : public testing::Test { | 26 class JsSyncManagerObserverTest : public testing::Test { |
27 protected: | 27 protected: |
28 JsSyncManagerObserverTest() { | 28 JsSyncManagerObserverTest() { |
29 js_sync_manager_observer_.SetJsEventHandler( | 29 js_sync_manager_observer_.SetJsEventHandler( |
30 mock_js_event_handler_.AsWeakHandle()); | 30 mock_js_event_handler_.AsWeakHandle()); |
31 } | 31 } |
32 | 32 |
33 private: | 33 private: |
34 // This must be destroyed after the member variables below in order | 34 // This must be destroyed after the member variables below in order |
35 // for WeakHandles to be destroyed properly. | 35 // for WeakHandles to be destroyed properly. |
36 MessageLoop message_loop_; | 36 base::MessageLoop message_loop_; |
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 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 EXPECT_CALL(mock_js_event_handler_, | 138 EXPECT_CALL(mock_js_event_handler_, |
139 HandleJsEvent("onUpdatedToken", | 139 HandleJsEvent("onUpdatedToken", |
140 HasDetailsAsDictionary(redacted_token_details))); | 140 HasDetailsAsDictionary(redacted_token_details))); |
141 | 141 |
142 js_sync_manager_observer_.OnUpdatedToken("sensitive_token"); | 142 js_sync_manager_observer_.OnUpdatedToken("sensitive_token"); |
143 PumpLoop(); | 143 PumpLoop(); |
144 } | 144 } |
145 | 145 |
146 } // namespace | 146 } // namespace |
147 } // namespace syncer | 147 } // namespace syncer |
OLD | NEW |