Bug 963067 - 'Cut' in the cut, copy, paste menu is always active after a browser launch. r=jimm

This commit is contained in:
Aleh Zasypkin 2014-02-03 09:43:43 -05:00
parent e90c22e00c
commit dc23e6347a
2 changed files with 38 additions and 0 deletions

View File

@ -167,6 +167,7 @@ var ContextMenuUI = {
for (let command of Array.slice(this.commands.childNodes)) {
command.hidden = true;
command.selected = false;
}
let optionsAvailable = false;

View File

@ -874,6 +874,43 @@ gTests.push({
}
});
gTests.push({
desc: "Bug 963067 - 'Cut' in the cut, copy, paste menu is always active " +
"after a browser launch.",
run: function test() {
info(chromeRoot + "browser_context_menu_tests_02.html");
yield addTab(chromeRoot + "browser_context_menu_tests_02.html");
purgeEventQueue();
emptyClipboard();
ContextUI.dismiss();
yield waitForCondition(() => !ContextUI.navbarVisible);
let tabWindow = Browser.selectedTab.browser.contentWindow;
let input = tabWindow.document.getElementById("text3-input");
let cutMenuItem = document.getElementById("context-cut");
input.select();
// Emulate RichListBox's behavior and set first item selected by default.
cutMenuItem.selected = true;
let promise = waitForEvent(document, "popupshown");
sendContextMenuClickToElement(tabWindow, input);
yield promise;
ok(!cutMenuItem.hidden && !cutMenuItem.selected,
"Cut menu item is visible and not selected.");
promise = waitForEvent(document, "popuphidden");
ContextMenuUI.hide();
yield promise;
Browser.closeTab(Browser.selectedTab, { forceClose: true });
}
});
function test() {
setDevPixelEqualToPx();
runTests();