mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-24 05:44:10 +00:00
Bug 1026614 - SDK ui/toolbar not working in permanent private browsing. r=rpl
MozReview-Commit-ID: Ap4CTY13P3d --HG-- extra : transplant_source : %AEn%60%F3R%E4%DA%C5%9C%B5%DD%EF%C4%DF%AC%F3%AE%DC%27%09
This commit is contained in:
parent
71d53d758e
commit
c6650b1edb
@ -17,7 +17,7 @@ const { Sequence, seq, filter, object, pairs } = require("../util/sequence");
|
||||
// When iterated over belowe sequences items will represent
|
||||
// state of windows at the time of iteration.
|
||||
const opened = seq(function*() {
|
||||
const items = windows("navigator:browser", {includePrivates: true});
|
||||
const items = windows("navigator:browser", {includePrivate: true});
|
||||
for (let item of items) {
|
||||
yield [getOuterId(item), item];
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ const { curry, flip } = require("../../lang/functional");
|
||||
const { patch, diff } = require("diffpatcher/index");
|
||||
const prefs = require("../../preferences/service");
|
||||
const { getByOuterId } = require("../../window/utils");
|
||||
const { ignoreWindow } = require('../../private-browsing/utils');
|
||||
|
||||
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
const PREF_ROOT = "extensions.sdk-toolbar-collapsed.";
|
||||
@ -85,7 +86,10 @@ const attributesChanged = mutations => {
|
||||
// Utility function creates `toolbar` with a "close" button and returns
|
||||
// it back. In addition it set's up a listener and observer to communicate
|
||||
// state changes.
|
||||
const addView = curry((options, {document}) => {
|
||||
const addView = curry((options, {document, window}) => {
|
||||
if (ignoreWindow(window))
|
||||
return;
|
||||
|
||||
let view = document.createElementNS(XUL_NS, "toolbar");
|
||||
view.setAttribute("id", options.id);
|
||||
view.setAttribute("collapsed", options.collapsed);
|
||||
|
@ -492,4 +492,20 @@ exports["test button are attached to toolbar"] = function*(assert) {
|
||||
yield cleanUI();
|
||||
};
|
||||
|
||||
exports["test toolbar are not in private windows"] = function*(assert) {
|
||||
const w = open(null, {features: {toolbar: true, private: true}});
|
||||
|
||||
yield ready(w);
|
||||
|
||||
const t = new Toolbar({title: "foo"});
|
||||
|
||||
yield wait(t, "attach");
|
||||
|
||||
assert.ok(!isAttached(t), "toolbar wasn't actually attached");
|
||||
|
||||
t.destroy();
|
||||
|
||||
yield cleanUI();
|
||||
}
|
||||
|
||||
require("sdk/test").run(module.exports);
|
||||
|
Loading…
x
Reference in New Issue
Block a user