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) { |