зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1115153 - Loop: Create API to allow web to retrieve the loop.gettingStarted.seen pref. r=MattN
This commit is contained in:
Родитель
cb92dbbbf6
Коммит
0c7b831923
|
@ -1559,20 +1559,20 @@ this.UITour = {
|
|||
|
||||
getConfiguration: function(aMessageManager, aWindow, aConfiguration, aCallbackID) {
|
||||
switch (aConfiguration) {
|
||||
case "availableTargets":
|
||||
this.getAvailableTargets(aMessageManager, aWindow, aCallbackID);
|
||||
break;
|
||||
case "sync":
|
||||
this.sendPageCallback(aMessageManager, aCallbackID, {
|
||||
setup: Services.prefs.prefHasUserValue("services.sync.username"),
|
||||
});
|
||||
break;
|
||||
case "appinfo":
|
||||
let props = ["defaultUpdateChannel", "version"];
|
||||
let appinfo = {};
|
||||
props.forEach(property => appinfo[property] = Services.appinfo[property]);
|
||||
this.sendPageCallback(aMessageManager, aCallbackID, appinfo);
|
||||
break;
|
||||
case "availableTargets":
|
||||
this.getAvailableTargets(aMessageManager, aWindow, aCallbackID);
|
||||
break;
|
||||
case "loop":
|
||||
this.sendPageCallback(aMessageManager, aCallbackID, {
|
||||
gettingStartedSeen: Services.prefs.getBoolPref("loop.gettingStarted.seen"),
|
||||
});
|
||||
break;
|
||||
case "selectedSearchEngine":
|
||||
Services.search.init(rv => {
|
||||
let engine;
|
||||
|
@ -1586,6 +1586,11 @@ this.UITour = {
|
|||
});
|
||||
});
|
||||
break;
|
||||
case "sync":
|
||||
this.sendPageCallback(aMessageManager, aCallbackID, {
|
||||
setup: Services.prefs.prefHasUserValue("services.sync.username"),
|
||||
});
|
||||
break;
|
||||
default:
|
||||
log.error("getConfiguration: Unknown configuration requested: " + aConfiguration);
|
||||
break;
|
||||
|
|
|
@ -60,6 +60,14 @@ let tests = [
|
|||
done();
|
||||
});
|
||||
},
|
||||
function test_getConfigurationLoop(done) {
|
||||
let gettingStartedSeen = Services.prefs.getBoolPref("loop.gettingStarted.seen");
|
||||
gContentAPI.getConfiguration("loop", (data) => {
|
||||
is(data.gettingStartedSeen, gettingStartedSeen,
|
||||
"The configuration property should equal that of the pref");
|
||||
done();
|
||||
});
|
||||
},
|
||||
function test_hideMenuHidesAnnotations(done) {
|
||||
let infoPanel = document.getElementById("UITourTooltip");
|
||||
let highlightPanel = document.getElementById("UITourHighlightContainer");
|
||||
|
|
Загрузка…
Ссылка в новой задаче