Skip to content
This repository has been archived by the owner on Feb 26, 2022. It is now read-only.

Commit

Permalink
Bug 911071 - Merely getting more information about failures
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvold committed Sep 25, 2013
1 parent a1928c9 commit 5284a4d
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions test/addons/private-browsing-supported/test-panel.js
Expand Up @@ -3,6 +3,7 @@
const { open, focus, close } = require('sdk/window/helpers');
const { isPrivate } = require('sdk/private-browsing');
const { defer } = require('sdk/core/promise');
const { browserWindows: windows } = require('sdk/windows');

const BROWSER = 'chrome://browser/content/browser.xul';

Expand All @@ -16,6 +17,11 @@ exports.testShowPanelInPrivateWindow = function(assert, done) {
contentURL: "data:text/html;charset=utf-8,"
});

assert.ok(windows.length > 0, 'there is at least one open window');
for (let window of windows) {
assert.equal(isPrivate(window), false, 'open window is private');
}

testShowPanel(assert, panel).
then(makeEmptyPrivateBrowserWindow).
then(focus).
Expand Down Expand Up @@ -63,20 +69,25 @@ function makeEmptyPrivateBrowserWindow(options) {

function testShowPanel(assert, panel) {
let { promise, resolve } = defer();
let shown = false;

assert.ok(!panel.isShowing, 'the panel is not showing [1]');

panel.once('show', function() {
assert.ok(panel.isShowing, 'the panel is showing');
panel.once('hide', function() {
assert.ok(!panel.isShowing, 'the panel is not showing [2]');
assert.ok(shown, 'the panel was shown')

panel.once('hide', function() {
assert.ok(!panel.isShowing, 'the panel is not showing [2]');
resolve(null);
});

resolve(null);
});
panel.once('show', function() {
shown = true;

assert.ok(panel.isShowing, 'the panel is showing');

panel.hide();
})
});

panel.show();

return promise;
Expand Down

0 comments on commit 5284a4d

Please sign in to comment.