Bug 759964 - Part 2 - Set allowMedia = false in social and identity code to address TODO comments. r=gavin
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Fri, 29 Mar 2013 14:52:59 -0700
changeset 146512 8830e3fe79ffceeb55f3f9dd3c485ccf1abf7816
parent 146511 ce02e3335eb79b233f912227c45f56bfe6ae8ece
child 146513 6970e918f924cd0fcd0561b58bc47cb9301d2da9
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs759964
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 759964 - Part 2 - Set allowMedia = false in social and identity code to address TODO comments. r=gavin
toolkit/components/social/FrameWorker.jsm
toolkit/identity/Sandbox.jsm
toolkit/identity/tests/chrome/test_sandbox.xul
--- a/toolkit/components/social/FrameWorker.jsm
+++ b/toolkit/components/social/FrameWorker.jsm
@@ -340,18 +340,18 @@ function makeHiddenFrame() {
 
   hiddenDoc.documentElement.appendChild(iframe);
 
   // Disable some types of content
   let docShell = iframe.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDocShell);
   docShell.allowAuth = false;
   docShell.allowPlugins = false;
   docShell.allowImages = false;
+  docShell.allowMedia = false;
   docShell.allowWindowControl = false;
-  // TODO: disable media (bug 759964)
   return iframe;
 }
 
 // public methods on WorkerHandle should conform to the SharedWorker api
 function WorkerHandle(port, worker) {
   this.port = port;
   this._worker = worker;
 }
--- a/toolkit/identity/Sandbox.jsm
+++ b/toolkit/identity/Sandbox.jsm
@@ -94,18 +94,18 @@ this.Sandbox.prototype = {
 
     // Stop about:blank from being loaded.
     docShell.stop(Ci.nsIWebNavigation.STOP_NETWORK);
 
     // Disable some types of content
     docShell.allowAuth = false;
     docShell.allowPlugins = false;
     docShell.allowImages = false;
+    docShell.allowMedia = false;
     docShell.allowWindowControl = false;
-    // TODO: disable media (bug 759964)
 
     // Disable stylesheet loading since the document is not visible.
     let markupDocViewer = docShell.contentViewer
                                   .QueryInterface(Ci.nsIMarkupDocumentViewer);
     markupDocViewer.authorStyleDisabled = true;
 
     // Set instance properties.
     this._frame = frame;
--- a/toolkit/identity/tests/chrome/test_sandbox.xul
+++ b/toolkit/identity/tests/chrome/test_sandbox.xul
@@ -28,17 +28,16 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 SimpleTest.expectAssertions(2);
 
 SimpleTest.waitForExplicitFinish();
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
-const OSX_10_5 = navigator.oscpu == "Intel Mac OS X 10.5";
 
 const secMan = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(Ci.nsIScriptSecurityManager);
 
 const TEST_URL_1 = "https://example.com/";
 // No trailing slash plus port to test normalization
 const TEST_URL_2 = "https://example.com:443";
 
 const TEST_BASE = "http://mochi.test:8888/chrome/toolkit/identity/tests/chrome/"
@@ -126,30 +125,28 @@ function check_loaded_content(aSandbox, 
   let xhr = new XMLHttpRequest();
   xhr.open("GET", STATE_URL + "?get_loaded", true);
   xhr.onload = function() {
     let res = xhr.responseText;
     is(xhr.status, 200, "Check successful response");
 
     if (aNothingShouldLoad) {
       is(res, "NOTHING", "Check that nothing was loaded on the server");
-    } else if (!OSX_10_5) {
-      let allowedTypes = [ "application/javascript", "text/html", "video/webm",
-                           "audio/ogg", "application/x-test" ];
+    } else {
+      let allowedTypes = [ "application/javascript", "text/html", "application/x-test" ];
       let loadedTypes = res == "NOTHING" ? [] : res.split(",");
 
       for (let loadedType of loadedTypes) {
-        isnot(allowedTypes.indexOf(loadedType), -1, "Check that " + loadedType + " was expected to load");
+        isnot(allowedTypes.indexOf(loadedType), -1, "Check that " + loadedType + " was expected to load"); // TODO
       }
 
-      // TODO: Media should be disabled after bug 759964.
       isnot(loadedTypes.indexOf("application/javascript"), -1, "Check JS was loaded");
       isnot(loadedTypes.indexOf("text/html"), -1, "Check iframe was loaded");
-      //todo_is(loadedTypes.indexOf("video/webm"), -1, "Check webm was not loaded");
-      //todo_is(loadedTypes.indexOf("audio/ogg"), -1, "Check ogg was not loaded");
+      is(loadedTypes.indexOf("video/webm"), -1, "Check webm was not loaded");
+      is(loadedTypes.indexOf("audio/ogg"), -1, "Check ogg was not loaded");
 
       // Check that no plugin tags have a type other than TYPE_NULL (failed load)
       // --
       // Checking if a channel was opened is not sufficient for plugin tags --
       // An object tag may still be allowed to load a sub-document, but not a
       // plugin, so it will open a channel but then abort when it gets a
       // plugin-type.
       let doc = aSandbox._frame.contentDocument;