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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 HasDetailsAsDictionary(expected_details))); | 147 HasDetailsAsDictionary(expected_details))); |
148 | 148 |
149 FakeEncryptor encryptor; | 149 FakeEncryptor encryptor; |
150 Cryptographer cryptographer(&encryptor); | 150 Cryptographer cryptographer(&encryptor); |
151 | 151 |
152 js_sync_encryption_handler_observer_.OnCryptographerStateChanged( | 152 js_sync_encryption_handler_observer_.OnCryptographerStateChanged( |
153 &cryptographer); | 153 &cryptographer); |
154 PumpLoop(); | 154 PumpLoop(); |
155 } | 155 } |
156 | 156 |
| 157 TEST_F(JsSyncEncryptionHandlerObserverTest, OnPassphraseStateChanged) { |
| 158 InSequence dummy; |
| 159 |
| 160 DictionaryValue passphrase_state_details; |
| 161 passphrase_state_details.SetString("passphraseState", "IMPLICIT_PASSPHRASE"); |
| 162 EXPECT_CALL(mock_js_event_handler_, |
| 163 HandleJsEvent("onPassphraseStateChanged", |
| 164 HasDetailsAsDictionary(passphrase_state_details))); |
| 165 |
| 166 js_sync_encryption_handler_observer_.OnPassphraseStateChanged( |
| 167 IMPLICIT_PASSPHRASE); |
| 168 PumpLoop(); |
| 169 } |
| 170 |
157 } // namespace | 171 } // namespace |
158 } // namespace syncer | 172 } // namespace syncer |
OLD | NEW |