OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 GEN('#include "chrome/browser/ui/webui/options/' + | 5 GEN('#include "chrome/browser/ui/webui/options/' + |
6 'managed_user_set_passphrase_test.h"'); | 6 'managed_user_set_passphrase_test.h"'); |
7 | 7 |
8 /** | 8 /** |
9 * Test fixture for managed user set passphrase WebUI testing. | 9 * Test fixture for managed user set passphrase WebUI testing. |
10 * @constructor | 10 * @constructor |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 this.mockHandler.expects(once()).setPassphrase(['test_passphrase']); | 80 this.mockHandler.expects(once()).setPassphrase(['test_passphrase']); |
81 this.savePassphrase(); | 81 this.savePassphrase(); |
82 }); | 82 }); |
83 | 83 |
84 // Verify that empty passphrase is not allowed. | 84 // Verify that empty passphrase is not allowed. |
85 TEST_F('ManagedUserSetPassphraseTest', 'EmptyPassphrase', | 85 TEST_F('ManagedUserSetPassphraseTest', 'EmptyPassphrase', |
86 function() { | 86 function() { |
87 this.setPassphrase(); | 87 this.setPassphrase(); |
88 this.enterPassphrase(''); | 88 this.enterPassphrase(''); |
89 this.confirmPassphrase(''); | 89 this.confirmPassphrase(''); |
90 this.mockHandler.expects(never()).setPassphrase(ANYTHING); | 90 this.mockHandler.expects(once()).setPassphrase(['']); |
91 this.savePassphrase(); | 91 this.savePassphrase(); |
92 }); | 92 }); |
93 | 93 |
94 // Verify that the confirm passphrase input needs to contain the same | 94 // Verify that the confirm passphrase input needs to contain the same |
95 // passphrase as the passphrase input. | 95 // passphrase as the passphrase input. |
96 TEST_F('ManagedUserSetPassphraseTest', 'DifferentPassphrase', | 96 TEST_F('ManagedUserSetPassphraseTest', 'DifferentPassphrase', |
97 function() { | 97 function() { |
98 this.setPassphrase(); | 98 this.setPassphrase(); |
99 this.enterPassphrase('test_passphrase'); | 99 this.enterPassphrase('test_passphrase'); |
100 this.confirmPassphrase('confirm_passphrase'); | 100 this.confirmPassphrase('confirm_passphrase'); |
101 this.mockHandler.expects(never()).setPassphrase(ANYTHING); | 101 this.mockHandler.expects(never()).setPassphrase(ANYTHING); |
102 this.savePassphrase(); | 102 this.savePassphrase(); |
103 }); | 103 }); |
OLD | NEW |