зеркало из https://github.com/mozilla/gecko-dev.git
Back out 9c064c78d86a (bug 799600) for orange
--HG-- extra : rebase_source : 464d1ff3410f2382b8b0f9c204734517178b354f
This commit is contained in:
Родитель
a0bef74bc4
Коммит
140f41a6be
|
@ -96,48 +96,6 @@ var tests = {
|
||||||
document.getElementById("menu_ToolsPopup").openPopup();
|
document.getElementById("menu_ToolsPopup").openPopup();
|
||||||
}, "statusIcon was never found");
|
}, "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) {
|
testProfileUnset: function(next) {
|
||||||
Social.provider.updateUserProfile({});
|
Social.provider.updateUserProfile({});
|
||||||
// check dom values
|
// check dom values
|
||||||
|
|
|
@ -74,10 +74,7 @@ function attachToWindow(provider, targetWindow) {
|
||||||
// the mozSocial API.
|
// the mozSocial API.
|
||||||
let origin = provider.origin;
|
let origin = provider.origin;
|
||||||
let targetDocURI = targetWindow.document.documentURIObject;
|
let targetDocURI = targetWindow.document.documentURIObject;
|
||||||
// We allow data: URLs as it might be far more efficient for a provider to
|
if (provider.origin != targetDocURI.prePath) {
|
||||||
// synthesize a data URL from content already loaded in its sidebar or
|
|
||||||
// worker.
|
|
||||||
if (provider.origin != targetDocURI.prePath && targetDocURI.scheme != "data") {
|
|
||||||
let msg = "MozSocialAPI: not attaching mozSocial API for " + origin +
|
let msg = "MozSocialAPI: not attaching mozSocial API for " + origin +
|
||||||
" to " + targetDocURI.spec + " since origins differ."
|
" to " + targetDocURI.spec + " since origins differ."
|
||||||
Services.console.logStringMessage(msg);
|
Services.console.logStringMessage(msg);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче