Created
June 30, 2013 23:18
-
-
Save erikvold/5897402 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.testButtonToOpenXToClose = function(assert, done) { | |
const { Sidebar } = require('sdk/ui/sidebar'); | |
let testName = 'testButtonToOpenXToClose'; | |
let title = testName; | |
let url = 'data:text/html;charset=utf-8,' + testName; | |
let window = getMostRecentBrowserWindow(); | |
let sidebar = Sidebar({ | |
id: testName, | |
title: testName, | |
icon: BLANK_IMG, | |
url: url, | |
onShow: function() { | |
assert.equal(button.getAttribute('checked'), 'true', 'button is checked'); | |
let closeButton = window.document.querySelector('#sidebar-header > toolbarbutton.tabs-closebutton'); | |
simulateCommand(button); | |
}, | |
onHide: function() { | |
assert.equal(button.getAttribute('checked') || 'false', 'false', 'button is not checked'); | |
sidebar.destroy(); | |
done(); | |
} | |
}); | |
let { node: button } = getWidget(sidebar.id, window); | |
assert.equal(button.getAttribute('checked') || 'false', 'false', 'button is not checked'); | |
simulateCommand(button); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment