| 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 Suite of tests for media-router-header. */ | 5 /** @fileoverview Suite of tests for media-router-header. */ |
| 6 cr.define('media_router_header', function() { | 6 cr.define('media_router_header', function() { |
| 7 function registerTests() { | 7 function registerTests() { |
| 8 suite('MediaRouterHeader', function() { | 8 suite('MediaRouterHeader', function() { |
| 9 /** | 9 /** |
| 10 * Media Router Container created before each test. |
| 11 * @type {?MediaRouterContainer} |
| 12 */ |
| 13 var container; |
| 14 |
| 15 /** |
| 10 * Media Router Header created before each test. | 16 * Media Router Header created before each test. |
| 11 * @type {MediaRouterHeader} | 17 * @type {MediaRouterHeader} |
| 12 */ | 18 */ |
| 13 var header; | 19 var header; |
| 14 | 20 |
| 15 /** | 21 /** |
| 16 * The list of elements to check for visibility. | 22 * The list of elements to check for visibility. |
| 17 * @const {!Array<string>} | 23 * @const {!Array<string>} |
| 18 */ | 24 */ |
| 19 var hiddenCheckElementIdList = [ | 25 var hiddenCheckElementIdList = [ |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 'media_router_container.html'); | 71 'media_router_container.html'); |
| 66 }); | 72 }); |
| 67 | 73 |
| 68 // Initialize an media-router-header before each test. | 74 // Initialize an media-router-header before each test. |
| 69 setup(function(done) { | 75 setup(function(done) { |
| 70 PolymerTest.clearBody(); | 76 PolymerTest.clearBody(); |
| 71 container = document.createElement('media-router-container'); | 77 container = document.createElement('media-router-container'); |
| 72 document.body.appendChild(container); | 78 document.body.appendChild(container); |
| 73 header = container.$['container-header']; | 79 header = container.$['container-header']; |
| 74 | 80 |
| 75 // Allow for the media router header to be created and attached. | 81 // Allow for the media router container to be created, attached, and |
| 76 setTimeout(done); | 82 // listeners registered in an afterNextRender() call. |
| 83 Polymer.RenderStatus.afterNextRender(this, done); |
| 77 }); | 84 }); |
| 78 | 85 |
| 79 // Tests for 'close-dialog' event firing when the close button is | 86 // Tests for 'close-dialog' event firing when the close button is |
| 80 // clicked. | 87 // clicked. |
| 81 test('close button click', function(done) { | 88 test('close button click', function(done) { |
| 82 header.addEventListener('close-dialog', function(data) { | 89 header.addEventListener('close-dialog', function(data) { |
| 83 assertFalse(data.detail.pressEscToClose); | 90 assertFalse(data.detail.pressEscToClose); |
| 84 done(); | 91 done(); |
| 85 }); | 92 }); |
| 86 MockInteractions.tap(header.$['close-button']); | 93 MockInteractions.tap(header.$['close-button']); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 done(); | 268 done(); |
| 262 }); | 269 }); |
| 263 }); | 270 }); |
| 264 }); | 271 }); |
| 265 } | 272 } |
| 266 | 273 |
| 267 return { | 274 return { |
| 268 registerTests: registerTests, | 275 registerTests: registerTests, |
| 269 }; | 276 }; |
| 270 }); | 277 }); |
| OLD | NEW |