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

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

Issue 1610523002: [Media Router] Make header text clickable to switch between sink list and cast mode views. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes per imcheng@'s comments. Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/media_router/elements/media_router_header/media_router_header.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/media_router/media_router_header_tests.js
diff --git a/chrome/test/data/webui/media_router/media_router_header_tests.js b/chrome/test/data/webui/media_router/media_router_header_tests.js
index 966948ac3c14b6db192e3dcfc9cbdd4bf1f3628b..f82ef68ca6232b75c72fc3513339fe538b1d089c 100644
--- a/chrome/test/data/webui/media_router/media_router_header_tests.js
+++ b/chrome/test/data/webui/media_router/media_router_header_tests.js
@@ -81,15 +81,62 @@ cr.define('media_router_header', function() {
MockInteractions.tap(header.$['back-button']);
});
- // Tests for 'arrow-drop-click' event firing when the arrow drop button
- // is clicked.
+ // Tests for 'header-or-arrow-click' event firing when the arrow drop
+ // button is clicked on the CAST_MODE_LIST view.
test('arrow drop icon click', function(done) {
- header.addEventListener('arrow-drop-click', function() {
+ header.view = media_router.MediaRouterView.CAST_MODE_LIST;
+ header.addEventListener('header-or-arrow-click', function() {
done();
});
MockInteractions.tap(header.$['arrow-drop-icon']);
});
+ // Tests for 'header-or-arrow-click' event firing when the arrow drop
+ // button is clicked on the SINK_LIST view.
+ test('arrow drop icon click', function(done) {
+ header.view = media_router.MediaRouterView.SINK_LIST;
+ header.addEventListener('header-or-arrow-click', function() {
+ done();
+ });
+ MockInteractions.tap(header.$['arrow-drop-icon']);
+ });
+
+ // Tests for 'header-or-arrow-click' event firing when the header text is
+ // clicked on the CAST_MODE_LIST view.
+ test('header text click on cast mode list view', function(done) {
+ header.view = media_router.MediaRouterView.CAST_MODE_LIST;
+ header.addEventListener('header-or-arrow-click', function() {
+ done();
+ });
+ MockInteractions.tap(header.$['header-text']);
+ });
+
+ // Tests for 'header-or-arrow-click' event firing when the header text is
+ // clicked on the SINK_LIST view.
+ test('header text click on sink list view', function(done) {
+ header.view = media_router.MediaRouterView.SINK_LIST;
+ header.addEventListener('header-or-arrow-click', function() {
+ done();
+ });
+ MockInteractions.tap(header.$['header-text']);
+ });
+
+ // Tests for no event firing when the header text is clicked on certain
+ // views.
+ test('header text click without event firing', function(done) {
+ header.addEventListener('header-or-arrow-click', function() {
+ assertNotReached();
+ });
+
+ header.view = media_router.MediaRouterView.FILTER;
+ MockInteractions.tap(header.$['header-text']);
+ header.view = media_router.MediaRouterView.ISSUE;
+ MockInteractions.tap(header.$['header-text']);
+ header.view = media_router.MediaRouterView.ROUTE_DETAILS;
+ MockInteractions.tap(header.$['header-text']);
+ done();
+ });
+
// Tests the |computeArrowDropIcon_| function.
test('compute arrow drop icon', function() {
assertEquals('arrow-drop-up',
« no previous file with comments | « chrome/browser/resources/media_router/elements/media_router_header/media_router_header.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698