Bug 1001279 - Add support of websites to opt-out of casting videos (tests) r=wesj
authorMark Finkle <mfinkle@mozilla.com>
Thu, 01 May 2014 17:29:03 -0400
changeset 181654 c788ef01538a25c8460cfb72c07c7d8139b4dae8
parent 181653 ad3355a8d31f68c362c5fa721451eb43d48ead89
child 181655 5cf5f00fc6ace7743f9e5d4737dac274ff04b86d
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewerswesj
bugs1001279
milestone32.0a1
Bug 1001279 - Add support of websites to opt-out of casting videos (tests) r=wesj
mobile/android/base/tests/testVideoDiscovery.js
mobile/android/base/tests/video_discovery.html
--- a/mobile/android/base/tests/testVideoDiscovery.js
+++ b/mobile/android/base/tests/testVideoDiscovery.js
@@ -43,17 +43,23 @@ add_test(function setup_browser() {
 });
 
 let videoDiscoveryTests = [
   { id: "simple-mp4", source: "http://mochi.test:8888/simple.mp4", poster: "http://mochi.test:8888/simple.png", text: "simple video with mp4 src" },
   { id: "simple-fail", pass: false, text: "simple video with no mp4 src" },
   { id: "with-sources-mp4", source: "http://mochi.test:8888/simple.mp4", text: "video with mp4 extension source child" },
   { id: "with-sources-fail", pass: false, text: "video with no mp4 extension source child" },
   { id: "with-sources-mimetype", source: "http://mochi.test:8888/simple-video-mp4", text: "video with mp4 mimetype source child" },
-  { id: "video-overlay", source: "http://mochi.test:8888/simple.mp4", text: "div overlay covering a simple video with mp4 src" }
+  { id: "video-overlay", source: "http://mochi.test:8888/simple.mp4", text: "div overlay covering a simple video with mp4 src" },
+
+  { id: "opt-in-simple-mp4", source: "http://mochi.test:8888/simple.mp4", poster: "http://mochi.test:8888/simple.png", text: "simple video with mp4 src" },
+  { id: "opt-out-simple-mp4", pass: false, text: "simple video with mp4 src but opt-out" },
+  { id: "opt-in-simple-fail", pass: false, text: "simple video with opt-in but no mp4 src" },
+  { id: "opt-in-with-sources-mp4", source: "http://mochi.test:8888/simple.mp4", text: "opt-in video with mp4 extension source child" },
+  { id: "opt-out-with-sources-mp4", pass: false, text: "video with mp4 extension source child but opt-out" }
 ];
 
 function execute_video_test(test) {
   let element = browser.contentDocument.getElementById(test.id);
   if (element) {
     let [x, y] = middle(element);
     let video = chromeWin.CastingApps.getVideo(element, x, y);
     if (video) {
--- a/mobile/android/base/tests/video_discovery.html
+++ b/mobile/android/base/tests/video_discovery.html
@@ -51,10 +51,31 @@
 
     <!-- PASS: div overlay covers a video with mp4 src -->
     <div id="video-box">
       <div id="video-overlay"></div>
       <div>
         <video id="video-player" src="/simple.mp4"></video>
       </div>
     </div>
+
+    <!-- PASS: opt-in and src uses a mp4 extension -->
+    <video id="opt-in-simple-mp4" poster="/simple.png" src="/simple.mp4" x-webkit-airplay="allow"></video>
+
+    <!-- FAIL: opt-out and src uses a mp4 extension -->
+    <video id="opt-out-simple-mp4" poster="/simple.png" src="/simple.mp4" x-webkit-airplay="deny"></video>
+
+    <!-- FAIL: opt-in and src uses a ogg extension -->
+    <video id="opt-in-simple-fail" src="/simple.ogg" x-webkit-airplay="allow"></video>
+
+    <!-- PASS: video with opt-in and source list uses a mp4 extension -->
+    <video id="opt-in-with-sources-mp4" x-webkit-airplay="allow">
+      <source src="/simple.ogg">
+      <source src="/simple.mp4">
+    </video>
+
+    <!-- FAIL: video with opt-out and source list uses a mp4 extension -->
+    <video id="opt-out-with-sources-mp4" x-webkit-airplay="deny">
+      <source src="/simple.ogg">
+      <source src="/simple.mp4">
+    </video>
   </body>
 </html>