Bug 1115153 - Loop: Create API to allow web to retrieve the loop.gettingStarted.seen pref. r=MattN

This commit is contained in:
Jared Wein 2015-01-29 13:08:08 -05:00
Родитель cb92dbbbf6
Коммит 0c7b831923
2 изменённых файлов: 21 добавлений и 8 удалений

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

@ -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");