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