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-container. */ | 5 /** @fileoverview Suite of tests for media-router-container. */ |
6 cr.define('media_router_container', function() { | 6 cr.define('media_router_container', function() { |
7 function registerTests() { | 7 function registerTests() { |
8 suite('MediaRouterContainer', function() { | 8 suite('MediaRouterContainer', function() { |
9 /** | 9 /** |
10 * Media Router Container created before each test. | 10 * Media Router Container created before each test. |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 fakeNonBlockingIssue = new media_router.Issue( | 155 fakeNonBlockingIssue = new media_router.Issue( |
156 'issue id 2', 'Issue Title 2', 'Issue Message 2', 0, 1, | 156 'issue id 2', 'Issue Title 2', 'Issue Message 2', 0, 1, |
157 'route id 2', false, 1234); | 157 'route id 2', false, 1234); |
158 | 158 |
159 container.castModeList = fakeCastModeList; | 159 container.castModeList = fakeCastModeList; |
160 | 160 |
161 // Allow for the media router container to be created and attached. | 161 // Allow for the media router container to be created and attached. |
162 setTimeout(done); | 162 setTimeout(done); |
163 }); | 163 }); |
164 | 164 |
| 165 // Tests for 'acknowledge-first-run-flow' event firing when the |
| 166 // 'first-run-button' button is clicked. |
| 167 test('first run button click', function(done) { |
| 168 container.showFirstRunFlow_ = true; |
| 169 |
| 170 setTimeout(function() { |
| 171 container.addEventListener('acknowledge-first-run-flow', function() { |
| 172 done(); |
| 173 }); |
| 174 MockInteractions.tap(container.shadowRoot.getElementById( |
| 175 'first-run-button')); |
| 176 }); |
| 177 }); |
| 178 |
165 // Tests for 'create-route' event firing when a sink with no associated | 179 // Tests for 'create-route' event firing when a sink with no associated |
166 // route is clicked. | 180 // route is clicked. |
167 test('select sink without a route', function(done) { | 181 test('select sink without a route', function(done) { |
168 container.allSinks = fakeSinkList; | 182 container.allSinks = fakeSinkList; |
169 | 183 |
170 setTimeout(function() { | 184 setTimeout(function() { |
171 var sinkList = | 185 var sinkList = |
172 container.$['sink-list'].querySelectorAll('paper-item'); | 186 container.$['sink-list'].querySelectorAll('paper-item'); |
173 container.addEventListener('create-route', function(data) { | 187 container.addEventListener('create-route', function(data) { |
174 // Container is initially in auto mode since a cast mode has not | 188 // Container is initially in auto mode since a cast mode has not |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 }); | 799 }); |
786 }); | 800 }); |
787 }); | 801 }); |
788 }); | 802 }); |
789 } | 803 } |
790 | 804 |
791 return { | 805 return { |
792 registerTests: registerTests, | 806 registerTests: registerTests, |
793 }; | 807 }; |
794 }); | 808 }); |
OLD | NEW |