diff options
author | apacible <apacible@chromium.org> | 2015-07-30 00:19:06 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-30 07:19:45 +0000 |
commit | 3816c4caffacd0e0043247cd84811efbdc28b279 (patch) | |
tree | e1e0415bf307448526ae164228c5b2c62ac3c5e6 /chrome/test/data | |
parent | 2075cfb5a23f61dddd9ebdad08f9d182985260d2 (diff) | |
download | chromium_src-3816c4caffacd0e0043247cd84811efbdc28b279.zip chromium_src-3816c4caffacd0e0043247cd84811efbdc28b279.tar.gz chromium_src-3816c4caffacd0e0043247cd84811efbdc28b279.tar.bz2 |
Open Media Router dialog to route details view if there is a single local route.
The new expected behavior when the MR dialog is opened is:
- If there is a single local route, show the route details view.
- If there is more than one local route, show the sink list.
- If there are no local routes, show the sink list.
Behavior per discussion with UX.
Review URL: https://codereview.chromium.org/1264483003
Cr-Commit-Position: refs/heads/master@{#341066}
Diffstat (limited to 'chrome/test/data')
-rw-r--r-- | chrome/test/data/webui/media_router/media_router_container_tests.js | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/chrome/test/data/webui/media_router/media_router_container_tests.js b/chrome/test/data/webui/media_router/media_router_container_tests.js index 704bb01..95e8f2a 100644 --- a/chrome/test/data/webui/media_router/media_router_container_tests.js +++ b/chrome/test/data/webui/media_router/media_router_container_tests.js @@ -119,8 +119,13 @@ cr.define('media_router_container', function() { ]; fakeRouteList = [ - new media_router.Route('id 1', 'sink id 1', 'Title 1', true), - new media_router.Route('id 2', 'sink id 2', 'Title 2', false), + new media_router.Route('id 1', 'sink id 1', 'Title 1', 0, true), + new media_router.Route('id 2', 'sink id 2', 'Title 2', 1, false), + ]; + + fakeRouteListWithLocalRoutesOnly = [ + new media_router.Route('id 1', 'sink id 1', 'Title 1', 0, true), + new media_router.Route('id 2', 'sink id 2', 'Title 2', 1, true), ]; fakeSinkList = [ @@ -185,6 +190,8 @@ cr.define('media_router_container', function() { var sinkList = container.$['sink-list'].querySelectorAll('paper-item'); + // Start from the SINK_LIST view. + container.showSinkList_(); checkCurrentView(container.CONTAINER_VIEW_.SINK_LIST); MockInteractions.tap(sinkList[0]); checkCurrentView(container.CONTAINER_VIEW_.ROUTE_DETAILS); @@ -313,6 +320,33 @@ cr.define('media_router_container', function() { }); }); + // Tests the expected view when there is only one local active route and + // media_router_container is created for the first time. + test('initial view with one local route', function() { + container.sinkList = fakeSinkList; + container.routeList = fakeRouteList; + + checkCurrentView(container.CONTAINER_VIEW_.ROUTE_DETAILS); + }); + + // Tests the expected view when there are multiple local active routes + // and media_router_container is created for the first time. + test('initial view with multiple local routes', function() { + container.sinkList = fakeSinkList; + container.routeList = fakeRouteListWithLocalRoutesOnly; + + checkCurrentView(container.CONTAINER_VIEW_.SINK_LIST); + }); + + // Tests the expected view when there are no local active routes and + // media_router_container is created for the first time. + test('initial view with one local route', function() { + container.sinkList = fakeSinkList; + container.routeList = []; + + checkCurrentView(container.CONTAINER_VIEW_.SINK_LIST); + }); + // Tests for expected visible UI when the view is CAST_MODE_LIST. test('cast mode list state visibility', function() { container.showCastModeList_(); |