From 048340d37f75a295887bb0fd68121ce3f8212e18 Mon Sep 17 00:00:00 2001 From: Serge Gautherie Date: Fri, 23 Dec 2011 04:09:47 +0100 Subject: [PATCH] Bug 712871. (Fv1) Port bug 682618 ('lastElement'), Port bug 46555 ('context-selectall' fix). r=neil. --- suite/browser/test/mochitest/test_contextmenu.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/suite/browser/test/mochitest/test_contextmenu.html b/suite/browser/test/mochitest/test_contextmenu.html index 007d781738..8ae985ca58 100644 --- a/suite/browser/test/mochitest/test_contextmenu.html +++ b/suite/browser/test/mochitest/test_contextmenu.html @@ -28,6 +28,10 @@ function openContextMenuFor(element, shiftkey) { // Context menu should be closed before we open it again. is(contextMenu.state, "closed", "checking if popup is closed"); + if (lastElement) + lastElement.blur(); + element.focus(); + lastElement = element; var eventDetails = { type : "contextmenu", button : 2, shiftKey : shiftkey }; synthesizeMouse(element, 2, 2, eventDetails, element.ownerDocument.defaultView); } @@ -304,7 +308,7 @@ function runTest(testNum) { "context-paste", null, // ignore clipboard state "context-delete", false, "---", null, - "context-selectall", true, + "context-selectall", false, "---", null, "spell-check-enabled", true]); closeContextMenu() @@ -677,7 +681,7 @@ function runTest(testNum) { var testNum = 1; -var subwindow, chromeWin, contextMenu; +var subwindow, chromeWin, contextMenu, lastElement; var text, link, mailto, input, img, img_link, img_mailto, canvas, video_ok, video_bad, video_bad2, iframe, textarea, contenteditable, inputspell, pagemenu; @@ -701,6 +705,8 @@ function startTest() { return; } + lastElement = null; + text = subwindow.document.getElementById("test-text"); link = subwindow.document.getElementById("test-link"); mailto = subwindow.document.getElementById("test-mailto");