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 GEN('#include "chrome/browser/ui/browser.h"'); | 5 GEN('#include "chrome/browser/ui/browser.h"'); |
6 GEN('#include "chrome/browser/ui/browser_commands.h"'); | 6 GEN('#include "chrome/browser/ui/browser_commands.h"'); |
7 GEN('#include "chrome/browser/ui/exclusive_access/' + | 7 GEN('#include "chrome/browser/ui/exclusive_access/' + |
8 'fullscreen_controller_test.h"'); | 8 'fullscreen_controller_test.h"'); |
9 | 9 |
10 /** | 10 /** |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
121 // other way to initialize the appropriate C++ handlers. | 121 // other way to initialize the appropriate C++ handlers. |
122 TEST_F('OobeWebUITest', 'DISABLED_OobeUserImage', function() { | 122 TEST_F('OobeWebUITest', 'DISABLED_OobeUserImage', function() { |
123 Oobe.getInstance().showScreen({'id':'user-image'}); | 123 Oobe.getInstance().showScreen({'id':'user-image'}); |
124 }); | 124 }); |
125 | 125 |
126 // TODO: figure out what state to mock in order for this | 126 // TODO: figure out what state to mock in order for this |
127 // screen to show up. | 127 // screen to show up. |
128 TEST_F('OobeWebUITest', 'DISABLED_OobeAccountPicker', function() { | 128 TEST_F('OobeWebUITest', 'DISABLED_OobeAccountPicker', function() { |
129 Oobe.getInstance().showScreen({'id':'account-picker'}); | 129 Oobe.getInstance().showScreen({'id':'account-picker'}); |
130 }); | 130 }); |
131 | |
132 | |
133 TEST_F('OobeWebUITest', 'HIDDetectionScreenTest', function() { | |
134 function getPincodeSymbol(i) { | |
135 return $('hid-keyboard-pincode-sym-' + (i + 1)); | |
136 } | |
137 | |
138 function getDisplayedPincode() { | |
139 var pincode = ''; | |
Roman Sorokin (ftl)
2015/07/21 12:10:58
nit: remove one space before '=';
dzhioev (left Google)
2015/07/21 21:06:06
Done.
| |
140 for (var i = 0; i < 6; ++i) | |
141 pincode += getPincodeSymbol(i).textContent; | |
142 return pincode; | |
143 } | |
144 | |
145 login.HIDDetectionScreen.contextChanged({ | |
146 'keyboard-state': 'searching', | |
147 'mouse-state': 'searching' | |
148 }); | |
149 Oobe.showScreen({'id': 'hid-detection'}); | |
150 expectTrue($('hid-keyboard-pincode').hidden); | |
151 | |
152 login.HIDDetectionScreen.contextChanged({ | |
153 'keyboard-state': 'pairing', | |
154 'keyboard-pincode': '013188' | |
155 }); | |
156 expectFalse($('hid-keyboard-pincode').hidden); | |
157 expectEquals('013188', getDisplayedPincode()); | |
158 | |
159 login.HIDDetectionScreen.contextChanged({ | |
160 'num-keys-entered-expected': true, | |
161 'num-keys-entered-pincode': 3 | |
162 }); | |
163 expectFalse($('hid-keyboard-pincode').hidden); | |
164 expectEquals('013188', getDisplayedPincode()); | |
165 [ | |
166 { 'key-typed': true }, | |
167 { 'key-typed': true }, | |
168 { 'key-typed': true }, | |
169 { 'key-next': true }, | |
170 { 'key-untyped': true }, | |
171 { 'key-untyped': true }, | |
172 { 'key-untyped': true } // Enter key symbol. | |
173 ].forEach(function(expectedClasses, i) { | |
174 var symbol = getPincodeSymbol(i); | |
175 ['key-typed', 'key-untyped', 'key-next'].forEach(function(className) { | |
176 expectEquals(!!expectedClasses[className], | |
177 symbol.classList.contains(className)); | |
178 }); | |
179 }); | |
180 | |
181 login.HIDDetectionScreen.contextChanged({ | |
182 'keyboard-state': 'connected' | |
183 }); | |
184 expectTrue($('hid-keyboard-pincode').hidden); | |
185 }); | |
OLD | NEW |