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

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

Issue 1582943003: [Media Router] Add cloud services preferences. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes per anthonyvd@'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
Index: chrome/test/data/webui/media_router/media_router_container_tests.js
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 4d008a4e1fad6001fa1bcde4d83c924553e24ec7..cfb96dd36b22b84356326b2c1f0947ea5d77860d 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
@@ -173,7 +173,9 @@ cr.define('media_router_container', function() {
container.showFirstRunFlow = true;
setTimeout(function() {
- container.addEventListener('acknowledge-first-run-flow', function() {
+ container.addEventListener('acknowledge-first-run-flow',
+ function(data) {
+ assertFalse(data.detail.optedIntoCloudServices);
done();
});
MockInteractions.tap(container.shadowRoot.getElementById(
@@ -181,6 +183,45 @@ cr.define('media_router_container', function() {
});
});
+ // Tests for 'acknowledge-first-run-flow' event firing when the
+ // 'first-run-button' button is clicked and the cloud preference checkbox
+ // is also shown.
+ test('first run button with cloud pref click', function(done) {
+ container.showFirstRunFlow = true;
+ container.showFirstRunFlowCloudPref = true;
+
+ setTimeout(function() {
+ container.addEventListener('acknowledge-first-run-flow',
+ function(data) {
+ assertTrue(data.detail.optedIntoCloudServices);
+ done();
+ });
+ MockInteractions.tap(container.shadowRoot.getElementById(
+ 'first-run-button'));
+ });
+ });
+
+ // Tests for 'acknowledge-first-run-flow' event firing when the
+ // 'first-run-button' button is clicked after the cloud preference
+ // checkbox is deselected.
+ test('first run button with cloud pref deselected click',
+ function(done) {
+ container.showFirstRunFlow = true;
+ container.showFirstRunFlowCloudPref = true;
+
+ setTimeout(function() {
+ container.addEventListener('acknowledge-first-run-flow',
+ function(data) {
+ assertFalse(data.detail.optedIntoCloudServices);
+ done();
+ });
+ MockInteractions.tap(container.shadowRoot.getElementById(
+ 'first-run-cloud-checkbox'));
+ MockInteractions.tap(container.shadowRoot.getElementById(
+ 'first-run-button'));
+ });
+ });
+
// Tests for 'create-route' event firing when a sink with no associated
// route is clicked.
test('select sink without a route', function(done) {

Powered by Google App Engine
This is Rietveld 408576698