зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1229168 - UITour: Use the correct window in initForBrowser to handle windows with no tabs. r=Dexter
--HG-- extra : commitid : KqRYnsV6Z9M extra : rebase_source : 3149ba3d9b48cb284607fa14a60dd645c686d359
This commit is contained in:
Родитель
4d0b5df661
Коммит
ed06cf5e06
|
@ -218,7 +218,7 @@ var TrackingProtection = {
|
|||
];
|
||||
|
||||
let panelTarget = yield UITour.getTarget(window, "trackingProtection");
|
||||
UITour.initForBrowser(gBrowser.selectedBrowser);
|
||||
UITour.initForBrowser(gBrowser.selectedBrowser, window);
|
||||
UITour.showInfo(window, mm, panelTarget,
|
||||
gNavigatorBundle.getString("trackingProtection.intro.title"),
|
||||
gNavigatorBundle.getFormattedString("trackingProtection.intro.description",
|
||||
|
|
|
@ -735,13 +735,12 @@ this.UITour = {
|
|||
}
|
||||
}
|
||||
|
||||
this.initForBrowser(browser);
|
||||
this.initForBrowser(browser, window);
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
initForBrowser(aBrowser) {
|
||||
let window = aBrowser.ownerDocument.defaultView;
|
||||
initForBrowser(aBrowser, window) {
|
||||
let gBrowser = window.gBrowser;
|
||||
|
||||
if (gBrowser) {
|
||||
|
|
|
@ -146,6 +146,29 @@ add_task(function* test_selfSupport() {
|
|||
uitourAPI.ping(resolve);
|
||||
});
|
||||
yield pingPromise;
|
||||
info("Ping succeeded");
|
||||
|
||||
let observePromise = ContentTask.spawn(selfSupportBrowser, null, function* checkObserve() {
|
||||
yield new Promise(resolve => {
|
||||
let win = Cu.waiveXrays(content);
|
||||
win.Mozilla.UITour.observe((event, data) => {
|
||||
if (event != "Heartbeat:Engaged") {
|
||||
return;
|
||||
}
|
||||
is(data.flowId, "myFlowID", "Check flowId");
|
||||
ok(!!data.timestamp, "Check timestamp");
|
||||
resolve(data);
|
||||
}, () => {});
|
||||
});
|
||||
});
|
||||
|
||||
info("Notifying Heartbeat:Engaged");
|
||||
UITour.notify("Heartbeat:Engaged", {
|
||||
flowId: "myFlowID",
|
||||
timestamp: Date.now(),
|
||||
});
|
||||
yield observePromise;
|
||||
info("Observed in the hidden frame");
|
||||
|
||||
// Close SelfSupport from content.
|
||||
contentWindow.close();
|
||||
|
|
Загрузка…
Ссылка в новой задаче