Bug 1001279 - Add support of websites to opt-out of casting videos (tests). r=wesj, a=sledru
authorMark Finkle <mfinkle@mozilla.com>
Thu, 01 May 2014 17:29:03 -0400
changeset 200176 71190db0a57fc7915afb5aaba336f6056e580cfb
parent 200175 b3973b49fe6c71bc64ce6b13bf3200093f591733
child 200177 54f1c073c4b54db77182de9a30428162e225742f
push id486
push userasasaki@mozilla.com
push dateMon, 14 Jul 2014 18:39:42 +0000
treeherdermozilla-release@d33428174ff1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswesj, sledru
bugs1001279
milestone31.0a2
Bug 1001279 - Add support of websites to opt-out of casting videos (tests). r=wesj, a=sledru
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>