| 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 settings-languages-page. */ | 5 /** @fileoverview Suite of tests for settings-languages-page. */ |
| 6 | 6 |
| 7 /** @const {string} Path to root from chrome/test/data/webui/settings/. */ | 7 /** @const {string} Path to root from chrome/test/data/webui/settings/. */ |
| 8 var ROOT_PATH = '../../../../../'; | 8 var ROOT_PATH = '../../../../../'; |
| 9 | 9 |
| 10 // Polymer BrowserTest fixture. | 10 // Polymer BrowserTest fixture. |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 var dialog; | 106 var dialog; |
| 107 var dialogItems; | 107 var dialogItems; |
| 108 var cancelButton; | 108 var cancelButton; |
| 109 var actionButton; | 109 var actionButton; |
| 110 | 110 |
| 111 setup(function(done) { | 111 setup(function(done) { |
| 112 var addLanguagesButton = | 112 var addLanguagesButton = |
| 113 languagesCollapse.querySelector('.list-button:last-of-type'); | 113 languagesCollapse.querySelector('.list-button:last-of-type'); |
| 114 MockInteractions.tap(addLanguagesButton); | 114 MockInteractions.tap(addLanguagesButton); |
| 115 | 115 |
| 116 // The page stamps the dialog and registers listeners asynchronously. | 116 // The page stamps the dialog, registers listeners, and populates the |
| 117 Polymer.Base.async(function() { | 117 // iron-list asynchronously at microtask timing, so wait for a new task. |
| 118 setTimeout(function() { |
| 118 dialog = languagesPage.$$('settings-add-languages-dialog'); | 119 dialog = languagesPage.$$('settings-add-languages-dialog'); |
| 119 assertTrue(!!dialog); | 120 assertTrue(!!dialog); |
| 120 | 121 |
| 121 actionButton = assert(dialog.$$('.action-button')); | 122 actionButton = assert(dialog.$$('.action-button')); |
| 122 cancelButton = assert(dialog.$$('.cancel-button')); | 123 cancelButton = assert(dialog.$$('.cancel-button')); |
| 123 | 124 |
| 124 // The fixed-height dialog's iron-list should stamp far fewer than | 125 // The fixed-height dialog's iron-list should stamp far fewer than |
| 125 // 50 items. | 126 // 50 items. |
| 126 dialogItems = | 127 dialogItems = |
| 127 dialog.$.dialog.querySelectorAll('.list-item:not([hidden])'); | 128 dialog.$.dialog.querySelectorAll('.list-item:not([hidden])'); |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 assertTrue(!!languagesPage.$$('settings-edit-dictionary-page')); | 287 assertTrue(!!languagesPage.$$('settings-edit-dictionary-page')); |
| 287 } | 288 } |
| 288 }); | 289 }); |
| 289 }.bind(this)); | 290 }.bind(this)); |
| 290 | 291 |
| 291 // TODO(michaelpg): Test more aspects of the languages UI. | 292 // TODO(michaelpg): Test more aspects of the languages UI. |
| 292 | 293 |
| 293 // Run all registered tests. | 294 // Run all registered tests. |
| 294 mocha.run(); | 295 mocha.run(); |
| 295 }); | 296 }); |
| OLD | NEW |