| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 /** @fileoverview Suite of tests for Easy Unlock within People section. */ | 5 /** @fileoverview Suite of tests for Easy Unlock within People section. */ |
| 6 | 6 |
| 7 GEN_INCLUDE(['settings_page_browsertest.js']); | 7 GEN_INCLUDE(['settings_page_browsertest.js']); |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * @constructor | 10 * @constructor |
| 11 * @extends {SettingsPageBrowserTest} | 11 * @extends {SettingsPageBrowserTest} |
| 12 */ | 12 */ |
| 13 function SettingsEasyUnlockBrowserTest() { | 13 function SettingsEasyUnlockBrowserTest() { |
| 14 } | 14 } |
| 15 | 15 |
| 16 SettingsEasyUnlockBrowserTest.prototype = { | 16 SettingsEasyUnlockBrowserTest.prototype = { |
| 17 __proto__: SettingsPageBrowserTest.prototype, | 17 __proto__: SettingsPageBrowserTest.prototype, |
| 18 | 18 |
| 19 /** @override */ | 19 /** @override */ |
| 20 extraLibraries: PolymerTest.getLibraries(ROOT_PATH).concat([ | 20 extraLibraries: PolymerTest.getLibraries(ROOT_PATH).concat([ |
| 21 'test_browser_proxy.js', | 21 '../test_browser_proxy.js', |
| 22 ]), | 22 ]), |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 // Times out on debug builders and may time out on memory bots because | 25 // Times out on debug builders and may time out on memory bots because |
| 26 // the Settings page can take several seconds to load in a Release build | 26 // the Settings page can take several seconds to load in a Release build |
| 27 // and several times that in a Debug build. See https://crbug.com/558434 | 27 // and several times that in a Debug build. See https://crbug.com/558434 |
| 28 // and http://crbug.com/711256. | 28 // and http://crbug.com/711256. |
| 29 | 29 |
| 30 // Runs easy unlock tests. | 30 // Runs easy unlock tests. |
| 31 TEST_F('SettingsEasyUnlockBrowserTest', 'DISABLED_EasyUnlock', function() { | 31 TEST_F('SettingsEasyUnlockBrowserTest', 'DISABLED_EasyUnlock', function() { |
| 32 /** | 32 /** |
| 33 * A test version of EasyUnlockBrowserProxy. Provides helper methods | 33 * A test version of EasyUnlockBrowserProxy. Provides helper methods |
| 34 * for allowing tests to know when a method was called, as well as | 34 * for allowing tests to know when a method was called, as well as |
| 35 * specifying mock responses. | 35 * specifying mock responses. |
| 36 * | 36 * |
| 37 * @constructor | 37 * @constructor |
| 38 * @implements {settings.EasyUnlockBrowserProxy} | 38 * @implements {settings.EasyUnlockBrowserProxy} |
| 39 * @extends {settings.TestBrowserProxy} | 39 * @extends {TestBrowserProxy} |
| 40 */ | 40 */ |
| 41 var TestEasyUnlockBrowserProxy = function() { | 41 var TestEasyUnlockBrowserProxy = function() { |
| 42 settings.TestBrowserProxy.call(this, [ | 42 TestBrowserProxy.call(this, [ |
| 43 'getEnabledStatus', | 43 'getEnabledStatus', |
| 44 'startTurnOnFlow', | 44 'startTurnOnFlow', |
| 45 'getTurnOffFlowStatus', | 45 'getTurnOffFlowStatus', |
| 46 'startTurnOffFlow', | 46 'startTurnOffFlow', |
| 47 'cancelTurnOffFlow', | 47 'cancelTurnOffFlow', |
| 48 ]); | 48 ]); |
| 49 | 49 |
| 50 /** @private {boolean} */ | 50 /** @private {boolean} */ |
| 51 this.isEnabled_ = false; | 51 this.isEnabled_ = false; |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 TestEasyUnlockBrowserProxy.prototype = { | 54 TestEasyUnlockBrowserProxy.prototype = { |
| 55 __proto__: settings.TestBrowserProxy.prototype, | 55 __proto__: TestBrowserProxy.prototype, |
| 56 | 56 |
| 57 /** | 57 /** |
| 58 * @param {boolean} easyUnlockEnabled | 58 * @param {boolean} easyUnlockEnabled |
| 59 */ | 59 */ |
| 60 setEnabledStatus: function(easyUnlockEnabled) { | 60 setEnabledStatus: function(easyUnlockEnabled) { |
| 61 this.isEnabled_ = easyUnlockEnabled; | 61 this.isEnabled_ = easyUnlockEnabled; |
| 62 }, | 62 }, |
| 63 | 63 |
| 64 /** @override */ | 64 /** @override */ |
| 65 getEnabledStatus: function() { | 65 getEnabledStatus: function() { |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 .then(function() { | 215 .then(function() { |
| 216 Polymer.dom.flush(); | 216 Polymer.dom.flush(); |
| 217 expectFalse(turnOffDialog.$.dialog.open); | 217 expectFalse(turnOffDialog.$.dialog.open); |
| 218 }); | 218 }); |
| 219 }); | 219 }); |
| 220 }); | 220 }); |
| 221 | 221 |
| 222 // Run all registered tests. | 222 // Run all registered tests. |
| 223 mocha.run(); | 223 mocha.run(); |
| 224 }); | 224 }); |
| OLD | NEW |