Back out 9c064c78d86a (bug 799600) for orange
authorPhil Ringnalda <philringnalda@gmail.com>
Fri, 26 Oct 2012 19:19:56 -0700
changeset 111732 ba9fb2ed910cf0e8a899d689eb8c898994a4e060
parent 111731 466970462253ce1bb72e570df3f1e2a6acadc509
child 111733 485735473745d9f51e1a4c8014e6945856bf7f6d
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
bugs799600
milestone19.0a1
backs out9c064c78d86aeb5b37cbd595484475bc150ee9ff
Back out 9c064c78d86a (bug 799600) for orange
browser/base/content/test/browser_social_toolbar.js
toolkit/components/social/MozSocialAPI.jsm
--- a/browser/base/content/test/browser_social_toolbar.js
+++ b/browser/base/content/test/browser_social_toolbar.js
@@ -91,58 +91,16 @@ var tests = {
         let menuitem = socialToggleMore.querySelector("menuitem");
         is(menuitem.getAttribute("label"), "Test Ambient 1", "Keyboard accessible ambient menuitem should have specified label");
         toolsPopup.hidePopup();
         next();
       }, false);
       document.getElementById("menu_ToolsPopup").openPopup();
     }, "statusIcon was never found");
   },
-  testAmbientNotificationContent: function(next) {
-    let ambience = {
-      name: "testIcon",
-      iconURL: "https://example.com/browser/browser/base/content/test/moz.png",
-      contentPanel: "data:text/html;charset=utf-8," +
-                    encodeURI('<html><body><div id="testdiv"/></body></html>'),
-      counter: 42,
-      label: "Test Ambient 1",
-      menuURL: "https://example.com/testAmbient1"
-    };
-    Social.provider.setAmbientNotification(ambience);
-
-    let statusIcon = document.querySelector("#social-toolbar-item > box");
-    waitForCondition(function() {
-      statusIcon = document.querySelector("#social-toolbar-item > box");
-      return !!statusIcon;
-    }, function () {
-      let panel = document.getElementById("social-notification-panel");
-      panel.addEventListener("popupshown", function ontoolspopupshownAmbient() {
-        panel.removeEventListener("popupshown", ontoolspopupshownAmbient);
-        let iframe = panel.firstChild;
-        let afterLoad = function() {
-          ok(iframe.contentDocument.getElementById("testdiv"), "could find our div in the content");
-          ok(iframe.contentWindow.wrappedJSObject.navigator.mozSocial, "data: panel has mozSocial object");
-          panel.addEventListener("popuphidden", function popuphidden() {
-            panel.removeEventListener("popuphidden", popuphidden);
-            next();
-          });
-          panel.hidePopup();
-        }
-        if (iframe.contentDocument.readyState == "loading") {
-          iframe.contentWindow.addEventListener("load", function frame_load() {
-            iframe.contentWindow.removeEventListener("load", frame_load, true);
-            executeSoon(afterLoad);
-          }, true);
-        } else {
-          afterLoad();
-        }
-      });
-      panel.openPopup();
-    }, "statusIcon was never found");
-  },
   testProfileUnset: function(next) {
     Social.provider.updateUserProfile({});
     // check dom values
     let userButton = document.getElementById("social-statusarea-username");
     ok(userButton.hidden, "username is not visible");
     let ambientIcons = document.querySelectorAll("#social-toolbar-item > box");
     for (let ambientIcon of ambientIcons) {
       ok(ambientIcon.collapsed, "ambient icon (" + ambientIcon.id + ") is collapsed");
--- a/toolkit/components/social/MozSocialAPI.jsm
+++ b/toolkit/components/social/MozSocialAPI.jsm
@@ -69,20 +69,17 @@ function injectController(doc, topic, da
 }
 
 // Loads mozSocial support functions associated with provider into targetWindow
 function attachToWindow(provider, targetWindow) {
   // If the loaded document isn't from the provider's origin, don't attach
   // the mozSocial API.
   let origin = provider.origin;
   let targetDocURI = targetWindow.document.documentURIObject;
-  // We allow data: URLs as it might be far more efficient for a provider to
-  // synthesize a data URL from content already loaded in its sidebar or
-  // worker.
-  if (provider.origin != targetDocURI.prePath && targetDocURI.scheme != "data") {
+  if (provider.origin != targetDocURI.prePath) {
     let msg = "MozSocialAPI: not attaching mozSocial API for " + origin +
               " to " + targetDocURI.spec + " since origins differ."
     Services.console.logStringMessage(msg);
     return;
   }
 
   var port = provider.getWorkerPort(targetWindow);