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_encryption_handler_observer.h" | 5 #include "sync/internal_api/js_sync_encryption_handler_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 16 matching lines...) Expand all Loading... |
27 class JsSyncEncryptionHandlerObserverTest : public testing::Test { | 27 class JsSyncEncryptionHandlerObserverTest : public testing::Test { |
28 protected: | 28 protected: |
29 JsSyncEncryptionHandlerObserverTest() { | 29 JsSyncEncryptionHandlerObserverTest() { |
30 js_sync_encryption_handler_observer_.SetJsEventHandler( | 30 js_sync_encryption_handler_observer_.SetJsEventHandler( |
31 mock_js_event_handler_.AsWeakHandle()); | 31 mock_js_event_handler_.AsWeakHandle()); |
32 } | 32 } |
33 | 33 |
34 private: | 34 private: |
35 // This must be destroyed after the member variables below in order | 35 // This must be destroyed after the member variables below in order |
36 // for WeakHandles to be destroyed properly. | 36 // for WeakHandles to be destroyed properly. |
37 MessageLoop message_loop_; | 37 base::MessageLoop message_loop_; |
38 | 38 |
39 protected: | 39 protected: |
40 StrictMock<MockJsEventHandler> mock_js_event_handler_; | 40 StrictMock<MockJsEventHandler> mock_js_event_handler_; |
41 JsSyncEncryptionHandlerObserver js_sync_encryption_handler_observer_; | 41 JsSyncEncryptionHandlerObserver js_sync_encryption_handler_observer_; |
42 | 42 |
43 void PumpLoop() { | 43 void PumpLoop() { |
44 message_loop_.RunUntilIdle(); | 44 message_loop_.RunUntilIdle(); |
45 } | 45 } |
46 }; | 46 }; |
47 | 47 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 HandleJsEvent("onPassphraseTypeChanged", | 164 HandleJsEvent("onPassphraseTypeChanged", |
165 HasDetailsAsDictionary(passphrase_type_details))); | 165 HasDetailsAsDictionary(passphrase_type_details))); |
166 | 166 |
167 js_sync_encryption_handler_observer_.OnPassphraseTypeChanged( | 167 js_sync_encryption_handler_observer_.OnPassphraseTypeChanged( |
168 IMPLICIT_PASSPHRASE, ProtoTimeToTime(10)); | 168 IMPLICIT_PASSPHRASE, ProtoTimeToTime(10)); |
169 PumpLoop(); | 169 PumpLoop(); |
170 } | 170 } |
171 | 171 |
172 } // namespace | 172 } // namespace |
173 } // namespace syncer | 173 } // namespace syncer |
OLD | NEW |