| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 Runs Polymer OnStartup Settings tests. */ | 5 /** @fileoverview Runs Polymer OnStartup Settings tests. */ |
| 6 | 6 |
| 7 GEN_INCLUDE(['settings_page_browsertest.js']); | 7 GEN_INCLUDE(['settings_page_browsertest.js']); |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Radio button enum values for restore on startup. | 10 * Radio button enum values for restore on startup. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 TEST_F('OnStartupSettingsBrowserTest', 'uiTests', function() { | 47 TEST_F('OnStartupSettingsBrowserTest', 'uiTests', function() { |
| 48 /** | 48 /** |
| 49 * The prefs API that will get a fake implementation. | 49 * The prefs API that will get a fake implementation. |
| 50 * @type {!SettingsPrivate} | 50 * @type {!SettingsPrivate} |
| 51 */ | 51 */ |
| 52 var settingsPrefs; | 52 var settingsPrefs; |
| 53 var self = this; | 53 var self = this; |
| 54 | 54 |
| 55 var restoreOnStartup = function() { | 55 var restoreOnStartup = function() { |
| 56 return self.getPageElement('#onStartupRadioGroup').querySelector( | 56 return self.getPageElement('#onStartupRadioGroup').querySelector( |
| 57 '.iron-selected').textContent.trim(); | 57 '.iron-selected').label; |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 suite('OnStartupHandler', function() { | 60 suite('OnStartupHandler', function() { |
| 61 suiteSetup(function() { | 61 suiteSetup(function() { |
| 62 self.getPage('basic').set('pageVisibility.onStartup', true); | 62 self.getPage('basic').set('pageVisibility.onStartup', true); |
| 63 Polymer.dom.flush(); | 63 Polymer.dom.flush(); |
| 64 | 64 |
| 65 settingsPrefs = document.querySelector('settings-ui').$$( | 65 settingsPrefs = document.querySelector('settings-ui').$$( |
| 66 'settings-prefs'); | 66 'settings-prefs'); |
| 67 assertTrue(!!settingsPrefs); | 67 assertTrue(!!settingsPrefs); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 81 }); | 81 }); |
| 82 | 82 |
| 83 test('open-specific', function() { | 83 test('open-specific', function() { |
| 84 settingsPrefs.set('prefs.session.restore_on_startup.value', | 84 settingsPrefs.set('prefs.session.restore_on_startup.value', |
| 85 RestoreOnStartupEnum.OPEN_SPECIFIC); | 85 RestoreOnStartupEnum.OPEN_SPECIFIC); |
| 86 assertEquals('Open a specific page or set of pages', restoreOnStartup()); | 86 assertEquals('Open a specific page or set of pages', restoreOnStartup()); |
| 87 }); | 87 }); |
| 88 }); | 88 }); |
| 89 mocha.run(); | 89 mocha.run(); |
| 90 }); | 90 }); |
| OLD | NEW |