Backed out changesets cf64922197ca, 3ae60bdf3fef, and 68960c6bdce3 (bug 906839) for ASAN mochitest-bc perma-orange.

This commit is contained in:
Ryan VanderMeulen 2013-11-04 15:54:55 -05:00
Родитель f27cddae88
Коммит 3f0ca7f5e4
8 изменённых файлов: 45 добавлений и 55 удалений

Просмотреть файл

@ -1295,8 +1295,6 @@ pref("social.manifest.facebook", "{\"origin\":\"https://www.facebook.com\",\"nam
pref("social.sidebar.open", true);
pref("social.sidebar.unload_timeout_ms", 10000);
pref("social.allowMultipleWorkers", true);
pref("dom.identity.enabled", false);
// Turn on the CSP 1.0 parser for Content Security Policy headers

Просмотреть файл

@ -51,6 +51,18 @@ function waitPrefChange(cb) {
}, false);
}
function setWorkerMode(multiple, cb) {
waitPrefChange(function() {
if (multiple)
Services.prefs.setBoolPref("social.allowMultipleWorkers", true);
else
Services.prefs.clearUserPref("social.allowMultipleWorkers");
waitPrefChange(cb);
Social.enabled = true;
});
Social.enabled = false;
}
function test() {
requestLongerTimeout(2); // only debug builds seem to need more time...
waitForExplicitFinish();
@ -63,15 +75,8 @@ function test() {
ok(chats.children.length == 0, "no chatty children left behind");
cb();
};
// always run chat tests with multiple workers.
Services.prefs.setBoolPref("social.allowMultipleWorkers", true);
runSocialTestWithProvider(manifests, function (finishcb) {
ok(Social.enabled, "Social is enabled");
ok(Social.providers[0].getWorkerPort(), "provider 0 has port");
ok(Social.providers[1].getWorkerPort(), "provider 1 has port");
ok(Social.providers[2].getWorkerPort(), "provider 2 has port");
runSocialTests(tests, undefined, postSubTest, function() {
Services.prefs.clearUserPref("social.allowMultipleWorkers");
window.moveTo(oldleft, window.screenY)
window.resizeTo(oldwidth, window.outerHeight);
finishcb();
@ -512,31 +517,30 @@ var tests = {
});
},
testMultipleProviderChat: function(next) {
// test incomming chats from all providers
openChat(Social.providers[0], function() {
openChat(Social.providers[1], function() {
openChat(Social.providers[2], function() {
let chats = document.getElementById("pinnedchats");
waitForCondition(function() chats.children.length == Social.providers.length,
function() {
ok(true, "one chat window per provider opened");
// test logout of a single provider
let provider = Social.providers[2];
let port = provider.getWorkerPort();
port.postMessage({topic: "test-logout"});
waitForCondition(function() chats.children.length == Social.providers.length - 1,
function() {
chats.removeAll();
waitForCondition(function() chats.children.length == 0,
function() {
ok(!chats.selectedChat, "multiprovider chats are all closed");
port.close();
next();
},
"chat windows didn't close");
},
"chat window didn't close");
}, "chat windows did not open");
// while pref'd off, we need to set the worker mode to multiple providers
setWorkerMode(true, function() {
// test incomming chats from all providers
openChat(Social.providers[0], function() {
openChat(Social.providers[1], function() {
openChat(Social.providers[2], function() {
let chats = document.getElementById("pinnedchats");
waitForCondition(function() chats.children.length == Social.providers.length,
function() {
ok(true, "one chat window per provider opened");
// test logout of a single provider
let provider = Social.providers[0];
let port = provider.getWorkerPort();
port.postMessage({topic: "test-logout"});
waitForCondition(function() chats.children.length == Social.providers.length - 1,
function() {
port.close();
chats.removeAll();
ok(!chats.selectedChat, "chats are all closed");
setWorkerMode(false, next);
},
"chat window didn't close");
}, "chat windows did not open");
});
});
});
});
@ -574,10 +578,6 @@ var tests = {
break;
}
}
// make sure a user profile is set for this provider as chat windows are
// only closed on *change* of the profile data rather than merely setting
// profile data.
port.postMessage({topic: "test-set-profile"});
port.postMessage({topic: "test-init"});
}
}

Просмотреть файл

@ -113,17 +113,15 @@ var tests = {
port.postMessage({topic: "test-flyout-open"});
break;
case "got-flyout-visibility":
if (e.data.result != "shown")
return;
let iframe = panel.firstChild;
iframe.contentDocument.addEventListener("SocialTest-DoneCloseSelf", function _doneHandler() {
iframe.contentDocument.removeEventListener("SocialTest-DoneCloseSelf", _doneHandler, false);
port.close();
is(panel.state, "closed", "flyout should have closed itself");
Services.prefs.setBoolPref(ALLOW_SCRIPTS_TO_CLOSE_PREF, oldAllowScriptsToClose);
next();
}, false);
is(panel.state, "open", "flyout should be open");
port.close(); // so we don't get the -visibility message as it hides...
SocialFlyout.dispatchPanelEvent("socialTest-CloseSelf");
break;
}

Просмотреть файл

@ -84,8 +84,6 @@ onconnect = function(e) {
// For multiprovider tests, we support acting like different providers
// based on the domain we load from.
apiPort = port;
// purposely fall through and set the profile on initialization
case "test-set-profile":
let profile;
if (location.href.indexOf("https://test1.example.com") == 0) {
profile = {
@ -101,7 +99,7 @@ onconnect = function(e) {
profileURL: "http://en.wikipedia.org/wiki/Kuma_Lisa"
};
}
apiPort.postMessage({topic: "social.user-profile", data: profile});
port.postMessage({topic: "social.user-profile", data: profile});
break;
case "test-ambient-notification":
apiPort.postMessage({topic: "social.ambient-notification", data: event.data.data});

Просмотреть файл

@ -95,7 +95,8 @@ this.Social = {
_disabledForSafeMode: false,
get allowMultipleWorkers() {
return Services.prefs.getBoolPref("social.allowMultipleWorkers");
return Services.prefs.prefHasUserValue("social.allowMultipleWorkers") &&
Services.prefs.getBoolPref("social.allowMultipleWorkers");
},
get _currentProviderPref() {
@ -140,7 +141,6 @@ this.Social = {
let enabled = !!provider;
if (enabled != SocialService.enabled) {
SocialService.enabled = enabled;
this._updateWorkerState(enabled);
}
let origin = this._provider && this._provider.origin;

Просмотреть файл

@ -199,13 +199,15 @@ function makeRemoteBrowser() {
let browser = iframe.contentDocument.createElementNS(XUL_NS, "browser");
browser.setAttribute("type", "content");
browser.setAttribute("disableglobalhistory", "true");
let remote;
// for now we use the same preference that enabled multiple workers - the
// idea is that there is no point in having people help test multiple
// "old" frameworkers - so anyone who wants multiple workers is forced to
// help us test remote frameworkers too.
if (Services.prefs.getBoolPref("social.allowMultipleWorkers"))
if (Services.prefs.prefHasUserValue("social.allowMultipleWorkers") &&
Services.prefs.getBoolPref("social.allowMultipleWorkers")) {
browser.setAttribute("remote", "true");
}
iframe.contentDocument.documentElement.appendChild(browser);
deferred.resolve(browser);
}, true);

Просмотреть файл

@ -62,7 +62,7 @@ let tests = {
};
SocialService.addProvider(manifest, function (provider2) {
ok(provider.enabled, "provider is initially enabled");
is(provider2.enabled, Services.prefs.getBoolPref("social.allowMultipleWorkers"), "provider2 is enabled status is correct");
ok(!provider2.enabled, "provider2 is not initially enabled");
provider2.enabled = true;
let port = provider.getWorkerPort();
let port2 = provider2.getWorkerPort();

Просмотреть файл

@ -49,11 +49,6 @@ let tests = {
},
// when the client closes early but the worker tries to send anyway...
// XXX - disabled due to bug 919878 - we close the frameworker before the
// remote browser has completed initializing, leading to failures. Given
// this can realistically only happen in this synthesized test environment,
// disabling just this test seems OK for now.
/***
testEarlyClose: function(cbnext) {
let run = function() {
onconnect = function(e) {
@ -67,7 +62,6 @@ let tests = {
worker.terminate();
cbnext();
},
***/
// Check we do get a social.port-closing message as the port is closed.
testPortClosingMessage: function(cbnext) {