Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(535)

Side by Side Diff: chrome/test/data/webui/media_router/media_router_container_route_tests.js

Issue 2725503002: [Media Router] Custom Controls 4 - Implement details view WebUI (Closed)
Patch Set: Address Mark's comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 media-router-container that focus on 5 /** @fileoverview Suite of tests for media-router-container that focus on
6 * routes. 6 * routes.
7 */ 7 */
8 cr.define('media_router_container_route', function() { 8 cr.define('media_router_container_route', function() {
9 function registerTests() { 9 function registerTests() {
10 suite('MediaRouterContainerRoute', function() { 10 suite('MediaRouterContainerRoute', function() {
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 container.routeList = fakeRouteList; 247 container.routeList = fakeRouteList;
248 container.maybeShowRouteDetailsOnOpen(); 248 container.maybeShowRouteDetailsOnOpen();
249 checkCurrentView(media_router.MediaRouterView.ROUTE_DETAILS); 249 checkCurrentView(media_router.MediaRouterView.ROUTE_DETAILS);
250 250
251 container.routeList = []; 251 container.routeList = [];
252 checkCurrentView(media_router.MediaRouterView.SINK_LIST); 252 checkCurrentView(media_router.MediaRouterView.SINK_LIST);
253 }); 253 });
254 254
255 // Tests for expected visible UI when the view is ROUTE_DETAILS. 255 // Tests for expected visible UI when the view is ROUTE_DETAILS.
256 test('route details visibility', function(done) { 256 test('route details visibility', function(done) {
257 container.showRouteDetails_(); 257 container.showRouteDetails_(
258 new media_router.Route('id 3', 'sink id 3', 'Title 3', 0, true));
258 setTimeout(function() { 259 setTimeout(function() {
259 checkElementsVisibleWithId(['container-header', 260 checkElementsVisibleWithId(['container-header',
260 'device-missing', 261 'device-missing',
261 'route-details']); 262 'route-details']);
262 done(); 263 done();
263 }); 264 });
264 }); 265 });
265 266
266 test('updated route in route details', function(done) { 267 test('updated route in route details', function(done) {
267 container.allSinks = fakeSinkList; 268 container.allSinks = fakeSinkList;
(...skipping 19 matching lines...) Expand all
287 assertTrue(!!container.currentRoute_); 288 assertTrue(!!container.currentRoute_);
288 assertEquals(newDescription, container.currentRoute_.description); 289 assertEquals(newDescription, container.currentRoute_.description);
289 done(); 290 done();
290 }); 291 });
291 }); 292 });
292 }); 293 });
293 294
294 // Tests for expected visible UI when the view is ROUTE_DETAILS, and there 295 // Tests for expected visible UI when the view is ROUTE_DETAILS, and there
295 // is a non-blocking issue. 296 // is a non-blocking issue.
296 test('route details visibility non blocking issue', function(done) { 297 test('route details visibility non blocking issue', function(done) {
297 container.showRouteDetails_(); 298 container.showRouteDetails_(
299 new media_router.Route('id 3', 'sink id 3', 'Title 3', 0, true));
298 300
299 // Set a non-blocking issue. The issue should be shown. 301 // Set a non-blocking issue. The issue should be shown.
300 container.issue = fakeNonBlockingIssue; 302 container.issue = fakeNonBlockingIssue;
301 setTimeout(function() { 303 setTimeout(function() {
302 checkElementsVisibleWithId(['container-header', 304 checkElementsVisibleWithId(['container-header',
303 'device-missing', 305 'device-missing',
304 'route-details']); 306 'route-details']);
305 done(); 307 done();
306 }); 308 });
307 }); 309 });
308 310
309 // Tests for expected visible UI when the view is ROUTE_DETAILS, and there 311 // Tests for expected visible UI when the view is ROUTE_DETAILS, and there
310 // is a blocking issue. 312 // is a blocking issue.
311 test('route details visibility with blocking issue', function(done) { 313 test('route details visibility with blocking issue', function(done) {
312 container.showRouteDetails_(); 314 container.showRouteDetails_(
315 new media_router.Route('id 3', 'sink id 3', 'Title 3', 0, true));
313 316
314 // Set a blocking issue. The issue should be shown, and everything 317 // Set a blocking issue. The issue should be shown, and everything
315 // else, hidden. 318 // else, hidden.
316 container.issue = fakeBlockingIssue; 319 container.issue = fakeBlockingIssue;
317 setTimeout(function() { 320 setTimeout(function() {
318 checkElementsVisibleWithId(['container-header', 321 checkElementsVisibleWithId(['container-header',
319 'device-missing', 322 'device-missing',
320 'issue-banner']); 323 'issue-banner']);
321 done(); 324 done();
322 }); 325 });
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 done(); 512 done();
510 }); 513 });
511 }); 514 });
512 }); 515 });
513 } 516 }
514 517
515 return { 518 return {
516 registerTests: registerTests, 519 registerTests: registerTests,
517 }; 520 };
518 }); 521 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698