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

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

Issue 1920293004: Hide pseudo sinks when user has no hosted domain. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pseudo sink empty domain test Created 4 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 * the MRPM search feature. 6 * the MRPM search feature.
7 */ 7 */
8 cr.define('media_router_container_search', function() { 8 cr.define('media_router_container_search', function() {
9 function registerTests() { 9 function registerTests() {
10 suite('MediaRouterContainerSearch', function() { 10 suite('MediaRouterContainerSearch', function() {
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 container.$$('#search-results').querySelectorAll('paper-item'); 404 container.$$('#search-results').querySelectorAll('paper-item');
405 searchResults.forEach(function(sink) { 405 searchResults.forEach(function(sink) {
406 var spinner = sink.querySelector('paper-spinner'); 406 var spinner = sink.querySelector('paper-spinner');
407 checkElementVisible(spinner, false); 407 checkElementVisible(spinner, false);
408 }); 408 });
409 done(); 409 done();
410 }); 410 });
411 }); 411 });
412 }); 412 });
413 413
414 test('pseudo sink with empty domain is not shown', function(done) {
415 pseudoSink.domain = '';
416 container.allSinks = fakeSinkListWithPseudoSink;
417
418 var searchInput = container.$['sink-search-input'];
419 searchInput.value = foundSink.name;
420 setTimeout(function() {
421 var noMatches = container.$$('#no-search-matches');
422 var searchResults = container.$$('#search-results');
423 checkElementVisible(noMatches, true);
424 checkElementVisible(searchResults, false);
425 done();
426 });
427 });
428
414 test('pseudo sink search state launching sink id', function() { 429 test('pseudo sink search state launching sink id', function() {
415 var searchState = new PseudoSinkSearchState(pseudoSink); 430 var searchState = new PseudoSinkSearchState(pseudoSink);
416 431
417 assertEquals(pseudoSink.id, searchState.checkForRealSink(fakeSinkList)); 432 assertEquals(pseudoSink.id, searchState.checkForRealSink(fakeSinkList));
418 assertEquals( 433 assertEquals(
419 pseudoSink.id, 434 pseudoSink.id,
420 searchState.checkForRealSink(fakeSinkList.concat([foundSink]))); 435 searchState.checkForRealSink(fakeSinkList.concat([foundSink])));
421 assertEquals(pseudoSink.id, searchState.checkForRealSink(fakeSinkList)); 436 assertEquals(pseudoSink.id, searchState.checkForRealSink(fakeSinkList));
422 437
423 searchState.receiveSinkResponse(foundSink.id); 438 searchState.receiveSinkResponse(foundSink.id);
(...skipping 14 matching lines...) Expand all
438 assertEquals(someId, searchState.mapRouteSinkId(someId)); 453 assertEquals(someId, searchState.mapRouteSinkId(someId));
439 assertEquals(foundSink.id, searchState.mapRouteSinkId(pseudoSink.id)); 454 assertEquals(foundSink.id, searchState.mapRouteSinkId(pseudoSink.id));
440 }); 455 });
441 }); 456 });
442 } 457 }
443 458
444 return { 459 return {
445 registerTests: registerTests, 460 registerTests: registerTests,
446 }; 461 };
447 }); 462 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698