| 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 route-details. */ | 5 /** @fileoverview Suite of tests for route-details. */ |
| 6 cr.define('route_details', function() { | 6 cr.define('route_details', function() { |
| 7 function registerTests() { | 7 function registerTests() { |
| 8 suite('RouteDetails', function() { | 8 suite('RouteDetails', function() { |
| 9 /** | 9 /** |
| 10 * Route Details created before each test. | 10 * Route Details created before each test. |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 details.addEventListener('join-route-click', function() { done(); }); | 150 details.addEventListener('join-route-click', function() { done(); }); |
| 151 details.route = fakeRouteTwo; | 151 details.route = fakeRouteTwo; |
| 152 MockInteractions.tap(details.$['start-casting-to-route-button']); | 152 MockInteractions.tap(details.$['start-casting-to-route-button']); |
| 153 }); | 153 }); |
| 154 | 154 |
| 155 // Tests for 'replace-route-click' event firing when the | 155 // Tests for 'replace-route-click' event firing when the |
| 156 // 'start-casting-to-route-button' button is clicked when the current | 156 // 'start-casting-to-route-button' button is clicked when the current |
| 157 // route is not joinable. | 157 // route is not joinable. |
| 158 test('start casting button click replaces route', function(done) { | 158 test('start casting button click replaces route', function(done) { |
| 159 details.addEventListener( | 159 details.addEventListener( |
| 160 'replace-route-click', function() { done(); }); | 160 'change-route-source-click', function() { done(); }); |
| 161 details.route = fakeRouteOne; | 161 details.route = fakeRouteOne; |
| 162 details.availableCastModes = 1; | 162 details.availableCastModes = 1; |
| 163 MockInteractions.tap(details.$['start-casting-to-route-button']); | 163 MockInteractions.tap(details.$['start-casting-to-route-button']); |
| 164 }); | 164 }); |
| 165 | 165 |
| 166 // Tests the initial expected text. | 166 // Tests the initial expected text. |
| 167 test('initial text setting', function() { | 167 test('initial text setting', function() { |
| 168 // <paper-button> text is styled as upper case. | 168 // <paper-button> text is styled as upper case. |
| 169 checkSpanText(loadTimeData.getString('stopCastingButtonText') | 169 checkSpanText(loadTimeData.getString('stopCastingButtonText') |
| 170 .toUpperCase(), 'close-route-button'); | 170 .toUpperCase(), 'close-route-button'); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 done(); | 229 done(); |
| 230 }); | 230 }); |
| 231 }); | 231 }); |
| 232 }); | 232 }); |
| 233 } | 233 } |
| 234 | 234 |
| 235 return { | 235 return { |
| 236 registerTests: registerTests, | 236 registerTests: registerTests, |
| 237 }; | 237 }; |
| 238 }); | 238 }); |
| OLD | NEW |