Bug 1063698 - Add action to UITour.jsm for opening the Reset Firefox dialog. r=Unfocused

This commit is contained in:
Alex Bardas 2014-09-17 14:58:00 +02:00
parent 63b96e9311
commit dc386bd89a
4 changed files with 53 additions and 0 deletions

View File

@ -16,6 +16,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager",
"resource://gre/modules/LightweightThemeManager.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PermissionsUtils",
"resource://gre/modules/PermissionsUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ResetProfile",
"resource://gre/modules/ResetProfile.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
"resource:///modules/CustomizableUI.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "UITelemetry",
@ -427,6 +429,12 @@ this.UITour = {
contentDocument.location.href = "about:accounts?action=signup&entrypoint=uitour";
break;
}
case "resetFirefox": {
// Open a reset profile dialog window.
ResetProfile.openConfirmationDialog(window);
break;
}
}
if (!this.originTabs.has(window))

View File

@ -34,6 +34,8 @@ skip-if = true # Disabled due to frequent failures, bugs 1026310 and 1032137
skip-if = e10s # Bug 941428 - UITour.jsm not e10s friendly
[browser_UITour_sync.js]
skip-if = e10s # Bug 941428 - UITour.jsm not e10s friendly
[browser_UITour_resetProfile.js]
skip-if = e10s # Bug 941428 - UITour.jsm not e10s friendly
[browser_taskbar_preview.js]
run-if = os == "win"
skip-if = e10s # Bug 666808 - AeroPeek support for e10s

View File

@ -0,0 +1,39 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
let gTestTab;
let gContentAPI;
let gContentWindow;
Components.utils.import("resource:///modules/UITour.jsm");
function test() {
UITourTest();
}
let tests = [
// Test that a reset profile dialog appears when "resetFirefox" event is triggered
function test_resetFirefox(done) {
let winWatcher = Cc["@mozilla.org/embedcomp/window-watcher;1"].
getService(Ci.nsIWindowWatcher);
winWatcher.registerNotification(function onOpen(subj, topic, data) {
if (topic == "domwindowopened" && subj instanceof Ci.nsIDOMWindow) {
subj.addEventListener("load", function onLoad() {
subj.removeEventListener("load", onLoad);
if (subj.document.documentURI ==
"chrome://global/content/resetProfile.xul") {
winWatcher.unregisterNotification(onOpen);
ok(true, "Observed search manager window open");
is(subj.opener, window,
"Reset Firefox event opened a reset profile window.");
subj.close();
done();
}
});
}
});
gContentAPI.resetFirefox();
},
];

View File

@ -179,4 +179,8 @@ if (typeof Mozilla == 'undefined') {
_sendEvent('showFirefoxAccounts');
};
Mozilla.UITour.resetFirefox = function() {
_sendEvent('resetFirefox');
};
})();