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

Unified Diff: chrome/test/data/webui/media_router/media_router_container_route_tests.js

Issue 2518083002: Deprecated: [Media Router] Ensure dialog shows route details view if there is one local route (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/webui/media_router/media_router_container_route_tests.js
diff --git a/chrome/test/data/webui/media_router/media_router_container_route_tests.js b/chrome/test/data/webui/media_router/media_router_container_route_tests.js
index 71a41e8814cab291dd83000f511e06619489e615..bb6b0aa4ef62bedfc4b23d8469d0add485fe31fb 100644
--- a/chrome/test/data/webui/media_router/media_router_container_route_tests.js
+++ b/chrome/test/data/webui/media_router/media_router_container_route_tests.js
@@ -217,7 +217,7 @@ cr.define('media_router_container_route', function() {
test('initial view with one local route', function() {
container.allSinks = fakeSinkList;
container.routeList = fakeRouteList;
- container.maybeShowRouteDetailsOnOpen();
+ container.showInitialView();
checkCurrentView(media_router.MediaRouterView.ROUTE_DETAILS);
});
@@ -245,7 +245,7 @@ cr.define('media_router_container_route', function() {
test('view after route is closed remotely', function() {
container.allSinks = fakeSinkList;
container.routeList = fakeRouteList;
- container.maybeShowRouteDetailsOnOpen();
+ container.showInitialView();
checkCurrentView(media_router.MediaRouterView.ROUTE_DETAILS);
container.routeList = [];
@@ -415,6 +415,7 @@ cr.define('media_router_container_route', function() {
for (var i = 0; i < fakeRouteList.length; ++i) {
fakeRouteList[i].currentCastMode = 2;
}
+ container.showSinkList_();
MockInteractions.tap(
container.$['container-header'].$['arrow-drop-icon']);
setTimeout(function() {
@@ -444,6 +445,7 @@ cr.define('media_router_container_route', function() {
for (var i = 0; i < fakeRouteList.length; ++i) {
fakeRouteList[i].currentCastMode = 2;
}
+ container.showSinkList_();
MockInteractions.tap(
container.$['container-header'].$['arrow-drop-icon']);
setTimeout(function() {
@@ -509,6 +511,39 @@ cr.define('media_router_container_route', function() {
done();
});
});
+
+ // Tests that if the route list contains one local route the first time
+ // it's updated, we show the route details view.
+ test('default to details view for one local route', function(done) {
+ container.routeList = fakeRouteList;
+ setTimeout(function() {
+ checkElementVisible(true, container.$$('#route-details'));
+ checkElementVisible(false, container.$$('#sink-list-view'));
+ done();
+ });
+ });
+
+ // Tests that if the route list contains no local routes the first time
+ // it's updated, we show the sink list view.
+ test('default to sink list for no local routes', function(done) {
+ container.routeList = [];
+ setTimeout(function() {
+ checkElementVisible(false, container.$$('#route-details'));
+ checkElementVisible(true, container.$$('#sink-list-view'));
+ done();
+ });
+ });
+
+ // Tests that if the route list contains multiple local routes the first
+ // time it's updated, we show the sink list view.
+ test('default to sink list for multiple local routes', function(done) {
+ container.routeList = fakeRouteListWithLocalRoutesOnly;
+ setTimeout(function() {
+ checkElementVisible(false, container.$$('#route-details'));
+ checkElementVisible(true, container.$$('#sink-list-view'));
+ done();
+ });
+ });
});
}

Powered by Google App Engine
This is Rietveld 408576698