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 container.addEventListener('acknowledge-first-run-flow', function() { | |
imcheng
2015/12/30 18:48:59
You can just pass in 'done' as the 2nd arg.
apacible
2015/12/31 00:38:03
Passing the function directly in as an arg invokes
| |
170 done(); | |
171 }); | |
172 MockInteractions.tap(container.$['first-run-button']); | |
173 }); | |
174 | |
165 // Tests for 'create-route' event firing when a sink with no associated | 175 // Tests for 'create-route' event firing when a sink with no associated |
166 // route is clicked. | 176 // route is clicked. |
167 test('select sink without a route', function(done) { | 177 test('select sink without a route', function(done) { |
168 container.allSinks = fakeSinkList; | 178 container.allSinks = fakeSinkList; |
169 | 179 |
170 setTimeout(function() { | 180 setTimeout(function() { |
171 var sinkList = | 181 var sinkList = |
172 container.$['sink-list'].querySelectorAll('paper-item'); | 182 container.$['sink-list'].querySelectorAll('paper-item'); |
173 container.addEventListener('create-route', function(data) { | 183 container.addEventListener('create-route', function(data) { |
174 // Container is initially in auto mode since a cast mode has not | 184 // 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 }); | 795 }); |
786 }); | 796 }); |
787 }); | 797 }); |
788 }); | 798 }); |
789 } | 799 } |
790 | 800 |
791 return { | 801 return { |
792 registerTests: registerTests, | 802 registerTests: registerTests, |
793 }; | 803 }; |
794 }); | 804 }); |
OLD | NEW |