author | Sebastian Hengst <archaeopteryx@coole-files.de> |
Mon, 16 Oct 2017 10:55:46 +0200 | |
changeset 386362 | c6a2643362a67cdf7a87ac165454fce4b383debb |
parent 386344 | 04558b123c59c64b6a869b66d1467fb5be030bb8 (current diff) |
parent 386361 | bfdd78172197790aae1fe8b307602e1a92f27072 (diff) |
child 386363 | 487b027aff460f714f6911b1785adb8eb1619a96 |
child 386552 | 922b9dcf52aa141c2345800dcc6d8654bc831476 |
child 386559 | a52b7ea3d0d4fb3c91bc8d7c3b72d5057fbfb250 |
push id | 53351 |
push user | archaeopteryx@coole-files.de |
push date | Mon, 16 Oct 2017 08:57:58 +0000 |
treeherder | autoland@487b027aff46 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | merge, merge |
milestone | 58.0a1 |
first release with | nightly linux32
c6a2643362a6
/
58.0a1
/
20171016100113
/
files
nightly linux64
c6a2643362a6
/
58.0a1
/
20171016100113
/
files
nightly mac
c6a2643362a6
/
58.0a1
/
20171016100113
/
files
nightly win32
c6a2643362a6
/
58.0a1
/
20171016100113
/
files
nightly win64
c6a2643362a6
/
58.0a1
/
20171016100113
/
files
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
releases | nightly linux32
58.0a1
/
20171016100113
/
pushlog to previous
nightly linux64
58.0a1
/
20171016100113
/
pushlog to previous
nightly mac
58.0a1
/
20171016100113
/
pushlog to previous
nightly win32
58.0a1
/
20171016100113
/
pushlog to previous
nightly win64
58.0a1
/
20171016100113
/
pushlog to previous
|
--- a/accessible/jsat/AccessFu.jsm +++ b/accessible/jsat/AccessFu.jsm @@ -883,17 +883,17 @@ var Input = { }, sendContextMenuMessage: function sendContextMenuMessage() { let mm = Utils.getMessageManager(Utils.CurrentBrowser); mm.sendAsyncMessage("AccessFu:ContextMenu", {}); }, setEditState: function setEditState(aEditState) { - Logger.debug(() => { return ["setEditState", JSON.stringify(aEditState)] }); + Logger.debug(() => { return ["setEditState", JSON.stringify(aEditState)]; }); this.editState = aEditState; }, // XXX: This is here for backwards compatability with screen reader simulator // it should be removed when the extension is updated on amo. scroll: function scroll(aPage, aHorizontal) { this.sendScrollMessage(aPage, aHorizontal); },
--- a/accessible/jsat/EventManager.jsm +++ b/accessible/jsat/EventManager.jsm @@ -475,17 +475,17 @@ this.EventManager.prototype = { return liveAttrs; } let parent = aEvent.targetParent; while (parent) { liveAttrs = parseLiveAttrs(parent); if (liveAttrs) { return liveAttrs; } - parent = parent.parent + parent = parent.parent; } return {}; }; let {live, relevant, /* busy, atomic, memberOf */ } = getLiveAttributes(aEvent); // If container-live is not present or is set to |off| ignore the event. if (!live || live === "off") { return {}; } @@ -507,17 +507,17 @@ this.EventManager.prototype = { let domNode = aLiveRegion.DOMNode; if (this._liveEventQueue && this._liveEventQueue.has(domNode)) { let queue = this._liveEventQueue.get(domNode); let nextEvent = queue[0]; if (nextEvent.eventType === aEventType) { Utils.win.clearTimeout(nextEvent.timeoutID); queue.shift(); if (queue.length === 0) { - this._liveEventQueue.delete(domNode) + this._liveEventQueue.delete(domNode); } } } }, _queueLiveEvent: function _queueLiveEvent(aEventType, aLiveRegion, aIsPolite, aModifiedText) { if (!this._liveEventQueue) { this._liveEventQueue = new WeakMap();
--- a/accessible/tests/mochitest/actions.js +++ b/accessible/tests/mochitest/actions.js @@ -128,41 +128,41 @@ function actionInvoker(aAccOrElmOrId, aA "Wrong action name of the accessible for " + prettyName(aAccOrElmOrId)); try { acc.doAction(aActionIndex); } catch (e) { ok(false, "doAction(" + aActionIndex + ") failed with: " + e.name); return INVOKER_ACTION_FAILED; } - } + }; this.eventSeq = aEventSeq; this.getID = function actionInvoker_getID() { return "invoke an action " + aActionName + " at index " + aActionIndex + " on " + prettyName(aAccOrElmOrId); - } + }; } function checkerOfActionInvoker(aType, aTarget, aActionObj) { this.type = aType; this.target = aTarget; this.phase = false; this.getID = function getID() { return aType + " event handling"; - } + }; this.check = function check(aEvent) { if (aActionObj && "checkOnClickEvent" in aActionObj) aActionObj.checkOnClickEvent(aEvent); - } + }; } var gActionDescrMap = { jump: "Jump", press: "Press", check: "Check", uncheck: "Uncheck",
--- a/accessible/tests/mochitest/actions/test_anchors.html +++ b/accessible/tests/mochitest/actions/test_anchors.html @@ -21,17 +21,17 @@ // ////////////////////////////////////////////////////////////////////////// // Event checkers function scrollingChecker(aAcc) { this.type = EVENT_SCROLLING_START; this.target = aAcc; this.getID = function scrollingChecker_getID() { return "scrolling start handling for " + prettyName(aAcc); - } + }; } // ////////////////////////////////////////////////////////////////////////// // Test // gA11yEventDumpID = "debug"; // debug stuff // gA11yEventDumpToConsole = true; // debug stuff
--- a/accessible/tests/mochitest/actions/test_link.html +++ b/accessible/tests/mochitest/actions/test_link.html @@ -38,21 +38,21 @@ this.type = EVENT_DOCUMENT_LOAD_COMPLETE; this.__defineGetter__("target", getAnchorTargetDocumentAcc); this.check = function linkChecker_check() { var anchorTargetWindow = getAccessible(getAnchorTargetDocumentAcc(), [nsIAccessibleDocument]). window; anchorTargetWindow.close(); - } + }; this.getID = function linkChecker_getID() { return "link '" + aID + "' states check "; - } + }; } // gA11yEventDumpToConsole = true; // enableLogging("tree,eventTree,verbose"); function doTest() { var actionsArray = [ {
--- a/accessible/tests/mochitest/actions/test_media.html +++ b/accessible/tests/mochitest/actions/test_media.html @@ -26,32 +26,32 @@ https://bugzilla.mozilla.org/show_bug.cg // gA11yEventDumpID = "eventDump"; // gA11yEventDumpToConsole = true; // debug stuff function focusChecker(aAcc) { this.type = EVENT_FOCUS; this.target = aAcc; this.getID = function focusChecker_getID() { return "focus handling"; - } + }; this.check = function focusChecker_check(aEvent) { testStates(this.target, STATE_FOCUSED); - } + }; } function nameChecker(aAcc, aName) { this.type = EVENT_NAME_CHANGE; this.target = aAcc; this.getID = function nameChecker_getID() { return "name change handling"; }, this.check = function nameChecker_check(aEvent) { is(aEvent.accessible.name, aName, "Wrong name of " + prettyName(aEvent.accessible) + " on focus"); - } + }; } function doTest() { // //////////////////////////////////////////////////////////////////////// // test actions of audio controls todo(false, "Focus test are disabled until bug 494175 is fixed.");
--- a/accessible/tests/mochitest/attributes.js +++ b/accessible/tests/mochitest/attributes.js @@ -203,36 +203,36 @@ function testTextAttrsWrongOffset(aID, a res = true; } ok(res, "text attributes are calculated successfully at wrong offset " + aOffset + " for " + prettyName(aID)); } const kNormalFontWeight = - function equalsToNormal(aWeight) { return aWeight <= 400 ; } + function equalsToNormal(aWeight) { return aWeight <= 400 ; }; const kBoldFontWeight = - function equalsToBold(aWeight) { return aWeight > 400; } + function equalsToBold(aWeight) { return aWeight > 400; }; // The pt font size of the input element can vary by Linux distro. const kInputFontSize = WIN ? "10pt" : (MAC ? "8pt" : function() { return true; }); const kAbsentFontFamily = - function(aFontFamily) { return aFontFamily != "sans-serif"; } + function(aFontFamily) { return aFontFamily != "sans-serif"; }; const kInputFontFamily = - function(aFontFamily) { return aFontFamily != "sans-serif"; } + function(aFontFamily) { return aFontFamily != "sans-serif"; }; const kMonospaceFontFamily = - function(aFontFamily) { return aFontFamily != "monospace"; } + function(aFontFamily) { return aFontFamily != "monospace"; }; const kSansSerifFontFamily = - function(aFontFamily) { return aFontFamily != "sans-serif"; } + function(aFontFamily) { return aFontFamily != "sans-serif"; }; const kSerifFontFamily = - function(aFontFamily) { return aFontFamily != "serif"; } + function(aFontFamily) { return aFontFamily != "serif"; }; const kCursiveFontFamily = LINUX ? "DejaVu Serif" : "Comic Sans MS"; /** * Return used font from the given computed style. */ function fontFamily(aComputedStyle) { var name = aComputedStyle.fontFamily;
--- a/accessible/tests/mochitest/attributes/test_obj.html +++ b/accessible/tests/mochitest/attributes/test_obj.html @@ -132,17 +132,17 @@ https://bugzilla.mozilla.org/show_bug.cg testAbsentAttrs("th3", { "abbr": "" }, true); // application accessible if (WIN) { var gfxInfo = Components.classes["@mozilla.org/gfx/info;1"]. getService(Components.interfaces.nsIGfxInfo); var attrs = { "D2D": (gfxInfo.D2DEnabled ? "true" : "false") - } + }; testAttrs(getApplicationAccessible(), attrs, false); } // no object attributes testAbsentAttrs(getAccessible("listitem").firstChild, { "tag": "" }); // experimental aria testAttrs("experimental", {"blah": "true"}, true);
--- a/accessible/tests/mochitest/attributes/test_obj_css.html +++ b/accessible/tests/mochitest/attributes/test_obj_css.html @@ -22,25 +22,25 @@ this.accessible = getAccessible(aID); this.eventSeq = [ new invokerChecker(EVENT_HIDE, this.accessible) ]; this.invoke = function removeElm_invoke() { this.node.remove(); - } + }; this.check = function removeElm_check() { testAbsentCSSAttrs(this.accessible); - } + }; this.getID = function removeElm_getID() { return "test CSS-based attributes on removed accessible"; - } + }; } function doTest() { // CSS display testCSSAttrs("display_block"); testCSSAttrs("display_inline"); testCSSAttrs("display_inline-block"); testCSSAttrs("display_list-item");
--- a/accessible/tests/mochitest/autocomplete.js +++ b/accessible/tests/mochitest/autocomplete.js @@ -81,17 +81,17 @@ ResultsHeap.prototype = for (var idx = 0; idx < this.values.length; idx++) { if (this.values[idx].indexOf(aSearchString) != -1) { values.push(this.values[idx]); comments.push(this.comments[idx]); } } return new AutoCompleteResult(values, comments); } -} +}; /** * nsIAutoCompleteSearch implementation. * * @param aName [in] the name of autocomplete search * @param aAllResults [in] ResultsHeap object */ @@ -128,17 +128,17 @@ AutoCompleteSearch.prototype = return this.QueryInterface(iid); }, // Search name. Used by AutoCompleteController. name: null, // Results heap. allResults: null -} +}; /** * nsIAutoCompleteResult implementation. */ function AutoCompleteResult(aValues, aComments) { this.values = aValues; this.comments = aComments; @@ -195,9 +195,9 @@ AutoCompleteResult.prototype = return this; throw Components.results.NS_ERROR_NO_INTERFACE; }, // Data values: null, comments: null -} +};
--- a/accessible/tests/mochitest/bounds/test_select.html +++ b/accessible/tests/mochitest/bounds/test_select.html @@ -27,25 +27,25 @@ this.eventSeq = [ new invokerChecker(EVENT_FOCUS, this.comboboxOption) ]; this.invoke = function openComboboxNCheckBounds_invoke() { getNode(aID).focus(); synthesizeKey("VK_DOWN", { altKey: true }); - } + }; this.finalCheck = function openComboboxNCheckBounds_invoke() { testBounds(this.comboboxOption); - } + }; this.getID = function openComboboxNCheckBounds_getID() { return "open combobox and test boundaries"; - } + }; } // gA11yEventDumpToConsole = true; var gQueue = null; function doTest() { // Combobox
--- a/accessible/tests/mochitest/common.js +++ b/accessible/tests/mochitest/common.js @@ -598,44 +598,44 @@ function testDefunctAccessible(aAcc, aNo var msg = " doesn't fail for shut down accessible " + prettyName(aNodeOrId) + "!"; // firstChild var success = false; try { aAcc.firstChild; } catch (e) { - success = (e.result == Components.results.NS_ERROR_FAILURE) + success = (e.result == Components.results.NS_ERROR_FAILURE); } ok(success, "firstChild" + msg); // lastChild success = false; try { aAcc.lastChild; } catch (e) { - success = (e.result == Components.results.NS_ERROR_FAILURE) + success = (e.result == Components.results.NS_ERROR_FAILURE); } ok(success, "lastChild" + msg); // childCount success = false; try { aAcc.childCount; } catch (e) { - success = (e.result == Components.results.NS_ERROR_FAILURE) + success = (e.result == Components.results.NS_ERROR_FAILURE); } ok(success, "childCount" + msg); // children success = false; try { aAcc.children; } catch (e) { - success = (e.result == Components.results.NS_ERROR_FAILURE) + success = (e.result == Components.results.NS_ERROR_FAILURE); } ok(success, "children" + msg); // nextSibling success = false; try { aAcc.nextSibling; } catch (e) { @@ -675,17 +675,17 @@ function roleToString(aRole) { function statesToString(aStates, aExtraStates) { var list = gAccService.getStringStates(aStates, aExtraStates); var str = ""; for (var index = 0; index < list.length - 1; index++) str += list.item(index) + ", "; if (list.length != 0) - str += list.item(index) + str += list.item(index); return str; } /** * Convert event type to human readable string. */ function eventTypeToString(aEventType) {
--- a/accessible/tests/mochitest/editabletext/editabletext.js +++ b/accessible/tests/mochitest/editabletext/editabletext.js @@ -1,32 +1,32 @@ /** * Perform all editable text tests. */ function editableTextTestRun() { this.add = function add(aTest) { this.seq.push(aTest); - } + }; this.run = function run() { this.iterate(); - } + }; this.index = 0; this.seq = []; this.iterate = function iterate() { if (this.index < this.seq.length) { this.seq[this.index++].startTest(this); return; } this.seq = null; SimpleTest.finish(); - } + }; } /** * Used to test nsIEditableTextAccessible methods. */ function editableTextTest(aID) { /** * Schedule a test, the given function with its arguments will be executed @@ -40,17 +40,17 @@ function editableTextTest(aID) { funcArgs: Array.slice(arguments, 1) }; this.mEventQueue.push(dataContainer); if (!this.mEventQueueReady) { this.unwrapNextTest(); this.mEventQueueReady = true; } - } + }; /** * setTextContents test. */ this.setTextContents = function setTextContents(aValue, aSkipStartOffset) { var testID = "setTextContents '" + aValue + "' for " + prettyName(aID); function setTextContentsInvoke() { @@ -63,17 +63,17 @@ function editableTextTest(aID) { var insertTripple = aValue ? [ aSkipStartOffset, aSkipStartOffset + aValue.length, aValue ] : null; var oldValue = getValue(aID); var removeTripple = oldValue ? [ aSkipStartOffset, aSkipStartOffset + oldValue.length, oldValue ] : null; this.generateTest(aID, removeTripple, insertTripple, setTextContentsInvoke, getValueChecker(aID, aValue), testID); - } + }; /** * insertText test. */ this.insertText = function insertText(aStr, aPos, aResStr, aResPos) { var testID = "insertText '" + aStr + "' at " + aPos + " for " + prettyName(aID); @@ -81,33 +81,33 @@ function editableTextTest(aID) { dump(`\ninsertText '${aStr}' at ${aPos} pos\n`); var acc = getAccessible(aID, nsIAccessibleEditableText); acc.insertText(aStr, aPos); } var resPos = (aResPos != undefined) ? aResPos : aPos; this.generateTest(aID, null, [resPos, resPos + aStr.length, aStr], insertTextInvoke, getValueChecker(aID, aResStr), testID); - } + }; /** * copyText test. */ this.copyText = function copyText(aStartPos, aEndPos, aClipboardStr) { var testID = "copyText from " + aStartPos + " to " + aEndPos + " for " + prettyName(aID); function copyTextInvoke() { var acc = getAccessible(aID, nsIAccessibleEditableText); acc.copyText(aStartPos, aEndPos); } this.generateTest(aID, null, null, copyTextInvoke, getClipboardChecker(aID, aClipboardStr), testID); - } + }; /** * copyText and pasteText test. */ this.copyNPasteText = function copyNPasteText(aStartPos, aEndPos, aPos, aResStr) { var testID = "copyText from " + aStartPos + " to " + aEndPos + "and pasteText at " + aPos + " for " + prettyName(aID); @@ -115,17 +115,17 @@ function editableTextTest(aID) { function copyNPasteTextInvoke() { var acc = getAccessible(aID, nsIAccessibleEditableText); acc.copyText(aStartPos, aEndPos); acc.pasteText(aPos); } this.generateTest(aID, null, [aStartPos, aEndPos, getTextFromClipboard], copyNPasteTextInvoke, getValueChecker(aID, aResStr), testID); - } + }; /** * cutText test. */ this.cutText = function cutText(aStartPos, aEndPos, aResStr, aResStartPos, aResEndPos) { var testID = "cutText from " + aStartPos + " to " + aEndPos + " for " + prettyName(aID); @@ -134,17 +134,17 @@ function editableTextTest(aID) { var acc = getAccessible(aID, nsIAccessibleEditableText); acc.cutText(aStartPos, aEndPos); } var resStartPos = (aResStartPos != undefined) ? aResStartPos : aStartPos; var resEndPos = (aResEndPos != undefined) ? aResEndPos : aEndPos; this.generateTest(aID, [resStartPos, resEndPos, getTextFromClipboard], null, cutTextInvoke, getValueChecker(aID, aResStr), testID); - } + }; /** * cutText and pasteText test. */ this.cutNPasteText = function copyNPasteText(aStartPos, aEndPos, aPos, aResStr) { var testID = "cutText from " + aStartPos + " to " + aEndPos + " and pasteText at " + aPos + " for " + prettyName(aID); @@ -154,32 +154,32 @@ function editableTextTest(aID) { acc.cutText(aStartPos, aEndPos); acc.pasteText(aPos); } this.generateTest(aID, [aStartPos, aEndPos, getTextFromClipboard], [aPos, -1, getTextFromClipboard], cutNPasteTextInvoke, getValueChecker(aID, aResStr), testID); - } + }; /** * pasteText test. */ this.pasteText = function pasteText(aPos, aResStr) { var testID = "pasteText at " + aPos + " for " + prettyName(aID); function pasteTextInvoke() { var acc = getAccessible(aID, nsIAccessibleEditableText); acc.pasteText(aPos); } this.generateTest(aID, null, [aPos, -1, getTextFromClipboard], pasteTextInvoke, getValueChecker(aID, aResStr), testID); - } + }; /** * deleteText test. */ this.deleteText = function deleteText(aStartPos, aEndPos, aResStr) { var testID = "deleteText from " + aStartPos + " to " + aEndPos + " for " + prettyName(aID); @@ -188,17 +188,17 @@ function editableTextTest(aID) { function deleteTextInvoke() { var acc = getAccessible(aID, [nsIAccessibleEditableText]); acc.deleteText(aStartPos, aEndPos); } this.generateTest(aID, removeTripple, null, deleteTextInvoke, getValueChecker(aID, aResStr), testID); - } + }; // //////////////////////////////////////////////////////////////////////////// // Implementation details. function getValue(aID) { var elm = getNode(aID); if (elm instanceof Components.interfaces.nsIDOMNSEditableElement) return elm.value; @@ -232,17 +232,17 @@ function editableTextTest(aID) { /** * Process next scheduled test. */ this.unwrapNextTest = function unwrapNextTest() { var data = this.mEventQueue.mInvokers[this.mEventQueue.mIndex + 1]; if (data) data.func.apply(this, data.funcArgs); - } + }; /** * Used to generate an invoker object for the sheduled test. */ this.generateTest = function generateTest(aID, aRemoveTriple, aInsertTriple, aInvokeFunc, aChecker, aInvokerID) { var et = this; var invoker = { @@ -272,33 +272,33 @@ function editableTextTest(aID) { invoker.eventSeq.push(checker); } // Claim that we don't want to fail when no events are expected. if (!aRemoveTriple && !aInsertTriple) invoker.noEventsOnAction = true; this.mEventQueue.mInvokers[this.mEventQueue.mIndex + 1] = invoker; - } + }; /** * Run the tests. */ this.startTest = function startTest(aTestRun) { var testRunObj = aTestRun; var thisObj = this; this.mEventQueue.onFinish = function finishCallback() { // Notify textRun object that all tests were finished. testRunObj.iterate(); // Help GC to avoid leaks (refer to aTestRun from local variable, drop // onFinish function). thisObj.mEventQueue.onFinish = null; return DO_NOT_FINISH_TEST; - } + }; this.mEventQueue.invoke(); - } + }; this.mEventQueue = new eventQueue(); this.mEventQueueReady = false; }
--- a/accessible/tests/mochitest/elm/test_HTMLSpec.html +++ b/accessible/tests/mochitest/elm/test_HTMLSpec.html @@ -137,48 +137,48 @@ textAttrs: { 0: { }, 6: { "font-weight": kBoldFontWeight } }, children: [ { role: ROLE_TEXT_LEAF }, // plain text { role: ROLE_TEXT_LEAF } // HTML:b text ] - } + }; testElm("b_container", obj); // //////////////////////////////////////////////////////////////////////// obj = { // HTML:bdi contained by paragraph role: ROLE_PARAGRAPH, todo_textAttrs: { 0: { }, 5: { "writing-mode": "rl" }, 8: { } }, children: [ { role: ROLE_TEXT_LEAF }, // plain text { role: ROLE_TEXT_LEAF }, // HTML:bdi text { role: ROLE_TEXT_LEAF } // plain text ] - } + }; testElm("bdi_container", obj); // //////////////////////////////////////////////////////////////////////// // HTML:bdo contained by paragraph obj = { role: ROLE_PARAGRAPH, todo_textAttrs: { 0: { }, 6: { "writing-mode": "rl" } }, children: [ { role: ROLE_TEXT_LEAF }, // plain text ] - } + }; testElm("bdo_container", obj); // //////////////////////////////////////////////////////////////////////// // HTML:blockquote obj = { role: ROLE_SECTION, interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ], @@ -646,17 +646,17 @@ textAttrs: { 0: { }, 6: { "font-style": "italic" } }, children: [ { role: ROLE_TEXT_LEAF }, // plain text { role: ROLE_TEXT_LEAF } // HTML:i text ] - } + }; testElm("i_container", obj); // //////////////////////////////////////////////////////////////////////// // HTML:img obj = { role: ROLE_GRAPHIC, interfaces: [ nsIAccessibleImage ]
--- a/accessible/tests/mochitest/events.js +++ b/accessible/tests/mochitest/events.js @@ -251,35 +251,35 @@ const DO_NOT_FINISH_TEST = 1; function eventQueue(aEventType) { // public /** * Add invoker object into queue. */ this.push = function eventQueue_push(aEventInvoker) { this.mInvokers.push(aEventInvoker); - } + }; /** * Start the queue processing. */ this.invoke = function eventQueue_invoke() { listenA11yEvents(true); // XXX: Intermittent test_events_caretmove.html fails withouth timeout, // see bug 474952. this.processNextInvokerInTimeout(true); - } + }; /** * This function is called when all events in the queue were handled. * Override it if you need to be notified of this. */ this.onFinish = function eventQueue_finish() { - } + }; // private /** * Process next invoker. */ this.processNextInvoker = function eventQueue_processNextInvoker() { // Some scenario was matched, we wait on next invoker processing. @@ -422,17 +422,17 @@ function eventQueue(aEventType) { if (invoker.invoke() == INVOKER_ACTION_FAILED) { // Invoker failed to prepare action, fail and finish tests. this.processNextInvoker(); return; } if (this.hasUnexpectedEventsScenario()) this.processNextInvokerInTimeout(true); - } + }; this.processNextInvokerInTimeout = function eventQueue_processNextInvokerInTimeout(aUncondProcess) { this.setInvokerStatus(kInvokerPending, "Process next invoker in timeout"); // No need to wait extra timeout when a) we know we don't need to do that // and b) there's no any single unexpected event. if (!aUncondProcess && this.areAllEventsExpected()) { @@ -440,17 +440,17 @@ function eventQueue(aEventType) { var queue = this; SimpleTest.executeSoon(function() { queue.processNextInvoker(); }); return; } // Check in timeout invoker didn't fire registered events. window.setTimeout(function(aQueue) { aQueue.processNextInvoker(); }, 300, this); - } + }; /** * Handle events for the current invoker. */ this.handleEvent = function eventQueue_handleEvent(aEvent) { var invoker = this.getInvoker(); if (!invoker) // skip events before test was started return; @@ -568,47 +568,47 @@ function eventQueue(aEventType) { return; } // If we have scheduled a next invoker then cancel in case of match. if ((this.mNextInvokerStatus == kInvokerPending) && hasMatchedCheckers) { this.setInvokerStatus(kInvokerCanceled, "Cancel the scheduled invoker in case of match"); } - } + }; // Helpers this.processMatchedChecker = function eventQueue_function(aEvent, aMatchedChecker, aScenarioIdx, aEventIdx) { aMatchedChecker.wasCaught++; if ("check" in aMatchedChecker) aMatchedChecker.check(aEvent); eventQueue.logEvent(aEvent, aMatchedChecker, aScenarioIdx, aEventIdx, this.areExpectedEventsLeft(), this.mNextInvokerStatus); - } + }; this.getNextExpectedEvent = function eventQueue_getNextExpectedEvent(aEventSeq) { if (!("idx" in aEventSeq)) aEventSeq.idx = 0; while (aEventSeq.idx < aEventSeq.length && (aEventSeq[aEventSeq.idx].unexpected || aEventSeq[aEventSeq.idx].todo || aEventSeq[aEventSeq.idx].async || aEventSeq[aEventSeq.idx] instanceof orderChecker || aEventSeq[aEventSeq.idx].wasCaught > 0)) { aEventSeq.idx++; } return aEventSeq.idx != aEventSeq.length ? aEventSeq[aEventSeq.idx] : null; - } + }; this.areExpectedEventsLeft = function eventQueue_areExpectedEventsLeft(aScenario) { function scenarioHasUnhandledExpectedEvent(aEventSeq) { // Check if we have unhandled async (can be anywhere in the sequance) or // sync expcected events yet. for (var idx = 0; idx < aEventSeq.length; idx++) { if (!aEventSeq[idx].unexpected && !aEventSeq[idx].todo && @@ -623,71 +623,71 @@ function eventQueue(aEventType) { return scenarioHasUnhandledExpectedEvent(aScenario); for (var scnIdx = 0; scnIdx < this.mScenarios.length; scnIdx++) { var eventSeq = this.mScenarios[scnIdx]; if (scenarioHasUnhandledExpectedEvent(eventSeq)) return true; } return false; - } + }; this.areAllEventsExpected = function eventQueue_areAllEventsExpected() { for (var scnIdx = 0; scnIdx < this.mScenarios.length; scnIdx++) { var eventSeq = this.mScenarios[scnIdx]; for (var idx = 0; idx < eventSeq.length; idx++) { if (eventSeq[idx].unexpected || eventSeq[idx].todo) return false; } } return true; - } + }; this.isUnexpectedEventScenario = function eventQueue_isUnexpectedEventsScenario(aScenario) { for (var idx = 0; idx < aScenario.length; idx++) { if (!aScenario[idx].unexpected && !aScenario[idx].todo) break; } return idx == aScenario.length; - } + }; this.hasUnexpectedEventsScenario = function eventQueue_hasUnexpectedEventsScenario() { if (this.getInvoker().noEventsOnAction) return true; for (var scnIdx = 0; scnIdx < this.mScenarios.length; scnIdx++) { if (this.isUnexpectedEventScenario(this.mScenarios[scnIdx])) return true; } return false; - } + }; this.hasMatchedScenario = function eventQueue_hasMatchedScenario() { for (var scnIdx = 0; scnIdx < this.mScenarios.length; scnIdx++) { var scn = this.mScenarios[scnIdx]; if (!this.isUnexpectedEventScenario(scn) && !this.areExpectedEventsLeft(scn)) return true; } return false; - } + }; this.getInvoker = function eventQueue_getInvoker() { return this.mInvokers[this.mIndex]; - } + }; this.getNextInvoker = function eventQueue_getNextInvoker() { return this.mInvokers[++this.mIndex]; - } + }; this.setEventHandler = function eventQueue_setEventHandler(aInvoker) { if (!("scenarios" in aInvoker) || aInvoker.scenarios.length == 0) { var eventSeq = aInvoker.eventSeq; var unexpectedEventSeq = aInvoker.unexpectedEventSeq; if (!eventSeq && !unexpectedEventSeq && this.mDefEventType) eventSeq = [ new invokerChecker(this.mDefEventType, aInvoker.DOMNode) ]; @@ -757,17 +757,17 @@ function eventQueue(aEventType) { } else { // A11y event addA11yEventListener(eventType, this); } } } return true; - } + }; this.clearEventHandler = function eventQueue_clearEventHandler() { if (!this.mScenarios) return; for (var scnIdx = 0; scnIdx < this.mScenarios.length; scnIdx++) { var eventSeq = this.mScenarios[scnIdx]; for (var idx = 0; idx < eventSeq.length; idx++) { @@ -780,32 +780,32 @@ function eventQueue(aEventType) { } else { // A11y event removeA11yEventListener(eventType, this); } } } this.mScenarios = null; - } + }; this.getEventID = function eventQueue_getEventID(aChecker) { if ("getID" in aChecker) return aChecker.getID(); var invoker = this.getInvoker(); return invoker.getID(); - } + }; this.setInvokerStatus = function eventQueue_setInvokerStatus(aStatus, aLogMsg) { this.mNextInvokerStatus = aStatus; // Uncomment it to debug invoker processing logic. // gLogger.log(eventQueue.invokerStatusToMsg(aStatus, aLogMsg)); - } + }; this.mDefEventType = aEventType; this.mInvokers = []; this.mIndex = -1; this.mScenarios = null; this.mNextInvokerStatus = kInvokerNotScheduled; @@ -823,17 +823,17 @@ eventQueue.getEventTypeAsString = if (aEventOrChecker instanceof nsIDOMEvent) return aEventOrChecker.type; if (aEventOrChecker instanceof nsIAccessibleEvent) return eventTypeToString(aEventOrChecker.eventType); return (typeof aEventOrChecker.type == "string") ? aEventOrChecker.type : eventTypeToString(aEventOrChecker.type); -} +}; eventQueue.getEventTargetDescr = function eventQueue_getEventTargetDescr(aEventOrChecker, aDontForceTarget) { if (aEventOrChecker instanceof nsIDOMEvent) return prettyName(aEventOrChecker.originalTarget); if (aEventOrChecker instanceof nsIDOMEvent) return prettyName(aEventOrChecker.accessible); @@ -842,28 +842,28 @@ eventQueue.getEventTargetDescr = if (descr) return descr; if (aDontForceTarget) return "no target description"; var target = ("target" in aEventOrChecker) ? aEventOrChecker.target : null; return prettyName(target); -} +}; eventQueue.getEventPhase = function eventQueue_getEventPhase(aChecker) { return ("phase" in aChecker) ? aChecker.phase : true; -} +}; eventQueue.compareEventTypes = function eventQueue_compareEventTypes(aChecker, aEvent) { var eventType = (aEvent instanceof nsIDOMEvent) ? aEvent.type : aEvent.eventType; return aChecker.type == eventType; -} +}; eventQueue.compareEvents = function eventQueue_compareEvents(aChecker, aEvent) { if (!eventQueue.compareEventTypes(aChecker, aEvent)) return false; // If checker provides "match" function then allow the checker to decide // whether event is matched. if ("match" in aChecker) @@ -877,26 +877,26 @@ eventQueue.compareEvents = function even return target1 == target2; } // If original target isn't suitable then extend interface to support target // (original target is used in test_elm_media.html). var target2 = (aEvent instanceof nsIDOMEvent) ? aEvent.originalTarget : aEvent.DOMNode; return target1 == target2; -} +}; eventQueue.isSameEvent = function eventQueue_isSameEvent(aChecker, aEvent) { // We don't have stored info about handled event other than its type and // target, thus we should filter text change and state change events since // they may occur on the same element because of complex changes. return this.compareEvents(aChecker, aEvent) && !(aEvent instanceof nsIAccessibleTextChangeEvent) && !(aEvent instanceof nsIAccessibleStateChangeEvent); -} +}; eventQueue.invokerStatusToMsg = function eventQueue_invokerStatusToMsg(aInvokerStatus, aMsg) { var msg = "invoker status: "; switch (aInvokerStatus) { case kInvokerNotScheduled: msg += "not scheduled"; break; @@ -907,17 +907,17 @@ eventQueue.invokerStatusToMsg = msg += "canceled"; break; } if (aMsg) msg += " (" + aMsg + ")"; return msg; -} +}; eventQueue.logEvent = function eventQueue_logEvent(aOrigEvent, aMatchedChecker, aScenarioIdx, aEventIdx, aAreExpectedEventsLeft, aInvokerStatus) { // Dump DOM event information. Skip a11y event since it is dumped by // gA11yEventObserver. if (aOrigEvent instanceof nsIDOMEvent) { @@ -934,17 +934,17 @@ eventQueue.logEvent = function eventQueu var consoleMsg = "*****\nScenario " + aScenarioIdx + ", event " + aEventIdx + " matched: " + currType + "\n" + infoMsg + "\n*****"; gLogger.logToConsole(consoleMsg); var emphText = "matched "; var msg = "EQ event, type: " + currType + ", target: " + currTargetDescr + ", " + infoMsg; gLogger.logToDOM(msg, true, emphText); -} +}; // ////////////////////////////////////////////////////////////////////////////// // Action sequence /** * Deal with action sequence. Used when you need to execute couple of actions * each after other one. @@ -963,31 +963,31 @@ function sequence() { * @param aEventType [in] event type of expected event on item action * @param aTarget [in] event target of expected event on item action * @param aItemID [in] identifier of item */ this.append = function sequence_append(aProcessor, aEventType, aTarget, aItemID) { var item = new sequenceItem(aProcessor, aEventType, aTarget, aItemID); this.items.push(item); - } + }; /** * Process next sequence item. */ this.processNext = function sequence_processNext() { this.idx++; if (this.idx >= this.items.length) { ok(false, "End of sequence: nothing to process!"); SimpleTest.finish(); return; } this.items[this.idx].startProcess(); - } + }; this.items = []; this.idx = -1; } // ////////////////////////////////////////////////////////////////////////////// // Event queue invokers @@ -1055,53 +1055,53 @@ function synthClick(aNodeOrID, aCheckerO var x = 1, y = 1; if (aArgs && ("where" in aArgs) && aArgs.where == "right") { if (targetNode instanceof nsIDOMHTMLElement) x = targetNode.offsetWidth - 1; else if (targetNode instanceof nsIDOMXULElement) x = targetNode.boxObject.width - 1; } synthesizeMouse(targetNode, x, y, aArgs ? aArgs : {}); - } + }; this.finalCheck = function synthClick_finalCheck() { // Scroll top window back. window.top.scrollTo(0, 0); - } + }; this.getID = function synthClick_getID() { return prettyName(aNodeOrID) + " click"; - } + }; } /** * Mouse move invoker. */ function synthMouseMove(aID, aCheckerOrEventSeq) { this.__proto__ = new synthAction(aID, aCheckerOrEventSeq); this.invoke = function synthMouseMove_invoke() { synthesizeMouse(this.DOMNode, 1, 1, { type: "mousemove" }); synthesizeMouse(this.DOMNode, 2, 2, { type: "mousemove" }); - } + }; this.getID = function synthMouseMove_getID() { return prettyName(aID) + " mouse move"; - } + }; } /** * General key press invoker. */ function synthKey(aNodeOrID, aKey, aArgs, aCheckerOrEventSeq) { this.__proto__ = new synthAction(aNodeOrID, aCheckerOrEventSeq); this.invoke = function synthKey_invoke() { synthesizeKey(this.mKey, this.mArgs, this.mWindow); - } + }; this.getID = function synthKey_getID() { var key = this.mKey; switch (this.mKey) { case "VK_TAB": key = "tab"; break; case "VK_DOWN": @@ -1133,17 +1133,17 @@ function synthKey(aNodeOrID, aKey, aArgs if (aArgs.shiftKey) key += " shift"; if (aArgs.ctrlKey) key += " ctrl"; if (aArgs.altKey) key += " alt"; } return prettyName(aNodeOrID) + " '" + key + " ' key"; - } + }; this.mKey = aKey; this.mArgs = aArgs ? aArgs : {}; this.mWindow = aArgs ? aArgs.window : null; } /** * Tab key invoker. @@ -1224,17 +1224,17 @@ function synthEnterKey(aID, aCheckerOrEv /** * Synth alt + down arrow to open combobox. */ function synthOpenComboboxKey(aID, aCheckerOrEventSeq) { this.__proto__ = new synthDownKey(aID, aCheckerOrEventSeq, { altKey: true }); this.getID = function synthOpenComboboxKey_getID() { return "open combobox (atl + down arrow) " + prettyName(aID); - } + }; } /** * Focus invoker. */ function synthFocus(aNodeOrID, aCheckerOrEventSeq) { var checkerOfEventSeq = aCheckerOrEventSeq ? aCheckerOrEventSeq : new focusChecker(aNodeOrID); @@ -1242,39 +1242,39 @@ function synthFocus(aNodeOrID, aCheckerO this.invoke = function synthFocus_invoke() { if (this.DOMNode instanceof Components.interfaces.nsIDOMNSEditableElement && this.DOMNode.editor || this.DOMNode instanceof Components.interfaces.nsIDOMXULTextBoxElement) { this.DOMNode.selectionStart = this.DOMNode.selectionEnd = this.DOMNode.value.length; } this.DOMNode.focus(); - } + }; this.getID = function synthFocus_getID() { return prettyName(aNodeOrID) + " focus"; - } + }; } /** * Focus invoker. Focus the HTML body of content document of iframe. */ function synthFocusOnFrame(aNodeOrID, aCheckerOrEventSeq) { var frameDoc = getNode(aNodeOrID).contentDocument; var checkerOrEventSeq = aCheckerOrEventSeq ? aCheckerOrEventSeq : new focusChecker(frameDoc); this.__proto__ = new synthAction(frameDoc, checkerOrEventSeq); this.invoke = function synthFocus_invoke() { this.DOMNode.body.focus(); - } + }; this.getID = function synthFocus_getID() { return prettyName(aNodeOrID) + " frame document focus"; - } + }; } /** * Change the current item when the widget doesn't have a focus. */ function changeCurrentItem(aID, aItemID) { this.eventSeq = [ new nofocusChecker() ]; @@ -1315,85 +1315,85 @@ function changeCurrentItem(aID, aItemID) controlNode.selectedItem = itemNode; return; } if (controlNode.currentItem == itemNode) ok(false, "Error in test: proposed current item is already current" + prettyName(aID)); controlNode.currentItem = itemNode; - } + }; this.getID = function changeCurrentItem_getID() { return "current item change for " + prettyName(aID); - } + }; this.reportError = function changeCurrentItem_reportError() { ok(false, "Error in test: proposed current item '" + aItemID + "' is already current"); - } + }; } /** * Toggle top menu invoker. */ function toggleTopMenu(aID, aCheckerOrEventSeq) { this.__proto__ = new synthKey(aID, "VK_ALT", null, aCheckerOrEventSeq); this.getID = function toggleTopMenu_getID() { return "toggle top menu on " + prettyName(aID); - } + }; } /** * Context menu invoker. */ function synthContextMenu(aID, aCheckerOrEventSeq) { this.__proto__ = new synthClick(aID, aCheckerOrEventSeq, { button: 0, type: "contextmenu" }); this.getID = function synthContextMenu_getID() { return "context menu on " + prettyName(aID); - } + }; } /** * Open combobox, autocomplete and etc popup, check expandable states. */ function openCombobox(aComboboxID) { this.eventSeq = [ new stateChangeChecker(STATE_EXPANDED, false, true, aComboboxID) ]; this.invoke = function openCombobox_invoke() { getNode(aComboboxID).focus(); synthesizeKey("VK_DOWN", { altKey: true }); - } + }; this.getID = function openCombobox_getID() { return "open combobox " + prettyName(aComboboxID); - } + }; } /** * Close combobox, autocomplete and etc popup, check expandable states. */ function closeCombobox(aComboboxID) { this.eventSeq = [ new stateChangeChecker(STATE_EXPANDED, false, false, aComboboxID) ]; this.invoke = function closeCombobox_invoke() { synthesizeKey("VK_ESCAPE", { }); - } + }; this.getID = function closeCombobox_getID() { return "close combobox " + prettyName(aComboboxID); - } + }; } /** * Select all invoker. */ function synthSelectAll(aNodeOrID, aCheckerOrEventSeq) { this.__proto__ = new synthAction(aNodeOrID, aCheckerOrEventSeq); @@ -1401,92 +1401,92 @@ function synthSelectAll(aNodeOrID, aChec this.invoke = function synthSelectAll_invoke() { if (this.DOMNode instanceof Components.interfaces.nsIDOMHTMLInputElement || this.DOMNode instanceof Components.interfaces.nsIDOMXULTextBoxElement) { this.DOMNode.select(); } else { window.getSelection().selectAllChildren(this.DOMNode); } - } + }; this.getID = function synthSelectAll_getID() { return aNodeOrID + " selectall"; - } + }; } /** * Move the caret to the end of line. */ function moveToLineEnd(aID, aCaretOffset) { if (MAC) { this.__proto__ = new synthKey(aID, "VK_RIGHT", { metaKey: true }, new caretMoveChecker(aCaretOffset, aID)); } else { this.__proto__ = new synthEndKey(aID, new caretMoveChecker(aCaretOffset, aID)); } this.getID = function moveToLineEnd_getID() { return "move to line end in " + prettyName(aID); - } + }; } /** * Move the caret to the end of previous line if any. */ function moveToPrevLineEnd(aID, aCaretOffset) { this.__proto__ = new synthAction(aID, new caretMoveChecker(aCaretOffset, aID)); this.invoke = function moveToPrevLineEnd_invoke() { synthesizeKey("VK_UP", { }); if (MAC) synthesizeKey("VK_RIGHT", { metaKey: true }); else synthesizeKey("VK_END", { }); - } + }; this.getID = function moveToPrevLineEnd_getID() { return "move to previous line end in " + prettyName(aID); - } + }; } /** * Move the caret to begining of the line. */ function moveToLineStart(aID, aCaretOffset) { if (MAC) { this.__proto__ = new synthKey(aID, "VK_LEFT", { metaKey: true }, new caretMoveChecker(aCaretOffset, aID)); } else { this.__proto__ = new synthHomeKey(aID, new caretMoveChecker(aCaretOffset, aID)); } this.getID = function moveToLineEnd_getID() { return "move to line start in " + prettyName(aID); - } + }; } /** * Move the caret to begining of the text. */ function moveToTextStart(aID) { if (MAC) { this.__proto__ = new synthKey(aID, "VK_UP", { metaKey: true }, new caretMoveChecker(0, aID)); } else { this.__proto__ = new synthKey(aID, "VK_HOME", { ctrlKey: true }, new caretMoveChecker(0, aID)); } this.getID = function moveToTextStart_getID() { return "move to text start in " + prettyName(aID); - } + }; } /** * Move the caret in text accessible. */ function moveCaretToDOMPoint(aID, aDOMPointNodeID, aDOMPointOffset, aExpectedOffset, aFocusTargetID, aCheckFunc) { @@ -1501,27 +1501,27 @@ function moveCaretToDOMPoint(aID, aDOMPo var selection = this.DOMPointNode.ownerGlobal.getSelection(); var selRange = selection.getRangeAt(0); selRange.setStart(this.DOMPointNode, aDOMPointOffset); selRange.collapse(true); selection.removeRange(selRange); selection.addRange(selRange); - } + }; this.getID = function moveCaretToDOMPoint_getID() { return "Set caret on " + prettyName(aID) + " at point: " + prettyName(aDOMPointNodeID) + " node with offset " + aDOMPointOffset; - } + }; this.finalCheck = function moveCaretToDOMPoint_finalCheck() { if (aCheckFunc) aCheckFunc.call(); - } + }; this.eventSeq = [ new caretMoveChecker(aExpectedOffset, this.target) ]; if (this.focus) this.eventSeq.push(new asyncInvokerChecker(EVENT_FOCUS, this.focus)); } @@ -1531,21 +1531,21 @@ function moveCaretToDOMPoint(aID, aDOMPo */ function setCaretOffset(aID, aOffset, aFocusTargetID) { this.target = getAccessible(aID, [nsIAccessibleText]); this.offset = aOffset == -1 ? this.target.characterCount : aOffset; this.focus = aFocusTargetID ? getAccessible(aFocusTargetID) : null; this.invoke = function setCaretOffset_invoke() { this.target.caretOffset = this.offset; - } + }; this.getID = function setCaretOffset_getID() { return "Set caretOffset on " + prettyName(aID) + " at " + this.offset; - } + }; this.eventSeq = [ new caretMoveChecker(this.offset, this.target) ]; if (this.focus) this.eventSeq.push(new asyncInvokerChecker(EVENT_FOCUS, this.focus)); } @@ -1632,17 +1632,17 @@ function asyncInvokerChecker(aEventType, function focusChecker(aTargetOrFunc, aTargetFuncArg) { this.__proto__ = new invokerChecker(EVENT_FOCUS, aTargetOrFunc, aTargetFuncArg, false); this.unique = true; // focus event must be unique for invoker action this.check = function focusChecker_check(aEvent) { testStates(aEvent.accessible, STATE_FOCUSED); - } + }; } function nofocusChecker(aID) { this.__proto__ = new focusChecker(aID); this.unexpected = true; } /** @@ -1683,32 +1683,32 @@ function textChangeChecker(aID, aStart, var changeInfo = (aIsInserted ? "inserted" : "removed"); is(aEvent.isInserted, aIsInserted, "Text was " + changeInfo + " for " + prettyName(aID)); is(aEvent.modifiedText, modifiedText, "Wrong " + changeInfo + " text for " + prettyName(aID)); if (typeof aFromUser != "undefined") is(aEvent.isFromUserInput, aFromUser, "wrong value of isFromUserInput() for " + prettyName(aID)); - } + }; } /** * Caret move events checker. */ function caretMoveChecker(aCaretOffset, aTargetOrFunc, aTargetFuncArg, aIsAsync) { this.__proto__ = new invokerChecker(EVENT_TEXT_CARET_MOVED, aTargetOrFunc, aTargetFuncArg, aIsAsync); this.check = function caretMoveChecker_check(aEvent) { is(aEvent.QueryInterface(nsIAccessibleCaretMoveEvent).caretOffset, aCaretOffset, "Wrong caret offset for " + prettyName(aEvent.accessible)); - } + }; } function asyncCaretMoveChecker(aCaretOffset, aTargetOrFunc, aTargetFuncArg) { this.__proto__ = new caretMoveChecker(aCaretOffset, aTargetOrFunc, aTargetFuncArg, true); } /** @@ -1718,17 +1718,17 @@ function textSelectionChecker(aID, aStar this.__proto__ = new invokerChecker(EVENT_TEXT_SELECTION_CHANGED, aID); this.check = function textSelectionChecker_check(aEvent) { if (aStartOffset == aEndOffset) { ok(true, "Collapsed selection triggered text selection change event."); } else { testTextGetSelection(aID, aStartOffset, aEndOffset, 0); } - } + }; } /** * Object attribute changed checker */ function objAttrChangedChecker(aID, aAttr) { this.__proto__ = new invokerChecker(EVENT_OBJECT_ATTRIBUTE_CHANGED, aID); @@ -1792,26 +1792,26 @@ function stateChangeChecker(aState, aIsE return; } var state = aIsEnabled ? (aIsExtraState ? 0 : aState) : 0; var extraState = aIsEnabled ? (aIsExtraState ? aState : 0) : 0; var unxpdState = aIsEnabled ? 0 : (aIsExtraState ? 0 : aState); var unxpdExtraState = aIsEnabled ? 0 : (aIsExtraState ? aState : 0); testStates(event.accessible, state, extraState, unxpdState, unxpdExtraState); - } + }; this.match = function stateChangeChecker_match(aEvent) { if (aEvent instanceof nsIAccessibleStateChangeEvent) { var scEvent = aEvent.QueryInterface(nsIAccessibleStateChangeEvent); return (aEvent.accessible == getAccessible(this.target)) && (scEvent.state == aState); } return false; - } + }; } function asyncStateChangeChecker(aState, aIsExtraState, aIsEnabled, aTargetOrFunc, aTargetFuncArg) { this.__proto__ = new stateChangeChecker(aState, aIsExtraState, aIsEnabled, aTargetOrFunc, aTargetFuncArg, true); } @@ -1836,17 +1836,17 @@ function expandedStateChecker(aIsEnabled is(event.state, STATE_EXPANDED, "Wrong state of the statechange event."); is(event.isExtraState, false, "Wrong extra state bit of the statechange event."); is(event.isEnabled, aIsEnabled, "Wrong state of statechange event state"); testStates(event.accessible, (aIsEnabled ? STATE_EXPANDED : STATE_COLLAPSED)); - } + }; } // ////////////////////////////////////////////////////////////////////////////// // Event sequances (array of predefined checkers) /** * Event seq for single selection change. */ @@ -2123,23 +2123,23 @@ var gLogger = /** * Base class of sequence item. */ function sequenceItem(aProcessor, aEventType, aTarget, aItemID) { // private this.startProcess = function sequenceItem_startProcess() { this.queue.invoke(); - } + }; this.queue = new eventQueue(); this.queue.onFinish = function() { aProcessor.onProcessed(); return DO_NOT_FINISH_TEST; - } + }; var invoker = { invoke: function invoker_invoke() { return aProcessor.process(); }, getID: function invoker_getID() { return aItemID; }, @@ -2168,10 +2168,10 @@ function synthAction(aNodeOrID, aEventsO } else { scenarios = [ [ aEventsObj ] ]; // a single checker object } for (var i = 0; i < scenarios.length; i++) defineScenario(this, scenarios[i]); } - this.getID = function synthAction_getID() { return prettyName(aNodeOrID) + " action"; } + this.getID = function synthAction_getID() { return prettyName(aNodeOrID) + " action"; }; }
--- a/accessible/tests/mochitest/events/test_aria_alert.html +++ b/accessible/tests/mochitest/events/test_aria_alert.html @@ -31,25 +31,25 @@ }; this.getID = function showAlert_getID() { return "Show ARIA alert " + aID; }; } function changeAlert(aID) { - this.__defineGetter__("DOMNode", function() { return getNode(aID) }); + this.__defineGetter__("DOMNode", function() { return getNode(aID); }); this.invoke = function changeAlert_invoke() { this.DOMNode.textContent = "new alert"; - } + }; this.getID = function showAlert_getID() { return "Change ARIA alert " + aID; - } + }; } // ////////////////////////////////////////////////////////////////////////// // Do tests // gA11yEventDumpToConsole = true; // debuging // enableLogging("tree,events,verbose");
--- a/accessible/tests/mochitest/events/test_aria_menu.html +++ b/accessible/tests/mochitest/events/test_aria_menu.html @@ -32,21 +32,21 @@ getNode(aActiveMenuBarID))); } this.eventSeq.push(new invokerChecker(EVENT_MENU_START, getNode(aMenuBarID))); this.eventSeq.push(new invokerChecker(EVENT_FOCUS, getNode(aMenuID))); this.invoke = function focusMenu_invoke() { getNode(aMenuID).focus(); - } + }; this.getID = function focusMenu_getID() { return "focus menu '" + aMenuID + "'"; - } + }; } function showMenu(aMenuID, aParentMenuID, aHow) { this.menuNode = getNode(aMenuID); // Because of aria-owns processing we may have menupopup start fired before // related show event. this.eventSeq = [ @@ -83,23 +83,23 @@ // Store menu accessible reference while menu is still open. this.menu = getAccessible(this.menuNode); // Hide menu. if (aHow == kViaDisplayStyle) this.menuNode.style.display = "none"; else this.menuNode.style.visibility = "hidden"; - } + }; this.getID = function closeMenu_getID() { return "Close ARIA menu " + aMenuID + " by " + (aHow == kViaDisplayStyle ? "display" : "visibility") + " style tricks"; - } + }; function getMenu(aThisObj) { return aThisObj.menu; } } function focusInsideMenu(aMenuID, aMenuBarID) { this.eventSeq = [ @@ -107,34 +107,34 @@ ]; this.unexpectedEventSeq = [ new invokerChecker(EVENT_MENU_END, getNode(aMenuBarID)) ]; this.invoke = function focusInsideMenu_invoke() { getNode(aMenuID).focus(); - } + }; this.getID = function focusInsideMenu_getID() { return "focus menu '" + aMenuID + "'"; - } + }; } function blurMenu(aMenuBarID) { var eventSeq = [ new invokerChecker(EVENT_MENU_END, getNode(aMenuBarID)), new invokerChecker(EVENT_FOCUS, getNode("outsidemenu")) ]; this.__proto__ = new synthClick("outsidemenu", eventSeq); this.getID = function blurMenu_getID() { return "blur menu"; - } + }; } // ////////////////////////////////////////////////////////////////////////// // Do tests // gA11yEventDumpToConsole = true; // debuging // enableLogging("tree,events,verbose");
--- a/accessible/tests/mochitest/events/test_aria_objattr.html +++ b/accessible/tests/mochitest/events/test_aria_objattr.html @@ -46,17 +46,17 @@ this.finalCheck = function updateARIAHidden() { if (aIsDefined) { testAttrs(aID, {"hidden": "true"}, true); testAttrs(aChildId, {"hidden": "true"}, true); } else { testAbsentAttrs(aID, { "hidden": "true"}); testAbsentAttrs(aChildId, { "hidden": "true"}); } - } + }; } // Debug stuff. // gA11yEventDumpID = "eventdump"; // gA11yEventDumpToConsole = true; function doTests() { gQueue = new eventQueue();
--- a/accessible/tests/mochitest/events/test_attrs.html +++ b/accessible/tests/mochitest/events/test_attrs.html @@ -29,17 +29,17 @@ this.noTarget = getNode(aNoTargetID); this.check = function checker_check(aEvent) { testAttrs(aEvent.accessible, { "event-from-input": aValue }, true); var accessible = getAccessible(this.noTarget); testAbsentAttrs(accessible, { "event-from-input": "" }); - } + }; } /** * Do tests. */ var gQueue = null; // gA11yEventDumpID = "eventdump"; // debug stuff
--- a/accessible/tests/mochitest/events/test_bug1322593-2.html +++ b/accessible/tests/mochitest/events/test_bug1322593-2.html @@ -27,21 +27,21 @@ new orderChecker(), new textChangeChecker("container", 0, 1, "a", true, undefined, true), new textChangeChecker("container", 7, 8, "b", true, undefined, true) ]; this.invoke = function changeMultipleElements_invoke() { this.node1.textContent = "a"; this.node2.textContent = "b"; - } + }; this.getID = function changeMultipleElements_invoke_getID() { return "Change the text content of multiple sibling divs"; - } + }; } // ////////////////////////////////////////////////////////////////////////// // Do tests // gA11yEventDumpToConsole = true; // debugging var gQueue = null; function doTests() {
--- a/accessible/tests/mochitest/events/test_bug1322593.html +++ b/accessible/tests/mochitest/events/test_bug1322593.html @@ -27,21 +27,21 @@ new orderChecker(), new textChangeChecker("div1", 0, 1, "a", true, undefined, true), new textChangeChecker("div2", 0, 1, "b", true, undefined, true) ]; this.invoke = function changeMultipleElements_invoke() { this.node1.textContent = "a"; this.node2.textContent = "b"; - } + }; this.getID = function changeMultipleElements_invoke_getID() { return "Change the text content of multiple sibling divs"; - } + }; } // ////////////////////////////////////////////////////////////////////////// // Do tests // gA11yEventDumpToConsole = true; // debugging var gQueue = null; function doTests() {
--- a/accessible/tests/mochitest/events/test_caretmove.html +++ b/accessible/tests/mochitest/events/test_caretmove.html @@ -28,17 +28,17 @@ this.check = function clickChecker_check(aEvent) { this.__proto__.check(aEvent); if (this.extraNode) { var acc = getAccessible(this.extraNode, [nsIAccessibleText]); is(acc.caretOffset, aExtraCaretOffset, "Wrong caret offset for " + aExtraNodeOrID); } - } + }; } /** * Do tests. */ var gQueue = null; // gA11yEventDumpID = "eventdump"; // debug stuff
--- a/accessible/tests/mochitest/events/test_coalescence.html +++ b/accessible/tests/mochitest/events/test_coalescence.html @@ -38,36 +38,36 @@ this.invoke = function coalescenceBase_invoke() { if (aPerformActionOnChildInTheFirstPlace) { this.invokeAction(this.childNode, aChildAction); this.invokeAction(this.parentNode, aParentAction); } else { this.invokeAction(this.parentNode, aParentAction); this.invokeAction(this.childNode, aChildAction); } - } + }; this.getID = function coalescenceBase_getID() { var childAction = this.getActionName(aChildAction) + " child"; var parentAction = this.getActionName(aParentAction) + " parent"; if (aPerformActionOnChildInTheFirstPlace) return childAction + " and then " + parentAction; return parentAction + " and then " + childAction; - } + }; this.finalCheck = function coalescenceBase_check() { if (this.getEventType(aChildAction) == EVENT_HIDE) { testIsDefunct(this.child); } if (this.getEventType(aParentAction) == EVENT_HIDE) { testIsDefunct(this.parent); } - } + }; // Implementation details this.invokeAction = function coalescenceBase_invokeAction(aNode, aAction) { switch (aAction) { case kRemoveElm: aNode.remove(); break; @@ -85,56 +85,56 @@ case kShowElm: aNode.style.display = "block"; break; default: return INVOKER_ACTION_FAILED; } - } + }; this.getEventType = function coalescenceBase_getEventType(aAction) { switch (aAction) { case kRemoveElm: case kHideElm: return EVENT_HIDE; case kAddElm: case kShowElm: return EVENT_SHOW; } - } + }; this.getActionName = function coalescenceBase_getActionName(aAction) { switch (aAction) { case kRemoveElm: return "remove"; case kHideElm: return "hide"; case kAddElm: return "add"; case kShowElm: return "show"; default: return "??"; } - } + }; this.initSequence = function coalescenceBase_initSequence() { // expected events var eventType = this.getEventType(aParentAction); this.eventSeq = [ new invokerChecker(eventType, this.parentNode), new invokerChecker(EVENT_REORDER, this.hostNode) ]; // unexpected events this.unexpectedEventSeq = [ new invokerChecker(this.getEventType(aChildAction), this.childNode), new invokerChecker(EVENT_REORDER, this.parentNode) ]; - } + }; } /** * Remove or hide mutation events coalescence testing. */ function removeOrHideCoalescenceBase(aChildID, aParentID, aChildAction, aParentAction, aPerformActionOnChildInTheFirstPlace) { @@ -142,17 +142,17 @@ aPerformActionOnChildInTheFirstPlace); this.init = function removeOrHideCoalescenceBase_init() { this.childNode = getNode(aChildID); this.parentNode = getNode(aParentID); this.child = getAccessible(this.childNode); this.parent = getAccessible(this.parentNode); this.hostNode = this.parentNode.parentNode; - } + }; // Initalization this.init(); this.initSequence(); } // ////////////////////////////////////////////////////////////////////////// @@ -234,17 +234,17 @@ * Create and append parent node and create and append child node to it. */ function addParentNChild(aHostID, aPerformActionOnChildInTheFirstPlace) { this.init = function addParentNChild_init() { this.hostNode = getNode(aHostID); this.parentNode = document.createElement("select"); this.childNode = document.createElement("option"); this.childNode.textContent = "testing"; - } + }; this.__proto__ = new coalescenceBase(kAddElm, kAddElm, aPerformActionOnChildInTheFirstPlace); this.init(); this.initSequence(); } @@ -252,17 +252,17 @@ * Show parent node and show child node to it. */ function showParentNChild(aParentID, aChildID, aPerformActionOnChildInTheFirstPlace) { this.init = function showParentNChild_init() { this.parentNode = getNode(aParentID); this.hostNode = this.parentNode.parentNode; this.childNode = getNode(aChildID); - } + }; this.__proto__ = new coalescenceBase(kShowElm, kShowElm, aPerformActionOnChildInTheFirstPlace); this.init(); this.initSequence(); } @@ -271,17 +271,17 @@ */ function showParentNAddChild(aParentID, aPerformActionOnChildInTheFirstPlace) { this.init = function showParentNAddChild_init() { this.parentNode = getNode(aParentID); this.hostNode = this.parentNode.parentNode; this.childNode = document.createElement("option"); this.childNode.textContent = "testing"; - } + }; this.__proto__ = new coalescenceBase(kAddElm, kShowElm, aPerformActionOnChildInTheFirstPlace); this.init(); this.initSequence(); } @@ -300,21 +300,21 @@ new unexpectedInvokerChecker(EVENT_HIDE, getAccessible(aChild2Id)), new unexpectedInvokerChecker(EVENT_REORDER, getAccessible(aParentId)) ]; this.invoke = function removeGrandChildrenNHideParent_invoke() { this.child1.remove(); this.child2.remove(); this.parent.hidden = true; - } + }; this.getID = function removeGrandChildrenNHideParent_getID() { return "remove grand children of different parents and then hide their grand parent"; - } + }; } /** * Remove a child, and then its parent. */ function test3() { this.o = getAccessible("t3_o"); this.ofc = getAccessible("t3_o").firstChild; @@ -324,26 +324,26 @@ new invokerChecker(EVENT_REORDER, "t3_lb"), new unexpectedInvokerChecker(EVENT_HIDE, this.ofc), new unexpectedInvokerChecker(EVENT_REORDER, this.o) ]; this.invoke = function test3_invoke() { getNode("t3_o").textContent = ""; getNode("t3_lb").removeChild(getNode("t3_o")); - } + }; this.finalCheck = function test3_finalCheck() { testIsDefunct(this.o); testIsDefunct(this.ofc); - } + }; this.getID = function test3_getID() { return "remove a child, and then its parent"; - } + }; } /** * Remove children, and then a parent of 2nd child. */ function test4() { this.o1 = getAccessible("t4_o1"); this.o1fc = this.o1.firstChild; @@ -358,27 +358,27 @@ new unexpectedInvokerChecker(EVENT_REORDER, this.o1), new unexpectedInvokerChecker(EVENT_REORDER, this.o2) ]; this.invoke = function test4_invoke() { getNode("t4_o1").textContent = ""; getNode("t4_o2").textContent = ""; getNode("t4_lb").removeChild(getNode("t4_o2")); - } + }; this.finalCheck = function test4_finalCheck() { testIsDefunct(this.o1fc); testIsDefunct(this.o2); testIsDefunct(this.o2fc); - } + }; this.getID = function test4_getID() { return "remove children, and then a parent of 2nd child"; - } + }; } /** * Remove a child, remove a parent sibling, remove the parent */ function test5() { this.o = getAccessible("t5_o"); this.ofc = this.o.firstChild; @@ -393,27 +393,27 @@ new unexpectedInvokerChecker(EVENT_REORDER, this.o), new unexpectedInvokerChecker(EVENT_REORDER, this.lb) ]; this.invoke = function test5_invoke() { getNode("t5_o").textContent = ""; getNode("t5").removeChild(getNode("t5_b")); getNode("t5_lb").removeChild(getNode("t5_o")); - } + }; this.finalCheck = function test5_finalCheck() { testIsDefunct(this.ofc); testIsDefunct(this.o); testIsDefunct(this.b); - } + }; this.getID = function test5_getID() { return "remove a child, remove a parent sibling, remove the parent"; - } + }; } /** * Insert accessibles with a child node moved by aria-owns * Markup: * <div id="t6_fc"> * <div id="t6_owns"></div> * </div>
--- a/accessible/tests/mochitest/events/test_contextmenu.html +++ b/accessible/tests/mochitest/events/test_contextmenu.html @@ -28,50 +28,50 @@ this.DOMNode = getNode(aID); this.eventSeq = [ new invokerChecker(EVENT_MENUPOPUP_START, getContextMenuNode()), ]; this.invoke = function showContextMenu_invoke() { synthesizeMouse(this.DOMNode, 4, 4, { type: "contextmenu", button: 2 }); - } + }; this.getID = function showContextMenu_getID() { return "show context menu"; - } + }; } function selectMenuItem() { this.eventSeq = [ new invokerChecker(EVENT_FOCUS, getFocusedMenuItem) ]; this.invoke = function selectMenuItem_invoke() { synthesizeKey("VK_DOWN", { }); - } + }; this.getID = function selectMenuItem_getID() { return "select first menuitem"; - } + }; } function closeContextMenu(aID) { this.eventSeq = [ new invokerChecker(EVENT_MENUPOPUP_END, getAccessible(getContextMenuNode())) ]; this.invoke = function closeContextMenu_invoke() { synthesizeKey("VK_ESCAPE", { }); - } + }; this.getID = function closeContextMenu_getID() { return "close context menu"; - } + }; } function getContextMenuNode() { return getRootAccessible().DOMDocument. getElementById("contentAreaContextMenu"); } function getFocusedMenuItem() {
--- a/accessible/tests/mochitest/events/test_descrchange.html +++ b/accessible/tests/mochitest/events/test_descrchange.html @@ -23,21 +23,21 @@ <script type="application/javascript"> // ////////////////////////////////////////////////////////////////////////// // Invokers function setAttr(aID, aAttr, aValue, aChecker) { this.eventSeq = [ aChecker ]; this.invoke = function setAttr_invoke() { getNode(aID).setAttribute(aAttr, aValue); - } + }; this.getID = function setAttr_getID() { return "set attr '" + aAttr + "', value '" + aValue + "'"; - } + }; } // ////////////////////////////////////////////////////////////////////////// // Do tests // gA11yEventDumpToConsole = true; // debuggin var gQueue = null;
--- a/accessible/tests/mochitest/events/test_docload.html +++ b/accessible/tests/mochitest/events/test_docload.html @@ -46,35 +46,35 @@ this.eventSeq = [ new invokerChecker(EVENT_REORDER, getAccessible(this.DOMNode)), new asyncInvokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, getIframeDoc) ]; this.invoke = function changeIframeSrc_invoke() { this.DOMNode.src = aURL; - } + }; this.finalCheck = function changeIframeSrc_finalCheck() { var accTree = { role: ROLE_INTERNAL_FRAME, children: [ { role: ROLE_DOCUMENT, name: aURL == "about:" ? "About:" : aURL } ] }; testAccessibleTree(this.DOMNode, accTree); - } + }; this.getID = function changeIframeSrc_getID() { return "change iframe src on " + aURL; - } + }; function getIframeDoc() { return getAccessible(getNode(aIdentifier).contentDocument); } } const kHide = 1; const kShow = 2; @@ -99,58 +99,58 @@ this.invoke = function morphIFrame_invoke() { if (aAction == kHide) { this.DOMNode.style.display = "none"; } else if (aAction == kShow) { this.DOMNode.style.display = "block"; } else { this.IFrameContainerDOMNode.removeChild(this.DOMNode); } - } + }; this.finalCheck = function morphIFrame_finalCheck() { var accTree = { role: ROLE_SECTION, children: (aAction == kHide || aAction == kRemove) ? [ ] : [ { role: ROLE_INTERNAL_FRAME, children: [ { role: ROLE_DOCUMENT } ] } ] }; testAccessibleTree(this.IFrameContainerDOMNode, accTree); - } + }; this.getID = function morphIFrame_getID() { if (aAction == kRemove) return "remove iframe"; return "change display style of iframe to " + ((aAction == kHide) ? "none" : "block"); - } + }; } function makeIFrameVisible(aID) { this.DOMNode = getNode(aID); this.eventSeq = [ new invokerChecker(EVENT_REORDER, this.DOMNode.parentNode) ]; this.invoke = function makeIFrameVisible_invoke() { this.DOMNode.style.visibility = "visible"; - } + }; this.getID = function makeIFrameVisible_getID() { return "The accessible for DOM document loaded before it's shown shouldn't have busy state."; - } + }; } function openDialogWnd(aURL) { // Get application root accessible. var docAcc = getAccessible(document); while (docAcc) { this.mRootAcc = docAcc; try { @@ -162,21 +162,21 @@ } this.eventSeq = [ new invokerChecker(EVENT_REORDER, this.mRootAcc) ]; this.invoke = function openDialogWnd_invoke() { this.mDialog = window.openDialog(aURL); - } + }; this.finalCheck = function openDialogWnd_finalCheck() { this.finalCheckImpl(); - } + }; this.finalCheckImpl = function openDialogWnd_finalCheckImpl() { var accTree = { role: ROLE_APP_ROOT, children: [ { role: ROLE_CHROME_WINDOW }, @@ -200,21 +200,21 @@ this.mDialog.close(); // close() is asynchronous. SimpleTest.executeSoon(function() { ok(!isAccessibleInCache(dlgDoc), "The document accessible for '" + aURL + "' is in cache still!"); }); - } + }; this.getID = function openDialogWnd_getID() { return "open dialog '" + aURL + "'"; - } + }; } function openWndShutdownDoc() { this.__proto__ = new openDialogWnd("../events/docload_wnd.html"); var thisObj = this; var docChecker = { @@ -239,17 +239,17 @@ "The document accessible for iframe is in cache still after iframe hide!"); this.finalCheckImpl(); // After the window is closed all alive subdocument accessibles should // be shut down. ok(!isAccessibleInCache(this.iframeDoc), "The document accessible for iframe is in cache still!"); - } + }; } // ////////////////////////////////////////////////////////////////////////// // Do tests var gQueue = null; // Debug stuff.
--- a/accessible/tests/mochitest/events/test_docload_aria.html +++ b/accessible/tests/mochitest/events/test_docload_aria.html @@ -26,21 +26,21 @@ this.dialogNode = getNode(aID); this.eventSeq = [ new invokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, this.dialogNode) ]; this.invoke = function showARIADialog_invoke() { this.dialogNode.style.display = "block"; - } + }; this.getID = function showARIADialog_getID() { return "show ARIA dialog"; - } + }; } // ////////////////////////////////////////////////////////////////////////// // Do tests var gQueue = null; // Debug stuff.
--- a/accessible/tests/mochitest/events/test_dragndrop.html +++ b/accessible/tests/mochitest/events/test_dragndrop.html @@ -27,44 +27,44 @@ // aria grabbed invoker function changeGrabbed(aNodeOrID, aGrabValue) { this.DOMNode = getNode(aNodeOrID); this.invoke = function changeGrabbed_invoke() { if (aGrabValue != undefined) { this.DOMNode.setAttribute("aria-grabbed", aGrabValue); } - } + }; this.check = function changeGrabbed_check() { testAttrs(aNodeOrID, {"grabbed": aGrabValue}, true); - } + }; this.getID = function changeGrabbed_getID() { return prettyName(aNodeOrID) + " aria-grabbed changed"; - } + }; } // aria dropeffect invoker function changeDropeffect(aNodeOrID, aDropeffectValue) { this.DOMNode = getNode(aNodeOrID); this.invoke = function changeDropeffect_invoke() { if (aDropeffectValue != undefined) { this.DOMNode.setAttribute("aria-dropeffect", aDropeffectValue); } - } + }; this.check = function changeDropeffect_check() { testAttrs(aNodeOrID, {"dropeffect": aDropeffectValue}, true); - } + }; this.getID = function changeDropeffect_getID() { return prettyName(aNodeOrID) + " aria-dropeffect changed"; - } + }; } function doTests() { // Test aria attribute mutation events gQueue = new eventQueue(nsIAccessibleEvent.EVENT_OBJECT_ATTRIBUTE_CHANGED); var id = "grabbable"; gQueue.push(new changeGrabbed(id, "true"));
--- a/accessible/tests/mochitest/events/test_focus_aria_activedescendant.html +++ b/accessible/tests/mochitest/events/test_focus_aria_activedescendant.html @@ -24,42 +24,42 @@ https://bugzilla.mozilla.org/show_bug.cg function changeARIAActiveDescendant(aID, aItemID) { this.eventSeq = [ new focusChecker(aItemID) ]; this.invoke = function changeARIAActiveDescendant_invoke() { getNode(aID).setAttribute("aria-activedescendant", aItemID); - } + }; this.getID = function changeARIAActiveDescendant_getID() { return "change aria-activedescendant on " + aItemID; - } + }; } function insertItemNFocus(aID, aNewItemID) { this.eventSeq = [ new invokerChecker(EVENT_SHOW, aNewItemID), new focusChecker(aNewItemID) ]; this.invoke = function insertItemNFocus_invoke() { var container = getNode(aID); var itemNode = document.createElement("div"); itemNode.setAttribute("id", aNewItemID); itemNode.textContent = aNewItemID; container.appendChild(itemNode); container.setAttribute("aria-activedescendant", aNewItemID); - } + }; this.getID = function insertItemNFocus_getID() { return "insert new node and focus it with ID: " + aNewItemID; - } + }; } var gQueue = null; function doTest() { gQueue = new eventQueue(); gQueue.push(new synthFocus("listbox", new focusChecker("item1"))); gQueue.push(new changeARIAActiveDescendant("listbox", "item2"));
--- a/accessible/tests/mochitest/events/test_focus_general.html +++ b/accessible/tests/mochitest/events/test_focus_general.html @@ -21,59 +21,59 @@ src="../states.js"></script> <script type="application/javascript"> function focusElmWhileSubdocIsFocused(aID) { this.DOMNode = getNode(aID); this.invoke = function focusElmWhileSubdocIsFocused_invoke() { this.DOMNode.focus(); - } + }; this.eventSeq = [ new focusChecker(this.DOMNode) ]; this.unexpectedEventSeq = [ new invokerChecker(EVENT_FOCUS, this.DOMNode.ownerDocument) ]; this.getID = function focusElmWhileSubdocIsFocused_getID() { return "Focus element while subdocument is focused " + prettyName(aID); - } + }; } function imageMapChecker(aID) { var node = getNode(aID); this.type = EVENT_FOCUS; this.match = function imageMapChecker_match(aEvent) { return aEvent.DOMNode == node; - } + }; } function topMenuChecker() { this.type = EVENT_FOCUS; this.match = function topMenuChecker_match(aEvent) { return aEvent.accessible.role == ROLE_PARENT_MENUITEM; - } + }; } function contextMenuChecker() { this.type = EVENT_MENUPOPUP_START; this.match = function contextMenuChecker_match(aEvent) { return aEvent.accessible.role == ROLE_MENUPOPUP; - } + }; } function focusContextMenuItemChecker() { this.__proto__ = new focusChecker(); this.match = function focusContextMenuItemChecker_match(aEvent) { return aEvent.accessible.role == ROLE_MENUITEM; - } + }; } /** * Do tests. */ // gA11yEventDumpID = "eventdump"; // debug stuff // gA11yEventDumpToConsole = true;
--- a/accessible/tests/mochitest/events/test_focus_name.html +++ b/accessible/tests/mochitest/events/test_focus_name.html @@ -22,17 +22,17 @@ */ function actionChecker(aID, aDescription) { this.__proto__ = new invokerChecker(EVENT_FOCUS, aID); this.check = function actionChecker_check(aEvent) { var target = aEvent.accessible; is(target.description, aDescription, "Wrong description for " + prettyName(target)); - } + }; } var gFocusHandler = { handleEvent: function gFocusHandler_handleEvent(aEvent) { var elm = aEvent.target; if (elm.nodeType != nsIDOMNode.ELEMENT_NODE) return; @@ -78,17 +78,17 @@ // The aria-describedby is changed on DOM focus. Accessible description // should be updated when a11y focus is fired. gQueue = new eventQueue(nsIAccessibleEvent.EVENT_FOCUS); gQueue.onFinish = function() { gButtonElm.removeEventListener("focus", gFocusHandler); gButtonElm.removeEventListener("blur", gBlurHandler); gTextboxElm.removeEventListener("focus", gFocusHandler); gTextboxElm.removeEventListener("blur", gBlurHandler); - } + }; var descr = "It's a tooltip"; gQueue.push(new synthFocus("button", new actionChecker("button", descr))); gQueue.push(new synthTab("textbox", new actionChecker("textbox", descr))); gQueue.invoke(); // Will call SimpleTest.finish(); }
--- a/accessible/tests/mochitest/events/test_fromUserInput.html +++ b/accessible/tests/mochitest/events/test_fromUserInput.html @@ -28,22 +28,22 @@ new textChangeChecker(aID, aStart, aEnd, aText, false, aFromUser) ]; this.invoke = function removeTextFromInput_invoke() { this.DOMNode.focus(); this.DOMNode.setSelectionRange(aStart, aEnd); synthesizeKey("VK_DELETE", {}); - } + }; this.getID = function removeTextFromInput_getID() { return "Remove text from " + aStart + " to " + aEnd + " for " + prettyName(aID); - } + }; } /** * Remove text data from text node. */ function removeTextFromContentEditable(aID, aStart, aEnd, aText, aFromUser) { this.DOMNode = getNode(aID); @@ -56,22 +56,22 @@ this.textNode = getNode(aID).firstChild; var selection = window.getSelection(); var range = document.createRange(); range.setStart(this.textNode, aStart); range.setEnd(this.textNode, aEnd); selection.addRange(range); synthesizeKey("VK_DELETE", {}); - } + }; this.getID = function removeTextFromContentEditable_getID() { return "Remove text from " + aStart + " to " + aEnd + " for " + prettyName(aID); - } + }; } // ////////////////////////////////////////////////////////////////////////// // Do tests // gA11yEventDumpID = "eventdump"; // debug stuff var gQueue = null;
--- a/accessible/tests/mochitest/events/test_mutation.html +++ b/accessible/tests/mochitest/events/test_mutation.html @@ -55,47 +55,47 @@ var type = this.getA11yEventType(aEventType); for (var idx = 0; idx < this.getEventSeq().length; idx++) { if (this.getEventSeq()[idx].type == type) { this.getEventSeq()[idx].target = aTarget; return idx; } } return -1; - } + }; /** * Replace the default target currently registered for a given event type * with the nodes in the targets array. */ this.setTargets = function mutateA11yTree_setTargets(aEventType, aTargets) { var targetIdx = this.setTarget(aEventType, aTargets[0]); var type = this.getA11yEventType(aEventType); for (var i = 1; i < aTargets.length; i++) { var checker = new invokerChecker(type, aTargets[i]); this.getEventSeq().splice(++targetIdx, 0, checker); } - } + }; // Implementation this.getA11yEventType = function mutateA11yTree_getA11yEventType(aEventType) { if (aEventType == kReorderEvent) return nsIAccessibleEvent.EVENT_REORDER; if (aEventType == kHideEvent) return nsIAccessibleEvent.EVENT_HIDE; if (aEventType == kShowEvent) return nsIAccessibleEvent.EVENT_SHOW; - } + }; this.getEventSeq = function mutateA11yTree_getEventSeq() { return this.doNotExpectEvents ? this.unexpectedEventSeq : this.eventSeq; - } + }; if (aEventTypes & kHideEvent) { var checker = new invokerChecker(this.getA11yEventType(kHideEvent), this.DOMNode); this.getEventSeq().push(checker); } if (aEventTypes & kShowEvent) { @@ -114,36 +114,36 @@ /** * Change CSS style for the given node. */ function changeStyle(aNodeOrID, aProp, aValue, aEventTypes) { this.__proto__ = new mutateA11yTree(aNodeOrID, aEventTypes, false); this.invoke = function changeStyle_invoke() { this.DOMNode.style[aProp] = aValue; - } + }; this.getID = function changeStyle_getID() { return aNodeOrID + " change style " + aProp + " on value " + aValue; - } + }; } /** * Change class name for the given node. */ function changeClass(aParentNodeOrID, aNodeOrID, aClassName, aEventTypes) { this.__proto__ = new mutateA11yTree(aNodeOrID, aEventTypes, false); this.invoke = function changeClass_invoke() { this.parentDOMNode.className = aClassName; - } + }; this.getID = function changeClass_getID() { return aNodeOrID + " change class " + aClassName; - } + }; this.parentDOMNode = getNode(aParentNodeOrID); } /** * Clone the node and append it to its parent. */ function cloneAndAppendToDOM(aNodeOrID, aEventTypes, @@ -163,41 +163,41 @@ this.setTargets(kShowEvent, targets); if (aReorderTargetFunc) { var reorderTarget = aReorderTargetFunc.call(null, this.DOMNode); this.setTarget(kReorderEvent, reorderTarget); } this.DOMNode.parentNode.appendChild(newElm); - } + }; this.getID = function cloneAndAppendToDOM_getID() { return aNodeOrID + " clone and append to DOM."; - } + }; } /** * Removes the node from DOM. */ function removeFromDOM(aNodeOrID, aEventTypes, aTargetsFunc, aReorderTargetFunc) { var eventTypes = aEventTypes || kHideEvents; var doNotExpectEvents = (aEventTypes == kNoEvents); this.__proto__ = new mutateA11yTree(aNodeOrID, eventTypes, doNotExpectEvents); this.invoke = function removeFromDOM_invoke() { this.DOMNode.remove(); - } + }; this.getID = function removeFromDOM_getID() { return prettyName(aNodeOrID) + " remove from DOM."; - } + }; if (aTargetsFunc && (eventTypes & kHideEvent)) this.setTargets(kHideEvent, aTargetsFunc.call(null, this.DOMNode)); if (aReorderTargetFunc && (eventTypes & kReorderEvent)) this.setTarget(kReorderEvent, aReorderTargetFunc.call(null, this.DOMNode)); } @@ -206,21 +206,21 @@ * Clone the node and replace the original node by cloned one. */ function cloneAndReplaceInDOM(aNodeOrID) { this.__proto__ = new mutateA11yTree(aNodeOrID, kHideAndShowEvents, false); this.invoke = function cloneAndReplaceInDOM_invoke() { this.DOMNode.parentNode.replaceChild(this.newElm, this.DOMNode); - } + }; this.getID = function cloneAndReplaceInDOM_getID() { return aNodeOrID + " clone and replace in DOM."; - } + }; this.newElm = this.DOMNode.cloneNode(true); this.newElm.removeAttribute("id"); this.setTarget(kShowEvent, this.newElm); } /** * Trigger content insertion (flush layout), removal and insertion of @@ -236,22 +236,22 @@ new invokerChecker(EVENT_REORDER, this.containerNode) ]; this.invoke = function test1_invoke() { this.containerNode.appendChild(this.divNode); getComputedStyle(this.divNode, "").color; this.containerNode.removeChild(this.divNode); this.containerNode.appendChild(this.divNode); - } + }; this.getID = function test1_getID() { return "fuzzy test #1: content insertion (flush layout), removal and" + "reinsertion"; - } + }; } /** * Trigger content insertion (flush layout), removal and insertion of * the same element for the different parents. */ function test2(aContainerID, aTmpContainerID) { this.divNode = document.createElement("div"); @@ -270,22 +270,22 @@ new invokerChecker(EVENT_REORDER, this.tmpContainerNode) ]; this.invoke = function test2_invoke() { this.tmpContainerNode.appendChild(this.divNode); getComputedStyle(this.divNode, "").color; this.tmpContainerNode.removeChild(this.divNode); this.containerNode.appendChild(this.divNode); - } + }; this.getID = function test2_getID() { return "fuzzy test #2: content insertion (flush layout), removal and" + "reinsertion under another container"; - } + }; } /** * Content insertion (flush layout) and then removal (nothing was changed). */ function test3(aContainerID) { this.divNode = document.createElement("div"); this.divNode.setAttribute("id", "div-test3"); @@ -296,100 +296,100 @@ new invokerChecker(EVENT_HIDE, this.divNode), new invokerChecker(EVENT_REORDER, this.containerNode) ]; this.invoke = function test3_invoke() { this.containerNode.appendChild(this.divNode); getComputedStyle(this.divNode, "").color; this.containerNode.removeChild(this.divNode); - } + }; this.getID = function test3_getID() { return "fuzzy test #3: content insertion (flush layout) and removal"; - } + }; } function insertReferredElm(aContainerID) { this.containerNode = getNode(aContainerID); this.eventSeq = [ new invokerChecker(EVENT_SHOW, function(aNode) { return aNode.firstChild; }, this.containerNode), new invokerChecker(EVENT_SHOW, function(aNode) { return aNode.lastChild; }, this.containerNode), new invokerChecker(EVENT_REORDER, this.containerNode) ]; this.invoke = function insertReferredElm_invoke() { this.containerNode.innerHTML = "<span id='insertReferredElms_span'></span><input aria-labelledby='insertReferredElms_span'>"; - } + }; this.getID = function insertReferredElm_getID() { return "insert inaccessible element and then insert referring element to make it accessible"; - } + }; } function showHiddenParentOfVisibleChild() { this.eventSeq = [ new invokerChecker(EVENT_HIDE, getNode("c4_child")), new invokerChecker(EVENT_SHOW, getNode("c4_middle")), new invokerChecker(EVENT_REORDER, getNode("c4")) ]; this.invoke = function showHiddenParentOfVisibleChild_invoke() { getNode("c4_middle").style.visibility = "visible"; - } + }; this.getID = function showHiddenParentOfVisibleChild_getID() { return "show hidden parent of visible child"; - } + }; } function hideNDestroyDoc() { this.txt = null; this.eventSeq = [ new invokerChecker(EVENT_HIDE, () => { return this.txt; }) ]; this.invoke = function hideNDestroyDoc_invoke() { this.txt = getAccessible("c5").firstChild.firstChild; this.txt.DOMNode.remove(); - } + }; this.check = function hideNDestroyDoc_check() { getNode("c5").remove(); - } + }; this.getID = function hideNDestroyDoc_getID() { return "remove text node and destroy a document on hide event"; - } + }; } function hideHideNDestroyDoc() { this.target = null; this.eventSeq = [ new invokerChecker(EVENT_HIDE, () => { return this.target; }) ]; this.invoke = function hideHideNDestroyDoc_invoke() { var doc = getAccessible("c6").firstChild; var l1 = doc.firstChild; this.target = l1.firstChild; var l2 = doc.lastChild; l1.DOMNode.firstChild.remove(); l2.DOMNode.firstChild.remove(); - } + }; this.check = function hideHideNDestroyDoc_check() { getNode("c6").remove(); - } + }; this.getID = function hideHideNDestroyDoc_getID() { return "remove text nodes (2 events in the queue) and destroy a document on first hide event"; - } + }; } /** * Target getters. */ function getFirstChild(aNode) { return [aNode.firstChild]; }
--- a/accessible/tests/mochitest/events/test_mutation.xhtml +++ b/accessible/tests/mochitest/events/test_mutation.xhtml @@ -41,21 +41,21 @@ new invokerChecker(EVENT_SHOW, getButtonFromBinding, this.containerNode), new invokerChecker(EVENT_REORDER, this.containerNode) ]; this.invoke = function insertBinding_invoke() { var span = document.createElement("span"); span.setAttribute("style", "-moz-binding:url(#button)"); this.containerNode.appendChild(span); - } + }; this.getID = function insertBinding_getID() { return "insert button binding"; - } + }; } /** * Do tests. */ var gQueue = null; // gA11yEventDumpID = "eventdump"; // debug stuff // gA11yEventDumpToConsole = true;
--- a/accessible/tests/mochitest/events/test_namechange.html +++ b/accessible/tests/mochitest/events/test_namechange.html @@ -23,39 +23,39 @@ <script type="application/javascript"> // ////////////////////////////////////////////////////////////////////////// // Invokers function setAttr(aID, aAttr, aValue, aChecker) { this.eventSeq = [ aChecker ]; this.invoke = function setAttr_invoke() { getNode(aID).setAttribute(aAttr, aValue); - } + }; this.getID = function setAttr_getID() { return "set attr '" + aAttr + "', value '" + aValue + "'"; - } + }; } /** * No name change on an accessible, because the accessible is recreated. */ function setAttr_recreate(aID, aAttr, aValue) { this.eventSeq = [ new invokerChecker(EVENT_HIDE, getAccessible(aID)), new invokerChecker(EVENT_SHOW, aID) ]; this.invoke = function setAttr_recreate_invoke() { todo(false, "No accessible recreation should happen, just name change event"); getNode(aID).setAttribute(aAttr, aValue); - } + }; this.getID = function setAttr_recreate_getID() { return "set attr '" + aAttr + "', value '" + aValue + "'"; - } + }; } // ////////////////////////////////////////////////////////////////////////// // Do tests // gA11yEventDumpToConsole = true; // debuggin var gQueue = null;
--- a/accessible/tests/mochitest/events/test_selection_aria.html +++ b/accessible/tests/mochitest/events/test_selection_aria.html @@ -33,21 +33,21 @@ ]; this.invoke = function selectItem_invoke() { var itemNode = this.selectNode.querySelector("*[aria-selected='true']"); if (itemNode) itemNode.removeAttribute("aria-selected"); this.itemNode.setAttribute("aria-selected", "true"); - } + }; this.getID = function selectItem_getID() { return "select item " + prettyName(aItemID); - } + }; } // ////////////////////////////////////////////////////////////////////////// // Do tests var gQueue = null; // gA11yEventDumpToConsole = true; // debug stuff
--- a/accessible/tests/mochitest/events/test_statechange.html +++ b/accessible/tests/mochitest/events/test_statechange.html @@ -41,17 +41,17 @@ ok(false, "State change event was expected"); } if (!event) { return; } ok(event.isExtraState, "Extra state change was expected"); is(event.state, EXT_STATE_EDITABLE, "Wrong state of statechange event"); ok(event.isEnabled, "Expected editable state to be enabled"); - } + }; this.getID = function editabledoc_getID() { return prettyName(aDocNode) + " editable state changed"; }; } function invalidInput(aNodeOrID) { this.DOMNode = getNode(aNodeOrID); @@ -74,76 +74,76 @@ this.DOMNode = getNode(aID); this.eventSeq = [ new stateChangeChecker(STATE_CHECKED, false, aIsChecked, this.DOMNode) ]; this.invoke = function changeCheckInput_invoke() { this.DOMNode.checked = aIsChecked; - } + }; this.getID = function changeCheckInput_getID() { return "change checked state to '" + aIsChecked + "' for " + prettyName(aID); - } + }; } function stateChangeOnFileInput(aID, aAttr, aValue, aState, aIsExtraState, aIsEnabled) { this.fileControlNode = getNode(aID); this.fileControl = getAccessible(this.fileControlNode); this.browseButton = this.fileControl.firstChild; // No state change events on the label. this.invoke = function stateChangeOnFileInput_invoke() { this.fileControlNode.setAttribute(aAttr, aValue); - } + }; this.eventSeq = [ new stateChangeChecker(aState, aIsExtraState, aIsEnabled, this.fileControl), new stateChangeChecker(aState, aIsExtraState, aIsEnabled, this.browseButton) ]; this.getID = function stateChangeOnFileInput_getID() { return "inherited state change on file input on attribute '" + aAttr + "' change"; - } + }; } function dupeStateChange(aID, aAttr, aValue, aState, aIsExtraState, aIsEnabled) { this.eventSeq = [ new stateChangeChecker(aState, aIsExtraState, aIsEnabled, getNode(aID)) ]; this.invoke = function dupeStateChange_invoke() { getNode(aID).setAttribute(aAttr, aValue); getNode(aID).setAttribute(aAttr, aValue); - } + }; this.getID = function dupeStateChange_getID() { return "duped state change events"; - } + }; } function oppositeStateChange(aID, aAttr, aState, aIsExtraState) { this.eventSeq = [ ]; this.unexpectedEventSeq = [ new stateChangeChecker(aState, aIsExtraState, false, getNode(aID)), new stateChangeChecker(aState, aIsExtraState, true, getNode(aID)) ]; this.invoke = function oppositeStateChange_invoke() { getNode(aID).setAttribute(aAttr, "false"); getNode(aID).setAttribute(aAttr, "true"); - } + }; this.getID = function oppositeStateChange_getID() { return "opposite state change events"; - } + }; } /** * Change concomitant ARIA and native attribute at once. */ function echoingStateChange(aID, aARIAAttr, aAttr, aValue, aState, aIsExtraState, aIsEnabled) { this.eventSeq = [ @@ -154,21 +154,21 @@ if (aValue == null) { getNode(aID).removeAttribute(aARIAAttr); getNode(aID).removeAttribute(aAttr); } else { getNode(aID).setAttribute(aARIAAttr, aValue); getNode(aID).setAttribute(aAttr, aValue); } - } + }; this.getID = function echoingStateChange_getID() { return "enchoing ARIA and native attributes change"; - } + }; } // ////////////////////////////////////////////////////////////////////////// // Do tests var gQueue = null; // var gA11yEventDumpID = "eventdump"; // debug stuff
--- a/accessible/tests/mochitest/events/test_text.html +++ b/accessible/tests/mochitest/events/test_text.html @@ -43,21 +43,21 @@ * Remove inaccessible child node containing accessibles. */ function removeChildSpan(aID) { this.__proto__ = new textRemoveInvoker(aID, 0, 5, "33322"); this.invoke = function removeChildSpan_invoke() { // remove HTML span, a first child of the node this.DOMNode.firstChild.remove(); - } + }; this.getID = function removeChildSpan_getID() { return "Remove inaccessible span containing accessible nodes" + prettyName(aID); - } + }; } /** * Insert inaccessible child node containing accessibles. */ function insertChildSpan(aID, aInsertAllTogether) { this.__proto__ = new textInsertInvoker(aID, 0, 5, "33322"); @@ -81,61 +81,61 @@ var fSpan = document.createElement("span"); fSpan.textContent = "333"; topSpan.appendChild(fSpan); var sSpan = document.createElement("span"); sSpan.textContent = "22"; topSpan.appendChild(sSpan); } - } + }; this.getID = function insertChildSpan_getID() { return "Insert inaccessible span containing accessibles" + prettyName(aID); - } + }; } /** * Remove child embedded accessible. */ function removeChildDiv(aID) { this.__proto__ = new textRemoveInvoker(aID, 5, 6, kEmbedChar); this.invoke = function removeChildDiv_invoke() { var childDiv = this.DOMNode.childNodes[1]; // Ensure accessible is created to get text remove event when it's // removed. getAccessible(childDiv); this.DOMNode.removeChild(childDiv); - } + }; this.getID = function removeChildDiv_getID() { return "Remove accessible div from the middle of text accessible " + prettyName(aID); - } + }; } /** * Insert child embedded accessible. */ function insertChildDiv(aID) { this.__proto__ = new textInsertInvoker(aID, 5, 6, kEmbedChar); this.invoke = function insertChildDiv_invoke() { var childDiv = document.createElement("div"); this.DOMNode.insertBefore(childDiv, this.DOMNode.childNodes[1]); - } + }; this.getID = function insertChildDiv_getID() { return "Insert accessible div into the middle of text accessible " + prettyName(aID); - } + }; } /** * Remove children from text container from first to last child or vice * versa. */ function removeChildren(aID, aLastToFirst, aStart, aEnd, aText) { this.__proto__ = new textRemoveInvoker(aID, aStart, aEnd, aText); @@ -143,63 +143,63 @@ this.invoke = function removeChildren_invoke() { if (aLastToFirst) { while (this.DOMNode.firstChild) this.DOMNode.removeChild(this.DOMNode.lastChild); } else { while (this.DOMNode.firstChild) this.DOMNode.firstChild.remove(); } - } + }; this.getID = function removeChildren_getID() { return "remove children of " + prettyName(aID) + (aLastToFirst ? " from last to first" : " from first to last"); - } + }; } /** * Remove text from HTML input. */ function removeTextFromInput(aID, aStart, aEnd, aText) { this.__proto__ = new textRemoveInvoker(aID, aStart, aEnd, aText); this.eventSeq.push(new invokerChecker(EVENT_TEXT_VALUE_CHANGE, this.DOMNode)); this.invoke = function removeTextFromInput_invoke() { this.DOMNode.focus(); this.DOMNode.setSelectionRange(aStart, aEnd); synthesizeKey("VK_DELETE", {}); - } + }; this.getID = function removeTextFromInput_getID() { return "Remove text from " + aStart + " to " + aEnd + " for " + prettyName(aID); - } + }; } /** * Add text into HTML input. */ function insertTextIntoInput(aID, aStart, aEnd, aText) { this.__proto__ = new textInsertInvoker(aID, aStart, aEnd, aText); this.eventSeq.push(new invokerChecker(EVENT_TEXT_VALUE_CHANGE, this.DOMNode)); this.invoke = function insertTextIntoInput_invoke() { this.DOMNode.focus(); synthesizeKey("a", {}); - } + }; this.getID = function insertTextIntoInput_getID() { return "Insert text to " + aStart + " for " + prettyName(aID); - } + }; } /** * Remove text data from text node of editable area. */ function removeTextFromEditable(aID, aStart, aEnd, aText, aTextNode) { this.__proto__ = new textRemoveInvoker(aID, aStart, aEnd, aText); @@ -208,22 +208,22 @@ var selection = window.getSelection(); var range = document.createRange(); range.setStart(this.textNode, aStart); range.setEnd(this.textNode, aEnd); selection.addRange(range); synthesizeKey("VK_DELETE", {}); - } + }; this.getID = function removeTextFromEditable_getID() { return "Remove text from " + aStart + " to " + aEnd + " for " + prettyName(aID); - } + }; this.textNode = getNode(aTextNode); } // ////////////////////////////////////////////////////////////////////////// // Do tests gA11yEventDumpToConsole = true; // debugging
--- a/accessible/tests/mochitest/events/test_text_alg.html +++ b/accessible/tests/mochitest/events/test_text_alg.html @@ -45,23 +45,23 @@ if (event[3] == kUnexpected) this.unexpectedEventSeq.push(checker); else this.eventSeq.push(checker); } this.invoke = function changeText_invoke() { this.textNode.data = aValue; - } + }; this.getID = function changeText_getID() { return "change text '" + shortenString(this.textData) + "' -> '" + shortenString(this.textNode.data) + "' for " + prettyName(this.containerNode); - } + }; } function expStr(x, doublings) { for (var i = 0; i < doublings; ++i) x = x + x; return x; }
--- a/accessible/tests/mochitest/events/test_textattrchange.html +++ b/accessible/tests/mochitest/events/test_textattrchange.html @@ -40,38 +40,38 @@ var editor = this.DOMNode.QueryInterface(nsIDOMNSEditableElement).editor; var spellChecker = new InlineSpellChecker(editor); spellChecker.enabled = true; // var spellchecker = editor.getInlineSpellChecker(true); // spellchecker.enableRealTimeSpell = true; this.DOMNode.value = "valid text inalid tixt"; - } + }; this.finalCheck = function spelledTextInvoker_finalCheck() { var defAttrs = buildDefaultTextAttrs(this.DOMNode, kInputFontSize, kNormalFontWeight, kInputFontFamily); testDefaultTextAttrs(aID, defAttrs); var attrs = { }; var misspelledAttrs = { "invalid": "spelling" }; testTextAttrs(aID, 0, attrs, defAttrs, 0, 11); testTextAttrs(aID, 11, misspelledAttrs, defAttrs, 11, 17); testTextAttrs(aID, 17, attrs, defAttrs, 17, 18); testTextAttrs(aID, 18, misspelledAttrs, defAttrs, 18, 22); - } + }; this.getID = function spelledTextInvoker_getID() { return "text attribute change for misspelled text"; - } + }; } /** * Do tests. */ // gA11yEventDumpID = "eventdump"; // debug stuff // gA11yEventDumpToConsole = true;
--- a/accessible/tests/mochitest/events/test_valuechange.html +++ b/accessible/tests/mochitest/events/test_valuechange.html @@ -38,106 +38,106 @@ // Note: this should not fire an EVENT_VALUE_CHANGE when aria-valuetext // is not empty if (aValuenow != undefined) this.DOMNode.setAttribute("aria-valuenow", aValuenow); // Note: this should always fire an EVENT_VALUE_CHANGE if (aValuetext != undefined) this.DOMNode.setAttribute("aria-valuetext", aValuetext); - } + }; this.check = function changeARIAValue_check() { var acc = getAccessible(aNodeOrID, [nsIAccessibleValue]); if (!acc) return; // Note: always test against valuetext first because the existence of // aria-valuetext takes precedence over aria-valuenow in gecko. is(acc.value, (aValuetext != undefined) ? aValuetext : aValuenow, "Wrong value of " + prettyName(aNodeOrID)); - } + }; this.getID = function changeARIAValue_getID() { return prettyName(aNodeOrID) + " value changed"; - } + }; } function changeValue(aID, aValue) { this.DOMNode = getNode(aID); this.eventSeq = [new invokerChecker(EVENT_TEXT_VALUE_CHANGE, this.DOMNode) ]; this.invoke = function changeValue_invoke() { this.DOMNode.value = aValue; - } + }; this.check = function changeValue_check() { var acc = getAccessible(this.DOMNode); is(acc.value, aValue, "Wrong value for " + prettyName(aID)); - } + }; this.getID = function changeValue_getID() { return prettyName(aID) + " value changed"; - } + }; } function changeProgressValue(aID, aValue) { this.DOMNode = getNode(aID); this.eventSeq = [new invokerChecker(EVENT_VALUE_CHANGE, this.DOMNode)]; this.invoke = function changeProgressValue_invoke() { this.DOMNode.value = aValue; - } + }; this.check = function changeProgressValue_check() { var acc = getAccessible(this.DOMNode); is(acc.value, aValue + "%", "Wrong value for " + prettyName(aID)); - } + }; this.getID = function changeProgressValue_getID() { return prettyName(aID) + " value changed"; - } + }; } function changeRangeValue(aID) { this.DOMNode = getNode(aID); this.eventSeq = [new invokerChecker(EVENT_VALUE_CHANGE, this.DOMNode)]; this.invoke = function changeRangeValue_invoke() { synthesizeMouse(getNode(aID), 5, 5, { }); - } + }; this.finalCheck = function changeRangeValue_finalCheck() { var acc = getAccessible(this.DOMNode); is(acc.value, "0", "Wrong value for " + prettyName(aID)); - } + }; this.getID = function changeRangeValue_getID() { return prettyName(aID) + " range value changed"; - } + }; } function changeSelectValue(aID, aKey, aValue) { this.eventSeq = [ new invokerChecker(EVENT_TEXT_VALUE_CHANGE, getAccessible(aID)) ]; this.invoke = function changeSelectValue_invoke() { getNode(aID).focus(); synthesizeKey(aKey, {}, window); - } + }; this.finalCheck = function changeSelectValue_finalCheck() { is(getAccessible(aID).value, aValue, "Wrong value for " + prettyName(aID)); - } + }; this.getID = function changeSelectValue_getID() { return `${prettyName(aID)} closed select value change on '${aKey}'' key press`; - } + }; } // enableLogging("DOMEvents"); // gA11yEventDumpToConsole = true; function doTests() { // Test initial values testValue("slider_vn", "5", 5, 0, 1000, 0); testValue("slider_vnvt", "plain", 0, 0, 5, 0);
--- a/accessible/tests/mochitest/focus/test_focusedChild.html +++ b/accessible/tests/mochitest/focus/test_focusedChild.html @@ -23,45 +23,45 @@ this.eventSeq = [ new invokerChecker(EVENT_FOCUS, getDialogAccessible, this) ]; this.invoke = function openWnd_invoke() { this.dialog = window.openDialog("about:mozilla", "AboutMozilla", "chrome,width=600,height=600"); - } + }; this.finalCheck = function openWnd_finalCheck() { var app = getApplicationAccessible(); is(app.focusedChild, getDialogAccessible(this), "Wrong focused child"); this.dialog.close(); - } + }; this.getID = function openWnd_getID() { return "focusedChild for application accessible"; - } + }; function getDialogAccessible(aInvoker) { return getAccessible(aInvoker.dialog.document); } } gA11yEventDumpToConsole = true; var gQueue = null; function doTest() { enableLogging("focus,doclifecycle"); gQueue = new eventQueue(); gQueue.push(new openWnd()); - gQueue.onFinish = function() { disableLogging(); } + gQueue.onFinish = function() { disableLogging(); }; gQueue.invoke(); // Will call SimpleTest.finish(); } SimpleTest.waitForExplicitFinish(); addA11yLoadEvent(doTest); </script> </head>
--- a/accessible/tests/mochitest/focus/test_takeFocus.html +++ b/accessible/tests/mochitest/focus/test_takeFocus.html @@ -24,21 +24,21 @@ function takeFocusInvoker(aID) { this.accessible = getAccessible(aID); this.eventSeq = [ new focusChecker(this.accessible) ]; this.invoke = function takeFocusInvoker_invoke() { this.accessible.takeFocus(); - } + }; this.getID = function takeFocusInvoker_getID() { return "takeFocus for " + prettyName(aID); - } + }; } // ////////////////////////////////////////////////////////////////////////// // Test // gA11yEventDumpToConsole = true; // debug stuff var gQueue = null;
--- a/accessible/tests/mochitest/grid.js +++ b/accessible/tests/mochitest/grid.js @@ -1,74 +1,74 @@ const nsIDOMKeyEvent = Components.interfaces.nsIDOMKeyEvent; /** * Create grid object based on HTML table. */ function grid(aTableIdentifier) { this.getRowCount = function getRowCount() { return this.table.rows.length - (this.table.tHead ? 1 : 0); - } + }; this.getColsCount = function getColsCount() { return this.table.rows[0].cells.length; - } + }; this.getRowAtIndex = function getRowAtIndex(aIndex) { return this.table.rows[this.table.tHead ? aIndex + 1 : aIndex]; - } + }; this.getMaxIndex = function getMaxIndex() { return this.getRowCount() * this.getColsCount() - 1; - } + }; this.getCellAtIndex = function getCellAtIndex(aIndex) { var colsCount = this.getColsCount(); var rowIdx = Math.floor(aIndex / colsCount); var colIdx = aIndex % colsCount; var row = this.getRowAtIndex(rowIdx); return row.cells[colIdx]; - } + }; this.getIndexByCell = function getIndexByCell(aCell) { var colIdx = aCell.cellIndex; var rowIdx = aCell.parentNode.rowIndex; if (this.table.tHead) rowIdx -= 1; var colsCount = this.getColsCount(); return rowIdx * colsCount + colIdx; - } + }; this.getCurrentCell = function getCurrentCell() { var rowCount = this.table.rows.length; var colsCount = this.getColsCount(); for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) { for (var colIdx = 0; colIdx < colsCount; colIdx++) { var cell = this.table.rows[rowIdx].cells[colIdx]; if (cell.hasAttribute("tabindex")) return cell; } } return null; - } + }; this.initGrid = function initGrid() { this.table.addEventListener("keypress", this); this.table.addEventListener("click", this); - } + }; this.handleEvent = function handleEvent(aEvent) { if (aEvent instanceof nsIDOMKeyEvent) this.handleKeyEvent(aEvent); else this.handleClickEvent(aEvent); - } + }; this.handleKeyEvent = function handleKeyEvent(aEvent) { if (aEvent.target.localName != "td") return; var cell = aEvent.target; switch (aEvent.keyCode) { case nsIDOMKeyEvent.DOM_VK_UP: @@ -110,27 +110,27 @@ function grid(aTableIdentifier) { if (idx < this.getMaxIndex()) { cell.removeAttribute("tabindex"); var nextcell = this.getCellAtIndex(idx + 1); nextcell.setAttribute("tabindex", "0"); nextcell.focus(); } break; } - } + }; this.handleClickEvent = function handleClickEvent(aEvent) { if (aEvent.target.localName != "td") return; var curCell = this.getCurrentCell(); var cell = aEvent.target; if (cell != curCell) { curCell.removeAttribute("tabindex"); cell.setAttribute("tabindex", "0"); cell.focus(); } - } + }; this.table = getNode(aTableIdentifier); this.initGrid(); }
--- a/accessible/tests/mochitest/hyperlink/hyperlink.js +++ b/accessible/tests/mochitest/hyperlink/hyperlink.js @@ -19,20 +19,20 @@ function focusLink(aID, aSelectedAfter) this.unexpectedEventSeq.push(checker); this.invoke = function focusLink_invoke() { var expectedStates = (aSelectedAfter ? STATE_FOCUSABLE : 0); var unexpectedStates = (!aSelectedAfter ? STATE_FOCUSABLE : 0) | STATE_FOCUSED; testStates(aID, expectedStates, 0, unexpectedStates, 0); this.node.focus(); - } + }; this.finalCheck = function focusLink_finalCheck() { var expectedStates = (aSelectedAfter ? STATE_FOCUSABLE | STATE_FOCUSED : 0); var unexpectedStates = (!aSelectedAfter ? STATE_FOCUSABLE | STATE_FOCUSED : 0); testStates(aID, expectedStates, 0, unexpectedStates, 0); - } + }; this.getID = function focusLink_getID() { return "focus hyperlink " + prettyName(aID); - } + }; }
--- a/accessible/tests/mochitest/hypertext/test_update.html +++ b/accessible/tests/mochitest/hypertext/test_update.html @@ -28,33 +28,33 @@ a.setAttribute("href", "mozilla.org"); a.textContent = "mozilla"; this.containerNode.appendChild(a); var span = document.createElement("span"); span.textContent = " text "; this.containerNode.appendChild(span); } - } + }; this.finalCheck = function addLinks_finalCheck() { // getLinkAt and getLinkIndex. var htAcc = getAccessible(this.containerNode, [nsIAccessibleHyperText]); for (var jdx = 0; jdx < kLinksCount; jdx++) { var link = htAcc.getLinkAt(jdx); ok(link, "No link at index " + jdx + " for '" + aContainerID + "'"); var linkIdx = htAcc.getLinkIndex(link); is(linkIdx, jdx, "Wrong link index for '" + aContainerID + "'!"); } - } + }; this.getID = function addLinks_getID() { return "Add links for '" + aContainerID + "'"; - } + }; } function updateText(aContainerID) { this.containerNode = getNode(aContainerID); this.container = getAccessible(this.containerNode, nsIAccessibleHyperText); this.text = this.container.firstChild; this.textNode = this.text.DOMNode; this.textLen = this.textNode.data.length; @@ -63,26 +63,26 @@ new invokerChecker(EVENT_TEXT_INSERTED, this.containerNode) ]; this.invoke = function updateText_invoke() { is(this.container.getLinkIndexAtOffset(this.textLen), 0, "Wrong intial text offsets!"); this.text.DOMNode.appendData(" my"); - } + }; this.finalCheck = function updateText_finalCheck() { is(this.container.getLinkIndexAtOffset(this.textLen), -1, "Text offsets weren't updated!"); - } + }; this.getID = function updateText_getID() { return "update text for '" + aContainerID + "'"; - } + }; } /** * Text offsets must be updated when hypertext child is removed. */ function removeChild(aContainerID, aChildID, aInitialText, aFinalText) { this.containerNode = getNode(aContainerID); this.container = getAccessible(this.containerNode, nsIAccessibleText); @@ -93,78 +93,78 @@ "Wrong text before child removal"); this.eventSeq = [ new invokerChecker(EVENT_REORDER, this.containerNode) ]; this.invoke = function removeChild_invoke() { this.containerNode.removeChild(this.childNode); - } + }; this.finalCheck = function removeChild_finalCheck() { is(this.container.getText(0, -1), aFinalText, "Wrong text after child removal"); is(this.container.characterCount, aFinalText.length, "Wrong text after child removal"); - } + }; this.getID = function removeChild_getID() { return "check text after removing child from '" + aContainerID + "'"; - } + }; } function removeFirstChild(aContainer) { this.ht = getAccessible(aContainer, [ nsIAccessibleHyperText ]); this.eventSeq = [ new invokerChecker(EVENT_REORDER, aContainer) ]; this.invoke = function removeFirstChild_invoke() { is(this.ht.linkCount, 2, "Wrong embedded objects count before removal"); getNode(aContainer).removeChild(getNode(aContainer).firstElementChild); - } + }; this.finalCheck = function removeFirstChild_finalCheck() { // check list index before link count is(this.ht.getLinkIndex(this.ht.firstChild), 0, "Wrong child index"); is(this.ht.linkCount, 1, "Wrong embedded objects count after removal"); - } + }; this.getID = function removeFirstChild_getID() { return "Remove first child and check embedded object indeces"; - } + }; } function removeLastChild(aContainer) { this.ht = getAccessible(aContainer, [ nsIAccessibleHyperText ]); this.eventSeq = [ new invokerChecker(EVENT_REORDER, aContainer) ]; this.invoke = function removeLastChild_invoke() { is(this.ht.linkCount, 1, "Wrong embedded objects count before removal"); getNode(aContainer).removeChild(getNode(aContainer).lastElementChild); - } + }; this.finalCheck = function removeLastChild_finalCheck() { is(this.ht.linkCount, 0, "Wrong embedded objects count after removal"); var link = null; try { link = this.ht.getLinkAt(0); } catch (e) { } ok(!link, "No embedded object is expected"); - } + }; this.getID = function removeLastChild_getID() { return "Remove last child and try its embedded object"; - } + }; } // gA11yEventDumpToConsole = true; // debug stuff var gQueue = null; function doTest() { gQueue = new eventQueue(); gQueue.push(new addLinks("p1"));
--- a/accessible/tests/mochitest/jsat/jsatcommon.js +++ b/accessible/tests/mochitest/jsat/jsatcommon.js @@ -376,30 +376,30 @@ var ContentMessages = { name: "AccessFu:MoveCursor", json: { origin: "top", action: "movePrevious", inputType: "gesture", rule: (aRule || "Simple"), adjustRange: true } - } + }; }, moveOrAdjustDown: function moveOrAdjustUp(aRule) { return { name: "AccessFu:MoveCursor", json: { origin: "top", action: "moveNext", inputType: "gesture", rule: (aRule || "Simple"), adjustRange: true } - } + }; }, androidScrollForward: function adjustUp() { return { name: "AccessFu:AndroidScroll", json: { origin: "top", direction: "forward" } }; }, @@ -549,34 +549,34 @@ function ExpectedPresent(aB2g, aAndroid, ExpectedPresent.prototype = Object.create(ExpectedMessage.prototype); ExpectedPresent.prototype.is = function(aReceived, aInfo) { var received = this.extract_presenters(aReceived); for (var presenter of ["b2g", "android"]) { if (!this.options["no_" + presenter]) { - var todo = this.options.todo || this.options[presenter + "_todo"] + var todo = this.options.todo || this.options[presenter + "_todo"]; SimpleTest[todo ? "todo" : "ok"].apply( SimpleTest, this.lazyCompare(received[presenter], this.json[presenter], aInfo + " (" + presenter + ")")); } } }; ExpectedPresent.prototype.extract_presenters = function(aReceived) { var received = { count: 0 }; for (var presenter of aReceived) { if (presenter) { received[presenter.type.toLowerCase()] = presenter.details; received.count++; } } - return received + return received; }; ExpectedPresent.prototype.ignore = function(aMessage) { if (ExpectedMessage.prototype.ignore.call(this, aMessage)) { return true; } var received = this.extract_presenters(aMessage.json);
--- a/accessible/tests/mochitest/jsat/test_content_integration.html +++ b/accessible/tests/mochitest/jsat/test_content_integration.html @@ -299,17 +299,17 @@ [ContentMessages.simpleMoveNext, new ExpectedNoMove()] ]); addA11yLoadEvent(function() { contentTest.start(function() { closeBrowserWindow(); SimpleTest.finish(); }); - }, doc.defaultView) + }, doc.defaultView); }); iframe.src = "data:text/html;charset=utf-8," + doc.defaultView.frameContents; doc.getElementById("appframe").appendChild(iframe); } SimpleTest.waitForExplicitFinish(); addLoadEvent( function() { @@ -320,17 +320,17 @@ // TODO: remove this as part of bug 820712 ["network.disable.ipc.security", true], ["dom.ipc.browser_frames.oop_by_default", true], ["dom.mozBrowserFramesEnabled", true], ["browser.pagethumbnails.capturing_disabled", true] ] - }, doTest) + }, doTest); }, getRootDirectory(window.location.href) + "doc_content_integration.html"); }); </script> </head> <body id="body"> <a target="_blank"
--- a/accessible/tests/mochitest/jsat/test_quicknav_modes.html +++ b/accessible/tests/mochitest/jsat/test_quicknav_modes.html @@ -20,36 +20,36 @@ } function nextMode(aCurrentMode, aNextMode) { return function() { is(AccessFu.Input.quickNavMode.current, aCurrentMode, "initial current mode is correct"); AccessFu.Input.quickNavMode.next(); _expectMode(aNextMode, AccessFuTest.nextTest); - } + }; } function prevMode(aCurrentMode, aNextMode) { return function() { is(AccessFu.Input.quickNavMode.current, aCurrentMode, "initial current mode is correct"); AccessFu.Input.quickNavMode.previous(); _expectMode(aNextMode, AccessFuTest.nextTest); - } + }; } function setMode(aModeIndex, aExpectedMode) { return function() { SpecialPowers.pushPrefEnv( {"set": [["accessibility.accessfu.quicknav_index", aModeIndex]]}, function() { _expectMode(aExpectedMode, AccessFuTest.nextTest); }); - } + }; } function reconfigureModes() { SpecialPowers.pushPrefEnv( {"set": [["accessibility.accessfu.quicknav_modes", "Landmark,Button,Entry,Graphic"]]}, function() { // When the modes are reconfigured, the current mode should // be set to the first in the new list.
--- a/accessible/tests/mochitest/jsat/test_traversal.html +++ b/accessible/tests/mochitest/jsat/test_traversal.html @@ -28,17 +28,17 @@ function doTest() { var doc = currentTabDocument(); var docAcc = getAccessible(doc, [nsIAccessibleDocument]); gQueue = new eventQueue(); gQueue.onFinish = function onFinish() { closeBrowserWindow(); - } + }; queueTraversalSequence(gQueue, docAcc, TraversalRules.Heading, null, ["heading-1", "heading-2", "heading-3", "heading-5"]); queueTraversalSequence(gQueue, docAcc, TraversalRules.Entry, null, ["input-1-1", "label-1-2", "input-1-3", "input-1-4", "input-1-5"]);
--- a/accessible/tests/mochitest/name/test_general.html +++ b/accessible/tests/mochitest/name/test_general.html @@ -205,19 +205,19 @@ testName("ph_password", "a placeholder"); testName("ph_text", "a placeholder"); testName("ph_textarea", "a placeholder"); testName("ph_text2", "a label"); testName("ph_textarea2", "a label"); testName("ph_text3", "a label"); // Test equation image - testName("img_eq", "x^2 + y^2 + z^2") - testName("input_img_eq", "x^2 + y^2 + z^2") - testName("txt_eq", "x^2 + y^2 + z^2") + testName("img_eq", "x^2 + y^2 + z^2"); + testName("input_img_eq", "x^2 + y^2 + z^2"); + testName("txt_eq", "x^2 + y^2 + z^2"); // ////////////////////////////////////////////////////////////////////// // tests for duplicate announcement of content testName("test_note", null); SimpleTest.finish(); }
--- a/accessible/tests/mochitest/name/test_list.html +++ b/accessible/tests/mochitest/name/test_list.html @@ -26,34 +26,34 @@ this.invoke = function bulletUpdate_invoke() { testName("li_end", "1. list end"); var li = document.createElement("li"); li.setAttribute("id", "li_start"); li.textContent = "list start"; getNode("list").insertBefore(li, getNode("li_end")); - } + }; this.finalCheck = function bulletUpdate_finalCheck() { testName("li_start", "1. list start"); testName("li_end", "2. list end"); // change list style type var list = getNode("list"); list.setAttribute("style", "list-style-type: disc;"); getComputedStyle(list, "").color; // make style processing sync testName("li_start", kDiscBulletText + "list start"); testName("li_end", kDiscBulletText + "list end"); - } + }; this.getID = function bulletUpdate_getID() { return "Update bullet of list items"; - } + }; } var gQueue = null; function doTest() { gQueue = new eventQueue(); gQueue.push(new bulletUpdate()); gQueue.invoke(); // SimpleTest.finish(); }
--- a/accessible/tests/mochitest/pivot.js +++ b/accessible/tests/mochitest/pivot.js @@ -30,17 +30,17 @@ var HeadersTraversalRule = preFilter: PREFILTER_INVISIBLE, match: function(aAccessible) { return FILTER_MATCH; }, QueryInterface: XPCOMUtils.generateQI([nsIAccessibleTraversalRule]) -} +}; /** * Traversal rule for all focusable nodes or leafs. */ var ObjectTraversalRule = { getMatchRoles: function(aRules) { aRules.value = []; @@ -506,12 +506,12 @@ function removeVCRootInvoker(aRootNode) /** * A debug utility for writing proper sequences for queueTraversalSequence. */ function dumpTraversalSequence(aPivot, aRule) { var sequence = []; if (aPivot.moveFirst(aRule)) { do { sequence.push("'" + prettyName(aPivot.position) + "'"); - } while (aPivot.moveNext(aRule)) + } while (aPivot.moveNext(aRule)); } SimpleTest.info("\n[" + sequence.join(", ") + "]\n"); }
--- a/accessible/tests/mochitest/pivot/test_virtualcursor.html +++ b/accessible/tests/mochitest/pivot/test_virtualcursor.html @@ -36,17 +36,17 @@ is(docAcc.childDocumentCount, 1, "Expecting one child document"); ok(docAcc.getChildDocumentAt(0).virtualCursor, "child document does not have virtualCursor"); gQueue = new eventQueue(); gQueue.onFinish = function onFinish() { closeBrowserWindow(); - } + }; queueTraversalSequence(gQueue, docAcc, HeadersTraversalRule, null, ["heading-1-1", "heading-2-1", "heading-2-2"]); queueTraversalSequence( gQueue, docAcc, ObjectTraversalRule, null, ["Main Title", "Lorem ipsum ", "dolor", " sit amet. Integer vitae urna leo, id ",
--- a/accessible/tests/mochitest/pivot/test_virtualcursor_text.html +++ b/accessible/tests/mochitest/pivot/test_virtualcursor_text.html @@ -28,17 +28,17 @@ function doTest() { var doc = currentTabDocument(); var docAcc = getAccessible(doc, [nsIAccessibleDocument]); gQueue = new eventQueue(); gQueue.onFinish = function onFinish() { closeBrowserWindow(); - } + }; gQueue.push(new setVCPosInvoker(docAcc, null, null, getAccessible(doc.getElementById("paragraph-1")))); gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0,4], getAccessible(doc.getElementById("paragraph-1"), nsIAccessibleText))); gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", CHAR_BOUNDARY, [4,5], getAccessible(doc.getElementById("paragraph-1"), nsIAccessibleText))); gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", CHAR_BOUNDARY, [3,4],
--- a/accessible/tests/mochitest/relations/test_ui_modalprompt.html +++ b/accessible/tests/mochitest/relations/test_ui_modalprompt.html @@ -40,40 +40,40 @@ } ]; this.invoke = function showAlert_invoke() { window.setTimeout( function() { currentTabDocument().defaultView.alert("hello"); }, 0); - } + }; this.check = function showAlert_finalCheck(aEvent) { var dialog = aEvent.accessible.DOMNode; var info = dialog.ui.infoBody; testRelation(info, RELATION_DESCRIPTION_FOR, dialog); testRelation(dialog, RELATION_DESCRIBED_BY, info); - } + }; this.getID = function showAlert_getID() { return "show alert"; - } + }; } // gA11yEventDumpToConsole = true; // debug var gQueue = null; function doTests() { gQueue = new eventQueue(); gQueue.push(new showAlert()); gQueue.onFinish = function() { synthesizeKey("VK_RETURN", {}, browserWindow()); closeBrowserWindow(); - } + }; gQueue.invoke(); // will call SimpleTest.finish() } if (!hasTabModalPrompts()) { todo(false, "Test disabled when tab modal prompts are not enabled."); } else { SimpleTest.waitForExplicitFinish(); openBrowserWindow(doTests);
--- a/accessible/tests/mochitest/relations/test_update.html +++ b/accessible/tests/mochitest/relations/test_update.html @@ -63,28 +63,28 @@ if (aInsertHostFirst) { document.body.appendChild(this.hostNode); document.body.appendChild(this.dependentNode); } else { document.body.appendChild(this.dependentNode); document.body.appendChild(this.hostNode); } - } + }; this.finalCheck = function insertRelated_finalCheck() { testRelation(this.dependentNode, aDependentRelation, this.hostNode); if (aHostRelation) testRelation(this.hostNode, aHostRelation, this.dependentNode); - } + }; this.getID = function insertRelated_getID() { return "Insert " + aHostRelAttr + "='" + aDependentID + "' node" + (aInsertHostFirst ? " before" : "after") + " dependent node"; - } + }; } /** * Relative accessible recreation shouldn't break accessible relations. * Note: modify this case if the invoke function doesn't change accessible * tree due to changes in layout module. It can be changed on any case * when accessibles are recreated. */ @@ -97,26 +97,26 @@ new invokerChecker(EVENT_SHOW, this.containerNode) ]; this.invoke = function recreateRelatives_invoke() { testRelation(aLabelID, RELATION_LABEL_FOR, aElmID); testRelation(aElmID, RELATION_LABELLED_BY, aLabelID); this.containerNode.style.overflow = "visible"; - } + }; this.finalCheck = function recreateRelatives_finalCheck() { testRelation(aLabelID, RELATION_LABEL_FOR, aElmID); testRelation(aElmID, RELATION_LABELLED_BY, aLabelID); - } + }; this.getID = function recreateRelatives_getID() { return "recreate relatives "; - } + }; } // gA11yEventDumpToConsole = true; // debug var gQueue = null; function doTest() { // Relation updates on ARIA attribute changes.
--- a/accessible/tests/mochitest/states/test_aria_widgetitems.html +++ b/accessible/tests/mochitest/states/test_aria_widgetitems.html @@ -20,49 +20,49 @@ src="../events.js"></script> <script type="application/javascript"> function focusARIAItem(aID, aIsSelected) { this.DOMNode = getNode(aID); this.invoke = function focusARIAItem_invoke() { this.DOMNode.focus(); - } + }; this.check = function focusARIAItem_check(aEvent) { testStates(this.DOMNode, aIsSelected ? STATE_SELECTED : 0, 0, aIsSelected ? 0 : STATE_SELECTED); - } + }; this.getID = function focusARIAItem_getID() { return "Focused ARIA widget item with aria-selected='" + (aIsSelected ? "true', should" : "false', shouldn't") + " have selected state on " + prettyName(aID); - } + }; } function focusActiveDescendantItem(aItemID, aWidgetID, aIsSelected) { this.DOMNode = getNode(aItemID); this.widgetDOMNode = getNode(aWidgetID); this.invoke = function focusActiveDescendantItem_invoke() { this.widgetDOMNode.setAttribute("aria-activedescendant", aItemID); this.widgetDOMNode.focus(); - } + }; this.check = function focusActiveDescendantItem_check(aEvent) { testStates(this.DOMNode, aIsSelected ? STATE_SELECTED : 0, 0, aIsSelected ? 0 : STATE_SELECTED); - } + }; this.getID = function tabActiveDescendant_getID() { return "ARIA widget item managed by activedescendant " + (aIsSelected ? "should" : "shouldn't") + " have the selected state on " + prettyName(aItemID); - } + }; } // ////////////////////////////////////////////////////////////////////////// // Test // gA11yEventDumpID = "eventdump"; // debug stuff // gA11yEventDumpToConsole = true;
--- a/accessible/tests/mochitest/states/test_doc_busy.html +++ b/accessible/tests/mochitest/states/test_doc_busy.html @@ -32,21 +32,21 @@ var unexpectedEventSeq = [ new stateChangeChecker(STATE_BUSY, false, true, document), new stateChangeChecker(STATE_BUSY, false, false, document) ]; defineScenario(this, [], unexpectedEventSeq); // events were coalesced this.invoke = function loadFile_invoke() { synthesizeMouse(getNode("link"), 1, 1, {}); - } + }; this.getID = function loadFile_getID() { return "load file: state busy change events on document"; - } + }; } var gQueue = null; function doTest() { // State busy change event on file loading. // enableLogging("docload"); // debugging gQueue = new eventQueue(); gQueue.push(new loadFile());
--- a/accessible/tests/mochitest/states/test_selects.html +++ b/accessible/tests/mochitest/states/test_selects.html @@ -27,29 +27,29 @@ this.eventSeq = [ new invokerChecker(EVENT_FOCUS, this.comboboxOption) ]; this.invoke = function openComboboxNCheckStates_invoke() { getNode(aID).focus(); synthesizeKey("VK_DOWN", { altKey: true }); - } + }; this.finalCheck = function openComboboxNCheckStates_invoke() { // Expanded state on combobox. testStates(this.combobox, STATE_EXPANDED); // Floating state on combobox list. testStates(this.comboboxList, STATE_FLOATING); - } + }; this.getID = function openComboboxNCheckStates_getID() { return "open combobox and test states"; - } + }; } // gA11yEventDumpToConsole = true; var gQueue = null; function doTest() { // combobox var combobox = getAccessible("combobox");
--- a/accessible/tests/mochitest/states/test_stale.html +++ b/accessible/tests/mochitest/states/test_stale.html @@ -24,56 +24,56 @@ this.eventSeq = [ new invokerChecker(EVENT_REORDER, this.containerNode) ]; this.invoke = function addChild_invoke() { this.childNode = document.createElement("div"); this.containerNode.appendChild(this.childNode); - } + }; this.finalCheck = function addChild_finalCheck() { // no stale state should be set testStates(this.childNode, 0, 0, 0, EXT_STATE_STALE); - } + }; this.getID = function addChild_getID() { return "add child for " + prettyName(aContainerID); - } + }; } function removeChildChecker(aInvoker) { this.type = EVENT_HIDE; this.__defineGetter__("target", function() { return aInvoker.child; }); this.check = function removeChildChecker_check() { // stale state should be set testStates(aInvoker.child, 0, EXT_STATE_STALE); - } + }; } function removeChild(aContainerID) { this.containerNode = getNode(aContainerID); this.child = null; this.eventSeq = [ new removeChildChecker(this) ]; this.invoke = function removeChild_invoke() { var childNode = this.containerNode.firstChild; this.child = getAccessible(childNode); this.containerNode.removeChild(childNode); - } + }; this.getID = function removeChild_getID() { return "remove child from " + prettyName(aContainerID); - } + }; } // gA11yEventDumpToConsole = true; //debugging var gQueue = null; function doTest() { gQueue = new eventQueue();
--- a/accessible/tests/mochitest/text.js +++ b/accessible/tests/mochitest/text.js @@ -297,17 +297,17 @@ function testWordAt(aElement, aWordIndex var startWordOffset = startOffsetObj.value; var endWordOffset = endOffsetObj.value; // Calculate the end word offset. acc.getTextAtOffset(endOffsetObj.value, BOUNDARY_WORD_END, startOffsetObj, endOffsetObj); if (startOffsetObj.value != textLength) - endWordOffset = startOffsetObj.value + endWordOffset = startOffsetObj.value; if (endWordOffset <= startWordOffset) { todo(false, "wrong start and end offset for word at index '" + aWordIndex + "': " + " of text '" + acc.getText(0, -1) + "' in " + prettyName(aElement)); return; }
--- a/accessible/tests/mochitest/text/test_atcaretoffset.html +++ b/accessible/tests/mochitest/text/test_atcaretoffset.html @@ -61,17 +61,17 @@ if (!nextLine.isFakeLine() && this.mOffset == nextLine.start) { if (nextLine.start == this.mLine.end) this.mAtWrappedLineEnd = true; else this.mLine = nextLine; } return true; - } + }; Object.defineProperty(this, "offset", { get: function() { return this.mOffset; } }); Object.defineProperty(this, "offsetDescr", { get: function() { return this.mOffset + " offset (" + this.mLine.number + " line, " + (this.mOffset - this.mLine.start) + " offset on the line)"; } @@ -212,17 +212,17 @@ }); Object.defineProperty(this, "number", { get: function() { return aIndex; } }); Object.defineProperty(this, "wholeText", { get: function() { return aWholeText; } }); this.isFakeLine = function line_isFakeLine() { return aIndex < 0 || aIndex >= aLines.length; - } + }; Object.defineProperty(this, "lastWord", { get: function() { if (aIndex < 0) return new word(this, [], -1); if (aIndex >= aLines.length) return new word(this, [], 0); var words = aLines[aIndex][4].words; @@ -238,17 +238,17 @@ var words = aLines[aIndex][4].words; return new word(this, words, 0); } }); this.isLastWord = function line_isLastWord(aWord) { var lastWord = this.lastWord; return lastWord.start == aWord.start && lastWord.end == aWord.end; - } + }; Object.defineProperty(this, "lineStartFailures", { get: function() { if (aIndex < 0 || aIndex >= aLines.length) return []; return aLines[aIndex][4].lsf || []; } }); @@ -304,20 +304,20 @@ return this.isFakeEndWord() ? aLine.end : aWords[aIndex + 1]; } }); this.toString = function word_toString() { var start = this.start, end = this.end; return "'" + aLine.wholeText.substring(start, end) + "' at [" + start + ", " + end + "]"; - } + }; - this.isFakeStartWord = function() { return aIndex < 0; } - this.isFakeEndWord = function() { return aIndex >= aWords.length; } + this.isFakeStartWord = function() { return aIndex < 0; }; + this.isFakeEndWord = function() { return aIndex >= aWords.length; }; } /** * A template invoker to move through the text. */ function tmpl_moveTo(aID, aInvokerFunc, aWholeText, aCharIter) { this.offset = aCharIter.offset; @@ -343,26 +343,26 @@ isOk2 = failure[3]; isOk3 = failure[4]; } } func.call(null, kCaretOffset, boundary, text, startOffset, endOffset, aID, isOk1, isOk2, isOk3); } - } + }; this.getID = function genericMoveTo_getID() { return "move to " + this.offsetDescr; - } + }; this.noTests = function tmpl_moveTo_noTests() { return ("debugOffset" in aCharIter) && (aCharIter.debugOffset != this.offset); - } + }; this.offsetDescr = aCharIter.offsetDescr; this.tests = this.noTests() ? null : aCharIter.tests; this.failures = aCharIter.failures; } var gQueue = null; function doTest() {
--- a/accessible/tests/mochitest/text/test_dynamic.html +++ b/accessible/tests/mochitest/text/test_dynamic.html @@ -18,45 +18,45 @@ function insertBefore(aId, aEl, aTextBefore, aTextAfter, aStartIdx, aEndIdx) { this.eventSeq = [ new invokerChecker(EVENT_REORDER, aId) ]; this.invoke = function insertBefore_invoke() { testText(aId, 0, -1, aTextBefore); getNode(aId).insertBefore(aEl, getNode(aId).firstChild); - } + }; this.finalCheck = function insertBefore_finalCheck() { testText(aId, aStartIdx, aEndIdx, aTextAfter); - } + }; this.getID = function insertTextBefore_getID() { return "insert " + prettyName(aEl) + " before"; - } + }; } function insertTextBefore(aId, aTextBefore, aText) { var el = document.createTextNode(aText); this.__proto__ = new insertBefore(aId, el, aTextBefore, - aText + aTextBefore, 0, -1) + aText + aTextBefore, 0, -1); } function insertImgBefore(aId, aTextBefore) { var el = document.createElement("img"); el.setAttribute("src", "../moz.png"); el.setAttribute("alt", "mozilla"); this.__proto__ = new insertBefore(aId, el, aTextBefore, - kEmbedChar + aTextBefore, 0, -1) + kEmbedChar + aTextBefore, 0, -1); } function insertTextBefore2(aId) { var el = document.createTextNode("hehe"); - this.__proto__ = new insertBefore(aId, el, "ho", "ho", 4, -1) + this.__proto__ = new insertBefore(aId, el, "ho", "ho", 4, -1); } var gQueue = null; function doTest() { gQueue = new eventQueue(); gQueue.push(new insertTextBefore("c1", "ho", "ha")); gQueue.push(new insertImgBefore("c1", "haho")); gQueue.push(new insertImgBefore("c2", kEmbedChar));
--- a/accessible/tests/mochitest/textcaret/test_general.html +++ b/accessible/tests/mochitest/textcaret/test_general.html @@ -44,17 +44,17 @@ var nodeOffset = aList[i].DOMPoint[1]; var textAcc = aList[i].point[0]; var textOffset = aList[i].point[1]; var textList = aList[i].pointList; var invoker = new moveCaretToDOMPoint(textAcc, node, nodeOffset, textOffset, ((i == 0) ? aFocusNode : null), - testCaretOffsets.bind(null, textList)) + testCaretOffsets.bind(null, textList)); gQueue.push(invoker); } } /** * Do tests. */ var gQueue = null; @@ -117,17 +117,17 @@ point: [ getNode("p2", p2Doc), 3 ], pointList: [ [ p2Doc, 0 ] ] } ]; queueTraversalList(traversalList, getNode("p2", p2Doc)); gQueue.onFinish = function() { turnCaretBrowsing(false); - } + }; gQueue.invoke(); // Will call SimpleTest.finish(); } SimpleTest.waitForExplicitFinish(); addA11yLoadEvent(doTests); </script> </head>
--- a/accessible/tests/mochitest/textselection/test_general.html +++ b/accessible/tests/mochitest/textselection/test_general.html @@ -23,83 +23,83 @@ this.hyperText = getAccessible(aID, [ nsIAccessibleText ]); this.eventSeq = [ new invokerChecker(EVENT_TEXT_SELECTION_CHANGED, aID) ]; this.invoke = function addSelection_invoke() { this.hyperText.addSelection(aStartOffset, aEndOffset); - } + }; this.finalCheck = function addSelection_finalCheck() { is(this.hyperText.selectionCount, 1, "addSelection: Wrong selection count for " + aID); var startOffset = {}, endOffset = {}; this.hyperText.getSelectionBounds(0, startOffset, endOffset); is(startOffset.value, aStartOffset, "addSelection: Wrong start offset for " + aID); is(endOffset.value, aEndOffset, "addSelection: Wrong end offset for " + aID); - } + }; this.getID = function addSelection_getID() { return "nsIAccessibleText::addSelection test for " + aID; - } + }; } function changeSelection(aID, aStartOffset, aEndOffset) { this.hyperTextNode = getNode(aID); this.hyperText = getAccessible(aID, [ nsIAccessibleText ]); this.eventSeq = [ new invokerChecker(EVENT_TEXT_SELECTION_CHANGED, aID) ]; this.invoke = function changeSelection_invoke() { this.hyperText.setSelectionBounds(0, aStartOffset, aEndOffset); - } + }; this.finalCheck = function changeSelection_finalCheck() { is(this.hyperText.selectionCount, 1, "setSelectionBounds: Wrong selection count for " + aID); var startOffset = {}, endOffset = {}; this.hyperText.getSelectionBounds(0, startOffset, endOffset); is(startOffset.value, aStartOffset, "setSelectionBounds: Wrong start offset for " + aID); is(endOffset.value, aEndOffset, "setSelectionBounds: Wrong end offset for " + aID); - } + }; this.getID = function changeSelection_getID() { return "nsIAccessibleText::setSelectionBounds test for " + aID; - } + }; } function removeSelection(aID) { this.hyperText = getAccessible(aID, [ nsIAccessibleText ]); this.eventSeq = [ new invokerChecker(EVENT_TEXT_SELECTION_CHANGED, document) ]; this.invoke = function removeSelection_invoke() { this.hyperText.removeSelection(0); - } + }; this.finalCheck = function removeSelection_finalCheck() { is(this.hyperText.selectionCount, 0, "removeSelection: Wrong selection count for " + aID); - } + }; this.getID = function removeSelection_getID() { return "nsIAccessibleText::removeSelection test for " + aID; - } + }; } function changeDOMSelection(aID, aNodeID1, aNodeOffset1, aNodeID2, aNodeOffset2, aTests) { this.hyperText = getAccessible(aID, [ nsIAccessibleText ]); this.eventSeq = [ @@ -107,36 +107,36 @@ ]; this.invoke = function changeDOMSelection_invoke() { var sel = window.getSelection(); var range = document.createRange(); range.setStart(getNode(aNodeID1), aNodeOffset1); range.setEnd(getNode(aNodeID2), aNodeOffset2); sel.addRange(range); - } + }; this.finalCheck = function changeDOMSelection_finalCheck() { for (var i = 0; i < aTests.length; i++) { var text = getAccessible(aTests[i][0], nsIAccessibleText); is(text.selectionCount, 1, "setSelectionBounds: Wrong selection count for " + aID); var startOffset = {}, endOffset = {}; text.getSelectionBounds(0, startOffset, endOffset); is(startOffset.value, aTests[i][1], "setSelectionBounds: Wrong start offset for " + aID); is(endOffset.value, aTests[i][2], "setSelectionBounds: Wrong end offset for " + aID); } - } + }; this.getID = function changeDOMSelection_getID() { return "DOM selection change for " + aID; - } + }; } function onfocusEventSeq(aID) { var caretMovedChecker = new invokerChecker(EVENT_TEXT_CARET_MOVED, aID); var selChangedChecker = new invokerChecker(EVENT_TEXT_SELECTION_CHANGED, aID); selChangedChecker.unexpected = true;
--- a/accessible/tests/mochitest/textselection/test_userinput.html +++ b/accessible/tests/mochitest/textselection/test_userinput.html @@ -36,21 +36,21 @@ try { var startOffsetObj = {}, endOffsetObj = {}; prevTabbed.getSelectionBounds(0, startOffsetObj, endOffsetObj); } catch (e) { exceptionCaught = true; } ok(exceptionCaught, "No selection was expected for " + aPrevID); - } + }; this.getID = function changeSelection_getID() { return "Hidden selection check for " + aPrevID; - } + }; } /** * Do tests */ // gA11yEventDumpToConsole = true; // debug stuff
--- a/accessible/tests/mochitest/tree/dockids.html +++ b/accessible/tests/mochitest/tree/dockids.html @@ -14,17 +14,17 @@ l.href = "http://www.mozilla.org"; l.textContent = "Another "; document.documentElement.appendChild(l); l = document.createElement("a"); l.href = "http://www.mozilla.org"; l.textContent = "Yet another link to mozilla"; document.documentElement.appendChild(l); - } + }; </script> </head> <body> Hey, I'm a <body> with three links that are not inside me and an input that's not inside me. </body> </body> </html>
--- a/accessible/tests/mochitest/tree/test_aria_menu.html +++ b/accessible/tests/mochitest/tree/test_aria_menu.html @@ -19,41 +19,41 @@ tree = { SECTION: [ // container { MENUPOPUP: [ // menu { MENUITEM: [ { STATICTEXT: [] }, // bullet { TEXT_LEAF: [] } ] } ] } - ] } + ] }; testAccessibleTree("menu", tree); // Menuitem with explicit no popup. tree = { SECTION: [ // container { MENUPOPUP: [ // menu { MENUITEM: [ { STATICTEXT: [] }, // bullet { TEXT_LEAF: [] } ] } ] } - ] } + ] }; testAccessibleTree("menu_nopopup", tree); // Menuitem with popup. tree = { SECTION: [ // container { MENUPOPUP: [ // menu { PARENT_MENUITEM: [ // menuitem with aria-haspopup="true" { STATICTEXT: [] }, // bullet { TEXT_LEAF: [] } ] } ] } - ] } + ] }; testAccessibleTree("menu_popup", tree); SimpleTest.finish(); } SimpleTest.waitForExplicitFinish(); addA11yLoadEvent(doTest); </script>
--- a/accessible/tests/mochitest/tree/test_cssoverflow.html +++ b/accessible/tests/mochitest/tree/test_cssoverflow.html @@ -31,48 +31,48 @@ this.link = getAccessible(this.linkNode); this.eventSeq = [ new invokerChecker(EVENT_FOCUS, getAccessible, this.linkNode) ]; this.invoke = function focusAnchor_invoke() { this.linkNode.focus(); - } + }; this.check = function focusAnchor_check(aEvent) { todo_is(this.link, aEvent.accessible, "Focus should be fired against new link accessible!"); - } + }; this.getID = function focusAnchor_getID() { return "focus a:focus{overflow:scroll} #1"; - } + }; } function tabAnchor(aID) { this.linkNode = getNode(aID); this.link = getAccessible(this.linkNode); this.eventSeq = [ new invokerChecker(EVENT_FOCUS, getAccessible, this.linkNode) ]; this.invoke = function tabAnchor_invoke() { synthesizeKey("VK_TAB", { shiftKey: false }); - } + }; this.check = function tabAnchor_check(aEvent) { todo_is(this.link, aEvent.accessible, "Focus should be fired against new link accessible!"); - } + }; this.getID = function tabAnchor_getID() { return "focus a:focus{overflow:scroll} #2"; - } + }; } // ////////////////////////////////////////////////////////////////////////// // Do tests var gQueue = null; // gA11yEventDumpID = "eventdump"; // debug stuff // gA11yEventDumpToConsole = true;
--- a/accessible/tests/mochitest/treeupdate/test_ariadialog.html +++ b/accessible/tests/mochitest/treeupdate/test_ariadialog.html @@ -30,37 +30,37 @@ ]; this.invoke = function showARIADialog_invoke() { getNode("dialog").style.display = "block"; getNode("table").style.visibility = "visible"; getNode("a").textContent = "link"; getNode("input").value = "hello"; getNode("input").focus(); - } + }; this.finalCheck = function showARIADialog_finalCheck() { var tree = { role: ROLE_DIALOG, children: [ { role: ROLE_PUSHBUTTON, children: [ { role: ROLE_TEXT_LEAF } ] }, { role: ROLE_ENTRY } ] }; testAccessibleTree(aID, tree); - } + }; this.getID = function showARIADialog_getID() { return "show ARIA dialog"; - } + }; } // ////////////////////////////////////////////////////////////////////////// // Test // gA11yEventDumpID = "eventdump"; // debug stuff // gA11yEventDumpToConsole = true;
--- a/accessible/tests/mochitest/treeupdate/test_ariaowns.html +++ b/accessible/tests/mochitest/treeupdate/test_ariaowns.html @@ -42,241 +42,241 @@ { SECTION: [] } ] }, { PUSHBUTTON: [ ] } ] }; testAccessibleTree("t1_container", tree); getNode("t1_container"). setAttribute("aria-owns", "t1_button t1_subdiv"); - } + }; this.finalCheck = function setARIAOwns_finalCheck() { // children are swapped again, button and subdiv are appended to // the children. var tree = { SECTION: [ { CHECKBUTTON: [ ] }, // checkbox, native order { PUSHBUTTON: [ ] }, // button, rearranged by ARIA own { SECTION: [ ] } // subdiv from the subtree, ARIA owned ] }; testAccessibleTree("t1_container", tree); - } + }; this.getID = function setARIAOwns_getID() { return "Change @aria-owns attribute"; - } + }; } function removeARIAOwns() { this.eventSeq = [ new invokerChecker(EVENT_HIDE, getNode("t1_button")), new invokerChecker(EVENT_HIDE, getNode("t1_subdiv")), new orderChecker(), new asyncInvokerChecker(EVENT_SHOW, getNode("t1_button")), new asyncInvokerChecker(EVENT_SHOW, getNode("t1_subdiv")), new orderChecker(), new invokerChecker(EVENT_REORDER, getNode("t1_container")), new unexpectedInvokerChecker(EVENT_REORDER, getNode("t1_checkbox")) ]; this.invoke = function removeARIAOwns_invoke() { getNode("t1_container").removeAttribute("aria-owns"); - } + }; this.finalCheck = function removeARIAOwns_finalCheck() { // children follow the DOM order var tree = { SECTION: [ { PUSHBUTTON: [ ] }, { CHECKBUTTON: [ { SECTION: [] } ] } ] }; testAccessibleTree("t1_container", tree); - } + }; this.getID = function removeARIAOwns_getID() { return "Remove @aria-owns attribute"; - } + }; } function setARIAOwns() { this.eventSeq = [ new invokerChecker(EVENT_HIDE, getNode("t1_button")), new invokerChecker(EVENT_HIDE, getNode("t1_subdiv")), new invokerChecker(EVENT_SHOW, getNode("t1_button")), new invokerChecker(EVENT_SHOW, getNode("t1_subdiv")), new invokerChecker(EVENT_REORDER, getNode("t1_container")) ]; this.invoke = function setARIAOwns_invoke() { getNode("t1_container"). setAttribute("aria-owns", "t1_button t1_subdiv"); - } + }; this.finalCheck = function setARIAOwns_finalCheck() { // children are swapped again, button and subdiv are appended to // the children. var tree = { SECTION: [ { CHECKBUTTON: [ ] }, // checkbox { PUSHBUTTON: [ ] }, // button, rearranged by ARIA own { SECTION: [ ] } // subdiv from the subtree, ARIA owned ] }; testAccessibleTree("t1_container", tree); - } + }; this.getID = function setARIAOwns_getID() { return "Set @aria-owns attribute"; - } + }; } function addIdToARIAOwns() { this.eventSeq = [ new invokerChecker(EVENT_HIDE, getNode("t1_group")), new invokerChecker(EVENT_SHOW, getNode("t1_group")), new invokerChecker(EVENT_REORDER, document) ]; this.invoke = function addIdToARIAOwns_invoke() { getNode("t1_container"). setAttribute("aria-owns", "t1_button t1_subdiv t1_group"); - } + }; this.finalCheck = function addIdToARIAOwns_finalCheck() { // children are swapped again, button and subdiv are appended to // the children. var tree = { SECTION: [ { CHECKBUTTON: [ ] }, // t1_checkbox { PUSHBUTTON: [ ] }, // button, t1_button { SECTION: [ ] }, // subdiv from the subtree, t1_subdiv { GROUPING: [ ] } // group from outside, t1_group ] }; testAccessibleTree("t1_container", tree); - } + }; this.getID = function addIdToARIAOwns_getID() { return "Add id to @aria-owns attribute value"; - } + }; } function appendEl() { this.eventSeq = [ new invokerChecker(EVENT_SHOW, getNode, "t1_child3"), new invokerChecker(EVENT_REORDER, getNode("t1_container")) ]; this.invoke = function appendEl_invoke() { var div = document.createElement("div"); div.setAttribute("id", "t1_child3"); - div.setAttribute("role", "radio") + div.setAttribute("role", "radio"); getNode("t1_container").appendChild(div); - } + }; this.finalCheck = function appendEl_finalCheck() { // children are invalidated, they includes aria-owns swapped kids and // newly inserted child. var tree = { SECTION: [ { CHECKBUTTON: [ ] }, // existing explicit, t1_checkbox { RADIOBUTTON: [ ] }, // new explicit, t1_child3 { PUSHBUTTON: [ ] }, // ARIA owned, t1_button { SECTION: [ ] }, // ARIA owned, t1_subdiv { GROUPING: [ ] } // ARIA owned, t1_group ] }; testAccessibleTree("t1_container", tree); - } + }; this.getID = function appendEl_getID() { return "Append child under @aria-owns element"; - } + }; } function removeEl() { this.eventSeq = [ new invokerChecker(EVENT_HIDE, getNode, "t1_checkbox"), new invokerChecker(EVENT_SHOW, getNode, "t1_checkbox"), new invokerChecker(EVENT_REORDER, getNode("t1_container")) ]; this.invoke = function removeEl_invoke() { // remove a container of t1_subdiv getNode("t1_span").remove(); - } + }; this.finalCheck = function removeEl_finalCheck() { // subdiv should go away var tree = { SECTION: [ { CHECKBUTTON: [ ] }, // explicit, t1_checkbox { RADIOBUTTON: [ ] }, // explicit, t1_child3 { PUSHBUTTON: [ ] }, // ARIA owned, t1_button { GROUPING: [ ] } // ARIA owned, t1_group ] }; testAccessibleTree("t1_container", tree); - } + }; this.getID = function removeEl_getID() { return "Remove a container of ARIA owned element"; - } + }; } function removeId() { this.eventSeq = [ new invokerChecker(EVENT_HIDE, getNode("t1_group")), new invokerChecker(EVENT_SHOW, getNode("t1_group")), new invokerChecker(EVENT_REORDER, document) ]; this.invoke = function removeId_invoke() { getNode("t1_group").removeAttribute("id"); - } + }; this.finalCheck = function removeId_finalCheck() { var tree = { SECTION: [ { CHECKBUTTON: [ ] }, { RADIOBUTTON: [ ] }, { PUSHBUTTON: [ ] } // ARIA owned, t1_button ] }; testAccessibleTree("t1_container", tree); - } + }; this.getID = function removeId_getID() { return "Remove ID from ARIA owned element"; - } + }; } function setId() { this.eventSeq = [ new invokerChecker(EVENT_HIDE, getNode("t1_grouptmp")), new invokerChecker(EVENT_SHOW, getNode("t1_grouptmp")), new invokerChecker(EVENT_REORDER, document) ]; this.invoke = function setId_invoke() { getNode("t1_grouptmp").setAttribute("id", "t1_group"); - } + }; this.finalCheck = function setId_finalCheck() { var tree = { SECTION: [ { CHECKBUTTON: [ ] }, { RADIOBUTTON: [ ] }, { PUSHBUTTON: [ ] }, // ARIA owned, t1_button { GROUPING: [ ] } // ARIA owned, t1_group, previously t1_grouptmp ] }; testAccessibleTree("t1_container", tree); - } + }; this.getID = function setId_getID() { return "Set ID that is referred by ARIA owns"; - } + }; } /** * Remove an accessible DOM element containing an element referred by * ARIA owns. */ function removeA11eteiner() { this.eventSeq = [ @@ -286,43 +286,43 @@ this.invoke = function removeA11eteiner_invoke() { var tree = { SECTION: [ { CHECKBUTTON: [ ] } // ARIA owned, 't2_owned' ] }; testAccessibleTree("t2_container1", tree); getNode("t2_container2").removeChild(getNode("t2_container3")); - } + }; this.finalCheck = function removeA11eteiner_finalCheck() { var tree = { SECTION: [ ] }; testAccessibleTree("t2_container1", tree); - } + }; this.getID = function removeA11eteiner_getID() { return "Remove an accessible DOM element containing an element referred by ARIA owns"; - } + }; } /** * Attempt to steal an element from other ARIA owns element. This should * not be possible. The only child that will get owned into this * container is a previously not aria-owned one. */ function stealFromOtherARIAOwns() { this.eventSeq = [ new invokerChecker(EVENT_REORDER, getNode("t3_container3")) ]; this.invoke = function stealFromOtherARIAOwns_invoke() { getNode("t3_container3").setAttribute("aria-owns", "t3_child t3_child2"); - } + }; this.finalCheck = function stealFromOtherARIAOwns_finalCheck() { var tree = { SECTION: [ { CHECKBUTTON: [ ] } ] }; testAccessibleTree("t3_container1", tree); @@ -333,110 +333,110 @@ testAccessibleTree("t3_container2", tree); tree = { SECTION: [ { CHECKBUTTON: [ ] } ] }; testAccessibleTree("t3_container3", tree); - } + }; this.getID = function stealFromOtherARIAOwns_getID() { return "Steal an element from other ARIA owns element"; - } + }; } function appendElToRecacheChildren() { this.eventSeq = [ new invokerChecker(EVENT_REORDER, getNode("t3_container3")) ]; this.invoke = function appendElToRecacheChildren_invoke() { var div = document.createElement("div"); - div.setAttribute("role", "radio") + div.setAttribute("role", "radio"); getNode("t3_container3").appendChild(div); - } + }; this.finalCheck = function appendElToRecacheChildren_finalCheck() { var tree = { SECTION: [ ] }; testAccessibleTree("t3_container2", tree); tree = { SECTION: [ { RADIOBUTTON: [ ] }, { CHECKBUTTON: [ ] } // ARIA owned ] }; testAccessibleTree("t3_container3", tree); - } + }; this.getID = function appendElToRecacheChildren_getID() { return "Append a child under @aria-owns element to trigger children recache"; - } + }; } function showHiddenElement() { this.eventSeq = [ new invokerChecker(EVENT_REORDER, getNode("t4_container1")) ]; this.invoke = function showHiddenElement_invoke() { var tree = { SECTION: [ { RADIOBUTTON: [] } ] }; testAccessibleTree("t4_container1", tree); getNode("t4_child1").style.display = "block"; - } + }; this.finalCheck = function showHiddenElement_finalCheck() { var tree = { SECTION: [ { CHECKBUTTON: [] }, { RADIOBUTTON: [] } ] }; testAccessibleTree("t4_container1", tree); - } + }; this.getID = function showHiddenElement_getID() { return "Show hidden ARIA owns referred element"; - } + }; } function rearrangeARIAOwns(aContainer, aAttr, aIdList, aRoleList) { this.eventSeq = []; for (var id of aIdList) { this.eventSeq.push(new invokerChecker(EVENT_HIDE, getNode(id))); } for (var id of aIdList) { this.eventSeq.push(new invokerChecker(EVENT_SHOW, getNode(id))); } this.eventSeq.push(new invokerChecker(EVENT_REORDER, getNode(aContainer))); this.invoke = function rearrangeARIAOwns_invoke() { getNode(aContainer).setAttribute("aria-owns", aAttr); - } + }; this.finalCheck = function rearrangeARIAOwns_finalCheck() { var tree = { SECTION: [ ] }; for (var role of aRoleList) { var ch = {}; ch[role] = []; tree.SECTION.push(ch); } testAccessibleTree(aContainer, tree); - } + }; this.getID = function rearrangeARIAOwns_getID() { return `Rearrange @aria-owns attribute to '${aAttr}'`; - } + }; } function removeNotARIAOwnedEl(aContainer, aChild) { this.eventSeq = [ new invokerChecker(EVENT_REORDER, aContainer) ]; this.invoke = function removeNotARIAOwnedEl_invoke() { @@ -444,46 +444,46 @@ SECTION: [ { TEXT_LEAF: [ ] }, { GROUPING: [ ] } ] }; testAccessibleTree(aContainer, tree); getNode(aContainer).removeChild(getNode(aChild)); - } + }; this.finalCheck = function removeNotARIAOwnedEl_finalCheck() { var tree = { SECTION: [ { GROUPING: [ ] } ] }; testAccessibleTree(aContainer, tree); - } + }; this.getID = function removeNotARIAOwnedEl_getID() { return `remove not ARIA owned child`; - } + }; } function setARIAOwnsOnElToRemove(aParent, aChild) { this.eventSeq = [ new invokerChecker(EVENT_HIDE, getAccessible(aParent)) ]; this.invoke = function setARIAOwnsOnElToRemove_invoke() { getNode(aChild).setAttribute("aria-owns", "no_id"); getNode(aParent).removeChild(getNode(aChild)); getNode(aParent).remove(); - } + }; this.getID = function setARIAOwnsOnElToRemove_getID() { return `set ARIA owns on an element, and then remove it, and then remove its parent`; - } + }; } /** * Set ARIA owns on inaccessible span element that contains * accessible children. This will move children from the container for * the span. */ function test8() { @@ -497,34 +497,34 @@ { PUSHBUTTON: [] }, { ENTRY: [] }, { ENTRY: [] }, { ENTRY: [] } ] }; testAccessibleTree("t8_container", tree); getNode(t8_container).setAttribute("aria-owns", "t8_span t8_button"); - } + }; this.finalCheck = function test8_finalCheck() { var tree = { SECTION: [ { TEXT: [ { ENTRY: [] }, { ENTRY: [] }, { ENTRY: [] } ] }, { PUSHBUTTON: [] } ] }; testAccessibleTree("t8_container", tree); - } + }; this.getID = function test8_getID() { return `Set ARIA owns on inaccessible span element that contains accessible children`; - } + }; } function test9_prepare() { this.eventSeq = [ new invokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, () => { return getNode("t9_container").contentDocument; }) ]; @@ -535,92 +535,92 @@ getNode("t9_container").src = `data:text/html, <html><body></body> <script> let el = document.createElement('div'); el.id = 'container'; el.innerHTML = "<input id='input'>"; document.documentElement.appendChild(el); <\/script></html>`; - } + }; this.finalCheck = () => { var tree = { INTERNAL_FRAME: [ { DOCUMENT: [ { SECTION: [ { ENTRY: [] } ] } ] } ] }; testAccessibleTree("t9_container", tree); - } + }; this.getID = () => { return `Set ARIA owns on a document (part1)`; - } + }; } function test9_setARIAOwns() { this.eventSeq = [ new invokerChecker(EVENT_SHOW, () => { let doc = getNode("t9_container").contentDocument; return doc && doc.getElementById("input"); }) ]; this.invoke = () => { let doc = getNode("t9_container").contentDocument; doc.body.setAttribute("aria-owns", "input"); - } + }; this.finalCheck = () => { var tree = { INTERNAL_FRAME: [ { DOCUMENT: [ { SECTION: [] }, { ENTRY: [] } ] } ] }; testAccessibleTree("t9_container", tree); - } + }; this.getID = () => { return `Set ARIA owns on a document (part2)`; - } + }; } function test9_finish() { this.eventSeq = [ new invokerChecker(EVENT_REORDER, () => { return getNode("t9_container").contentDocument; }) ]; this.invoke = () => { // trigger a tree update. let doc = getNode("t9_container").contentDocument; doc.body.appendChild(document.createElement("p")); - } + }; this.finalCheck = () => { var tree = { INTERNAL_FRAME: [ { DOCUMENT: [ { PARAGRAPH: [] }, { SECTION: [] }, { ENTRY: [] } ] } ] }; testAccessibleTree("t9_container", tree); - } + }; this.getID = () => { return `Set ARIA owns on a document (part3)`; - } + }; } /** * Put ARIA owned child back when ARIA owner removed. */ function test10_removeARIAOwner() { this.eventSeq = [ new invokerChecker(EVENT_HIDE, getAccessible("t10_owner")) @@ -631,46 +631,46 @@ { SECTION: [ // t10_container { SECTION: [ // t10_owner { ENTRY: [] } // t10_child ] } ] }; testAccessibleTree("t10_container", tree); getNode("t10_owner").remove(); - } + }; this.getID = () => { return "Put aria owned child back when aria owner removed"; - } + }; } function test10_finishTest() { this.eventSeq = [ new invokerChecker(EVENT_REORDER, "t10_container") ]; this.invoke = () => { // trigger a tree update. getNode("t10_container").append(document.createElement("p")); - } + }; this.finalCheck = () => { let tree = { SECTION: [ // t10_container // { ENTRY: [] }, // t10_child { PARAGRAPH: [] } ] }; testAccessibleTree("t10_container", tree); todo(false, "Input accessible has be moved back in the tree"); - } + }; this.getID = () => { return `Put aria owned child back when aria owner removed (finish test)`; - } + }; } // ////////////////////////////////////////////////////////////////////////// // Test // ////////////////////////////////////////////////////////////////////////// // gA11yEventDumpToConsole = true; // enableLogging("tree,eventTree,verbose"); // debug stuff
--- a/accessible/tests/mochitest/treeupdate/test_bug1100602.html +++ b/accessible/tests/mochitest/treeupdate/test_bug1100602.html @@ -24,52 +24,52 @@ this.liAcc = getAccessible("list_element"); this.bullet = this.liAcc.firstChild; this.eventSeq.push(new invokerChecker(EVENT_HIDE, this.bullet)); this.eventSeq.push(new invokerChecker(EVENT_REORDER, this.liAcc)); this.invoke = function hideBullet_invoke() { getNode("list").setAttribute("style", "list-style-type: none;"); - } + }; this.finalCheck = function hideBullet_finalCheck() { is(this.liAcc.name, "list element", "Check that first child of LI is not a bullet."); - } + }; this.getID = function hideBullet_getID() { return "Hide bullet by setting style to none"; - } + }; } /** * Change list style type to circles. */ function showBullet() { this.eventSeq = []; this.liAcc = getAccessible("list_element"); this.eventSeq.push(new invokerChecker(EVENT_SHOW, function(aNode) { return aNode.firstChild; }, this.liAcc)); this.eventSeq.push(new invokerChecker(EVENT_REORDER, this.liAcc)); this.invoke = function showBullet_invoke() { getNode("list").setAttribute("style", "list-style-type: circle;"); - } + }; this.finalCheck = function showBullet_finalCheck() { is(this.liAcc.name, "â—¦ list element", "Check that first child of LI is a circle bullet."); - } + }; this.getID = function showBullet_getID() { return "Show bullet by setting style to circle"; - } + }; } var gQueue = null; function doTest() { var list = getNode("list"); list.setAttribute("style", "list-style-type: circle;");
--- a/accessible/tests/mochitest/treeupdate/test_bug1175913.html +++ b/accessible/tests/mochitest/treeupdate/test_bug1175913.html @@ -23,47 +23,47 @@ this.eventSeq = [ new invokerChecker(EVENT_SHOW, getNode("parent")), ]; this.invoke = function testAddListener_invoke() { is(getAccessible("parent", null, null, DONOTFAIL_IF_NO_ACC), null, "Check that parent is not accessible."); is(getAccessible("child", null, null, DONOTFAIL_IF_NO_ACC), null, "Check that child is not accessible."); getNode("parent").addEventListener("click", dummyListener); - } + }; this.finalCheck = function testAddListener_finalCheck() { var tree = { TEXT: [] }; testAccessibleTree("parent", tree); - } + }; this.getID = function testAddListener_getID() { return "Test that show event is sent when click listener is added"; - } + }; } function testRemoveListener() { this.eventSeq = [ new unexpectedInvokerChecker(EVENT_HIDE, getNode("parent")), ]; this.invoke = function testRemoveListener_invoke() { getNode("parent").removeEventListener("click", dummyListener); - } + }; this.finalCheck = function testRemoveListener_finalCheck() { ok(getAccessible("parent", null, null, DONOTFAIL_IF_NO_ACC), "Parent stays accessible after click event listener is removed"); ok(!getAccessible("child", null, null, DONOTFAIL_IF_NO_ACC), "Child stays inaccessible"); - } + }; this.getID = function testRemoveListener_getID() { return "Test that hide event is sent when click listener is removed"; - } + }; } var gQueue = null; function doTest() { gQueue = new eventQueue(); gQueue.push(new testAddListener()); gQueue.push(new testRemoveListener()); gQueue.invoke(); // SimpleTest.finish();
--- a/accessible/tests/mochitest/treeupdate/test_bug1189277.html +++ b/accessible/tests/mochitest/treeupdate/test_bug1189277.html @@ -31,21 +31,21 @@ var docContainer = getNode("docContainer"); var iframe = document.createElement("iframe"); iframe.setAttribute("src", "http://example.com"); iframe.setAttribute("id", "newChildDoc"); docContainer.removeChild(getNode("childDoc")); docContainer.appendChild(iframe); - } + }; this.getID = function runTest_getID() { return "check show events are not incorrectly coalesced"; - } + }; } // enableLogging("tree"); gA11yEventDumpToConsole = true; var gQueue = null; function doTest() { gQueue = new eventQueue(); gQueue.push(new runTest());
--- a/accessible/tests/mochitest/treeupdate/test_bug895082.html +++ b/accessible/tests/mochitest/treeupdate/test_bug895082.html @@ -14,17 +14,17 @@ src="../role.js"></script> <script type="application/javascript" src="../events.js"></script> <script type="application/javascript"> function doTest() { var y = document.getElementById("y"); var oldBody = document.body; - var newBody = document.createElement("body") + var newBody = document.createElement("body"); document.documentElement.insertBefore(newBody, oldBody); setTimeout(function() { document.documentElement.removeChild(oldBody); newBody.appendChild(y); ok(true, "we didn't assert"); SimpleTest.finish(); }, 0); }
--- a/accessible/tests/mochitest/treeupdate/test_canvas.html +++ b/accessible/tests/mochitest/treeupdate/test_canvas.html @@ -28,25 +28,25 @@ this.eventSeq = [ new invokerChecker(EVENT_SHOW, this.node) ]; this.invoke = function addSubtree_invoke() { // ensure we start with no subtree testAccessibleTree("canvas", { CANVAS: [] }); getNode("dialog").style.display = "block"; - } + }; this.finalCheck = function addSubtree_finalCheck() { testAccessibleTree("dialog", { DIALOG: [] }); - } + }; this.getID = function addSubtree_getID() { return "show canvas subdom"; - } + }; } // ////////////////////////////////////////////////////////////////////////// // Test // gA11yEventDumpID = "eventdump"; // debug stuff // gA11yEventDumpToConsole = true;
--- a/accessible/tests/mochitest/treeupdate/test_cssoverflow.html +++ b/accessible/tests/mochitest/treeupdate/test_cssoverflow.html @@ -36,32 +36,32 @@ this.eventSeq = [ new invokerChecker(EVENT_REORDER, this.container) ]; this.invoke = function changeScrollRange_invoke() { this.scrollAreaNode.style.width = "20px"; this.containerNode.appendChild(document.createElement("input")); - } + }; this.finalCheck = function changeScrollRange_finalCheck() { var accTree = { SECTION: [ // container { SECTION: [ // scroll area { ENTRY: [] } // child content ] }, { ENTRY: [] } // inserted input ] }; testAccessibleTree(this.container, accTree); - } + }; this.getID = function changeScrollRange_getID() { return "change scroll range for " + prettyName(aScrollAreaID); - } + }; } /** * Change scrollbar styles from hidden to auto. That makes us to create an * accessible for scroll area. */ function changeScrollbarStyles(aContainerID, aScrollAreaID) { this.container = getAccessible(aContainerID); @@ -73,29 +73,29 @@ ]; this.invoke = function changeScrollbarStyles_invoke() { var accTree = { SECTION: [] }; testAccessibleTree(this.container, accTree); this.scrollAreaNode.style.overflow = "auto"; - } + }; this.finalCheck = function changeScrollbarStyles_finalCheck() { var accTree = { SECTION: [ // container { SECTION: [] } // scroll area ] }; testAccessibleTree(this.container, accTree); - } + }; this.getID = function changeScrollbarStyles_getID() { return "change scrollbar styles " + prettyName(aScrollAreaID); - } + }; } // ////////////////////////////////////////////////////////////////////////// // Do tests // ////////////////////////////////////////////////////////////////////////// var gQueue = null; // gA11yEventDumpID = "eventdump"; // debug stuff
--- a/accessible/tests/mochitest/treeupdate/test_doc.html +++ b/accessible/tests/mochitest/treeupdate/test_doc.html @@ -42,38 +42,38 @@ children: [ { role: ROLE_TEXT_LEAF, name: aTextName } ] }; testAccessibleTree(getDocNode(aID), tree); - } + }; } function rootContentRemoved(aID) { this.eventSeq = [ new invokerChecker(EVENT_HIDE, null), new invokerChecker(EVENT_REORDER, getDocNode, aID) ]; this.preinvoke = function rootContentRemoved_preinvoke() { // Set up target for hide event before we invoke. var text = getAccessible(getAccessible(getDocNode(aID)).firstChild); this.eventSeq[0].target = text; - } + }; this.finalCheck = function rootContentRemoved_finalCheck() { var tree = { role: ROLE_DOCUMENT, children: [ ] }; testAccessibleTree(getDocNode(aID), tree); - } + }; } function rootContentInserted(aID, aTextName) { this.eventSeq = [ new invokerChecker(EVENT_SHOW, getDocChildNode, aID), new invokerChecker(EVENT_REORDER, getDocNode, aID) ]; @@ -83,55 +83,55 @@ children: [ { role: ROLE_TEXT_LEAF, name: aTextName } ] }; testAccessibleTree(getDocNode(aID), tree); - } + }; } // ////////////////////////////////////////////////////////////////////////// // Invokers function writeIFrameDoc(aID) { this.__proto__ = new rootContentReplaced(aID, "hello"); this.invoke = function writeIFrameDoc_invoke() { var docNode = getDocNode(aID); // We can't use open/write/close outside of iframe document because of // security error. var script = docNode.createElement("script"); script.textContent = "document.open(); document.write('hello'); document.close();"; docNode.body.appendChild(script); - } + }; this.getID = function writeIFrameDoc_getID() { return "write document"; - } + }; } /** * Replace HTML element. */ function replaceIFrameHTMLElm(aID) { this.eventSeq = [ new invokerChecker(EVENT_SHOW, getDocChildNode, aID), new invokerChecker(EVENT_REORDER, getDocNode, aID) ]; this.invoke = function replaceIFrameHTMLElm_invoke() { var docNode = getDocNode(aID); var newHTMLNode = docNode.createElement("html"); newHTMLNode.innerHTML = `<body><p>New Wave</p></body`; docNode.replaceChild(newHTMLNode, docNode.documentElement); - } + }; this.finalCheck = function replaceIFrameHTMLElm_finalCheck() { var tree = { role: ROLE_DOCUMENT, children: [ { role: ROLE_PARAGRAPH, children: [ @@ -139,152 +139,152 @@ role: ROLE_TEXT_LEAF, name: "New Wave" } ] } ] }; testAccessibleTree(getDocNode(aID), tree); - } + }; this.getID = function replaceIFrameHTMLElm_getID() { return "replace HTML element"; - } + }; } /** * Replace HTML body on new body having ARIA role. */ function replaceIFrameBody(aID) { this.__proto__ = new rootContentReplaced(aID, "New Hello"); this.invoke = function replaceIFrameBody_invoke() { var docNode = getDocNode(aID); var newBodyNode = docNode.createElement("body"); var newTextNode = docNode.createTextNode("New Hello"); newBodyNode.appendChild(newTextNode); docNode.documentElement.replaceChild(newBodyNode, docNode.body); - } + }; this.getID = function replaceIFrameBody_getID() { return "replace body"; - } + }; } /** * Replace HTML body on new body having ARIA role. */ function replaceIFrameBodyOnARIARoleBody(aID) { this.__proto__ = new rootContentReplaced(aID, "New Hello", ROLE_PUSHBUTTON); this.invoke = function replaceIFrameBodyOnARIARoleBody_invoke() { var docNode = getDocNode(aID); var newBodyNode = docNode.createElement("body"); var newTextNode = docNode.createTextNode("New Hello"); newBodyNode.appendChild(newTextNode); newBodyNode.setAttribute("role", "button"); docNode.documentElement.replaceChild(newBodyNode, docNode.body); - } + }; this.getID = function replaceIFrameBodyOnARIARoleBody_getID() { return "replace body on body having ARIA role"; - } + }; } /** * Open/close document pair. */ function openIFrameDoc(aID) { this.__proto__ = new rootContentRemoved(aID); this.invoke = function openIFrameDoc_invoke() { this.preinvoke(); // Open document. var docNode = getDocNode(aID); var script = docNode.createElement("script"); script.textContent = "function closeMe() { document.write('Works?'); document.close(); } window.closeMe = closeMe; document.open();"; docNode.body.appendChild(script); - } + }; this.getID = function openIFrameDoc_getID() { return "open document"; - } + }; } function closeIFrameDoc(aID) { this.__proto__ = new rootContentInserted(aID, "Works?"); this.invoke = function closeIFrameDoc_invoke() { // Write and close document. getDocNode(aID).write("Works?"); getDocNode(aID).close(); - } + }; this.getID = function closeIFrameDoc_getID() { return "close document"; - } + }; } /** * Remove/insert HTML element pair. */ function removeHTMLFromIFrameDoc(aID) { this.__proto__ = new rootContentRemoved(aID); this.invoke = function removeHTMLFromIFrameDoc_invoke() { this.preinvoke(); // Remove HTML element. var docNode = getDocNode(aID); docNode.firstChild.remove(); - } + }; this.getID = function removeHTMLFromIFrameDoc_getID() { return "remove HTML element"; - } + }; } function insertHTMLToIFrameDoc(aID) { this.__proto__ = new rootContentInserted(aID, "Haha"); this.invoke = function insertHTMLToIFrameDoc_invoke() { // Insert HTML element. var docNode = getDocNode(aID); var html = docNode.createElement("html"); var body = docNode.createElement("body"); var text = docNode.createTextNode("Haha"); body.appendChild(text); html.appendChild(body); docNode.appendChild(html); - } + }; this.getID = function insertHTMLToIFrameDoc_getID() { return "insert HTML element document"; - } + }; } /** * Remove/insert HTML body pair. */ function removeBodyFromIFrameDoc(aID) { this.__proto__ = new rootContentRemoved(aID); this.invoke = function removeBodyFromIFrameDoc_invoke() { this.preinvoke(); // Remove body element. var docNode = getDocNode(aID); docNode.documentElement.removeChild(docNode.body); - } + }; this.getID = function removeBodyFromIFrameDoc_getID() { return "remove body element"; - } + }; } function insertElmUnderDocElmWhileBodyMissed(aID) { this.docNode = null; this.inputNode = null; function getInputNode() { return this.inputNode; } @@ -292,75 +292,75 @@ new invokerChecker(EVENT_SHOW, getInputNode.bind(this)), new invokerChecker(EVENT_REORDER, getDocNode, aID) ]; this.invoke = function invoke() { this.docNode = getDocNode(aID); this.inputNode = this.docNode.createElement("input"); this.docNode.documentElement.appendChild(this.inputNode); - } + }; this.finalCheck = function finalCheck() { var tree = { DOCUMENT: [ { ENTRY: [ ] } ] }; testAccessibleTree(this.docNode, tree); // Remove aftermath of this test before next test starts. this.docNode.documentElement.removeChild(this.inputNode); - } + }; this.getID = function getID() { return "Insert element under document element while body is missed."; - } + }; } function insertBodyToIFrameDoc(aID) { this.__proto__ = new rootContentInserted(aID, "Yo ho ho i butylka roma!"); this.invoke = function insertBodyToIFrameDoc_invoke() { // Insert body element. var docNode = getDocNode(aID); var body = docNode.createElement("body"); var text = docNode.createTextNode("Yo ho ho i butylka roma!"); body.appendChild(text); docNode.documentElement.appendChild(body); - } + }; this.getID = function insertBodyToIFrameDoc_getID() { return "insert body element"; - } + }; } function changeSrc(aID) { this.containerNode = getNode(aID); this.eventSeq = [ new invokerChecker(EVENT_REORDER, this.containerNode) ]; this.invoke = function changeSrc_invoke() { this.containerNode.src = "data:text/html,<html><input></html>"; - } + }; this.finalCheck = function changeSrc_finalCheck() { var tree = { INTERNAL_FRAME: [ { DOCUMENT: [ { ENTRY: [ ] } ] } ] }; testAccessibleTree(this.containerNode, tree); - } + }; this.getID = function changeSrc_getID() { return "change src on iframe"; - } + }; } // ////////////////////////////////////////////////////////////////////////// // Test // gA11yEventDumpToConsole = true; // enableLogging('tree,verbose');
--- a/accessible/tests/mochitest/treeupdate/test_gencontent.html +++ b/accessible/tests/mochitest/treeupdate/test_gencontent.html @@ -43,33 +43,33 @@ new invokerChecker(EVENT_REORDER, this.container) ]; this.invoke = function insertNodeHavingGenContent_invoke() { var node = document.createElement("div"); node.textContent = "text"; node.setAttribute("class", "gentext"); this.containerNode.appendChild(node); - } + }; this.finalCheck = function insertNodeHavingGenContent_finalCheck() { var accTree = { SECTION: [ // container { SECTION: [ // inserted node { STATICTEXT: [] }, // :before { TEXT_LEAF: [] }, // primary text { STATICTEXT: [] } // :after ] } ] }; testAccessibleTree(this.container, accTree); - } + }; this.getID = function insertNodeHavingGenContent_getID() { return "insert node having generated content to " + prettyName(aContainerID); - } + }; } /** * Add CSS generated content to the given node contained by container node. */ function addGenContent(aContainerID, aNodeID) { this.container = getAccessible(aContainerID); this.node = getNode(aNodeID); @@ -77,33 +77,33 @@ this.eventSeq = [ new invokerChecker(EVENT_HIDE, this.container.firstChild), new invokerChecker(EVENT_SHOW, getFirstChild, this.container), new invokerChecker(EVENT_REORDER, this.container) ]; this.invoke = function addGenContent_invoke() { this.node.setAttribute("class", "gentext"); - } + }; this.finalCheck = function insertNodeHavingGenContent_finalCheck() { var accTree = { SECTION: [ // container { SECTION: [ // inserted node { STATICTEXT: [] }, // :before { TEXT_LEAF: [] }, // primary text { STATICTEXT: [] } // :after ] } ] }; testAccessibleTree(this.container, accTree); - } + }; this.getID = function addGenContent_getID() { return "add generated content to" + prettyName(aNodeID); - } + }; } /** * Target getters. */ function getFirstChild(aAcc) { try { return aAcc.getChildAt(0); } catch (e) { return null; } }
--- a/accessible/tests/mochitest/treeupdate/test_general.html +++ b/accessible/tests/mochitest/treeupdate/test_general.html @@ -30,79 +30,79 @@ this.invoke = function prependAppend_invoke() { var checkbox = document.createElement("input"); checkbox.setAttribute("type", "checkbox"); getNode(aContainer).insertBefore(checkbox, getNode(aContainer).firstChild); var button = document.createElement("input"); button.setAttribute("type", "button"); getNode(aContainer).appendChild(button); - } + }; this.finalCheck = function prependAppend_finalCheck() { var accTree = { SECTION: [ // container { CHECKBUTTON: [ ] }, { ENTRY: [ ] }, { PUSHBUTTON: [ ] } ] }; testAccessibleTree(aContainer, accTree); - } + }; this.getID = function prependAppend_getID() { return "prepends a child and appends a child"; - } + }; } function removeRemove(aContainer) { this.eventSeq = [ new invokerChecker(EVENT_REORDER, aContainer) ]; this.invoke = function removeRemove_invoke() { getNode(aContainer).firstChild.remove(); - } + }; this.finalCheck = function removeRemove_finalCheck() { var accTree = { SECTION: [ // container { PUSHBUTTON: [ ] } ] }; testAccessibleTree(aContainer, accTree); - } + }; this.getID = function removeRemove_getID() { return "remove first and second children"; - } + }; } function insertInaccessibleAccessibleSiblings() { this.eventSeq = [ new invokerChecker(EVENT_REORDER, "c3") ]; this.invoke = function insertInaccessibleAccessibleSiblings_invoke() { getNode("c3").appendChild(document.createElement("span")); getNode("c3").appendChild(document.createElement("input")); - } + }; this.finalCheck = function insertInaccessibleAccessibleSiblings_finalCheck() { var accTree = { SECTION: [ // container { PUSHBUTTON: [ { TEXT_LEAF: [] } ] }, { ENTRY: [ ] } ] }; testAccessibleTree("c3", accTree); - } + }; this.getID = function insertInaccessibleAccessibleSiblings_getID() { return "insert inaccessible and then accessible siblings"; - } + }; } // ////////////////////////////////////////////////////////////////////////// // Do tests // ////////////////////////////////////////////////////////////////////////// var gQueue = null; // gA11yEventDumpID = "eventdump"; // debug stuff
--- a/accessible/tests/mochitest/treeupdate/test_hidden.html +++ b/accessible/tests/mochitest/treeupdate/test_hidden.html @@ -35,28 +35,28 @@ var tree = { SECTION: [ { ENTRY: [ ] } ] }; testAccessibleTree(aContainerID, tree); getNode(aChildID).setAttribute("hidden", "true"); - } + }; this.finalCheck = function setHiddenAttr_finalCheck() { var tree = { SECTION: [ ] }; testAccessibleTree(aContainerID, tree); - } + }; this.getID = function setHiddenAttr_getID() { return "Set @hidden attribute on input and test accessible tree for div"; - } + }; } /** * Remove @hidden attribute */ function removeHiddenAttr(aContainerID, aChildID) { this.eventSeq = [ new invokerChecker(EVENT_REORDER, getNode(aContainerID)) @@ -64,30 +64,30 @@ this.invoke = function removeHiddenAttr_invoke() { var tree = { SECTION: [ ] }; testAccessibleTree(aContainerID, tree); getNode(aChildID).removeAttribute("hidden"); - } + }; this.finalCheck = function removeHiddenAttr_finalCheck() { var tree = { SECTION: [ { ENTRY: [ ] } ] }; testAccessibleTree(aContainerID, tree); - } + }; this.getID = function removeHiddenAttr_getID() { return "Remove @hidden attribute on input and test accessible tree for div"; - } + }; } // ////////////////////////////////////////////////////////////////////////// // Test // ////////////////////////////////////////////////////////////////////////// // gA11yEventDumpID = "eventdump"; // debug stuff // gA11yEventDumpToConsole = true;
--- a/accessible/tests/mochitest/treeupdate/test_imagemap.html +++ b/accessible/tests/mochitest/treeupdate/test_imagemap.html @@ -35,38 +35,38 @@ var areaElm = document.createElement("area"); areaElm.setAttribute("href", "http://www.bbc.co.uk/radio4/atoz/index.shtml#a"); areaElm.setAttribute("coords", "0,0,13,14"); areaElm.setAttribute("alt", "a"); areaElm.setAttribute("shape", "rect"); this.mapNode.insertBefore(areaElm, this.mapNode.firstChild); - } + }; this.finalCheck = function insertArea_finalCheck() { var accTree = { IMAGE_MAP: [ { role: ROLE_LINK, name: "a", children: [ ] }, { role: ROLE_LINK, name: "b", children: [ ] }, ] }; testAccessibleTree(this.imageMap, accTree); - } + }; this.getID = function insertArea_getID() { return "insert area element"; - } + }; } function appendArea(aImageMapID, aMapID) { this.imageMap = getAccessible(aImageMapID); this.mapNode = getNode(aMapID); function getAppendedArea(aThisObj) { return aThisObj.imageMap.lastChild; @@ -81,17 +81,17 @@ var areaElm = document.createElement("area"); areaElm.setAttribute("href", "http://www.bbc.co.uk/radio4/atoz/index.shtml#c"); areaElm.setAttribute("coords", "34,0,47,14"); areaElm.setAttribute("alt", "c"); areaElm.setAttribute("shape", "rect"); this.mapNode.appendChild(areaElm); - } + }; this.finalCheck = function appendArea_finalCheck() { var accTree = { IMAGE_MAP: [ { role: ROLE_LINK, name: "a", children: [ ] @@ -103,21 +103,21 @@ }, { role: ROLE_LINK, name: "c", children: [ ] } ] }; testAccessibleTree(this.imageMap, accTree); - } + }; this.getID = function appendArea_getID() { return "append area element"; - } + }; } function removeArea(aImageMapID, aMapID) { this.imageMap = getAccessible(aImageMapID); this.area = null; this.mapNode = getNode(aMapID); function getRemovedArea(aThisObj) { @@ -127,38 +127,38 @@ this.eventSeq = [ new invokerChecker(EVENT_HIDE, getRemovedArea, this), new invokerChecker(EVENT_REORDER, this.imageMap) ]; this.invoke = function removeArea_invoke() { this.area = this.imageMap.firstChild; this.mapNode.removeChild(this.mapNode.firstElementChild); - } + }; this.finalCheck = function removeArea_finalCheck() { var accTree = { IMAGE_MAP: [ { role: ROLE_LINK, name: "b", children: [ ] }, { role: ROLE_LINK, name: "c", children: [ ] } ] }; testAccessibleTree(this.imageMap, accTree); - } + }; this.getID = function removeArea_getID() { return "remove area element"; - } + }; } function removeNameOnMap(aImageMapContainerID, aImageMapID, aMapID) { this.container = getAccessible(aImageMapContainerID); this.containerNode = this.container.DOMNode; this.imageMap = getAccessible(aImageMapID); this.imgNode = this.imageMap.DOMNode; this.mapNode = getNode(aMapID); @@ -166,29 +166,29 @@ this.eventSeq = [ new invokerChecker(EVENT_HIDE, this.imageMap), new invokerChecker(EVENT_SHOW, this.imgNode), new invokerChecker(EVENT_REORDER, this.container) ]; this.invoke = function removeNameOnMap_invoke() { this.mapNode.removeAttribute("name"); - } + }; this.finalCheck = function removeNameOnMap_finalCheck() { var accTree = { SECTION: [ { GRAPHIC: [ ] } ] }; testAccessibleTree(this.container, accTree); - } + }; this.getID = function removeNameOnMap_getID() { return "remove @name on map element"; - } + }; } function restoreNameOnMap(aImageMapContainerID, aImageMapID, aMapID) { this.container = getAccessible(aImageMapContainerID); this.containerNode = this.container.DOMNode; this.imageMap = null; this.imgNode = getNode(aImageMapID); this.mapNode = getNode(aMapID); @@ -204,32 +204,32 @@ ]; this.invoke = function restoreNameOnMap_invoke() { this.imageMap = getAccessible(aImageMapID); this.mapNode.setAttribute("name", "atoz_map"); // XXXhack: force repainting of the image (see bug 745788 for details). waveOverImageMap(aImageMapID); - } + }; this.finalCheck = function removeNameOnMap_finalCheck() { var accTree = { SECTION: [ { IMAGE_MAP: [ { LINK: [ ] }, { LINK: [ ] } ] } ] }; testAccessibleTree(this.container, accTree); - } + }; this.getID = function removeNameOnMap_getID() { return "restore @name on map element"; - } + }; } function removeMap(aImageMapContainerID, aImageMapID, aMapID) { this.container = getAccessible(aImageMapContainerID); this.containerNode = this.container.DOMNode; this.imageMap = null; this.imgNode = getNode(aImageMapID); this.mapNode = getNode(aMapID); @@ -242,29 +242,29 @@ new invokerChecker(EVENT_HIDE, getImageMap, this), new invokerChecker(EVENT_SHOW, this.imgNode), new invokerChecker(EVENT_REORDER, this.container) ]; this.invoke = function removeMap_invoke() { this.imageMap = getAccessible(aImageMapID); this.mapNode.remove(); - } + }; this.finalCheck = function removeMap_finalCheck() { var accTree = { SECTION: [ { GRAPHIC: [ ] } ] }; testAccessibleTree(this.container, accTree); - } + }; this.getID = function removeMap_getID() { return "remove map element"; - } + }; } function insertMap(aImageMapContainerID, aImageID) { this.container = getAccessible(aImageMapContainerID); this.containerNode = this.container.DOMNode; this.image = null; this.imgMapNode = getNode(aImageID); @@ -280,41 +280,41 @@ this.invoke = function insertMap_invoke() { this.image = getAccessible(aImageID); var map = document.createElement("map"); map.setAttribute("name", "atoz_map"); map.setAttribute("id", "map"); - var area = document.createElement("area") + var area = document.createElement("area"); area.setAttribute("href", "http://www.bbc.co.uk/radio4/atoz/index.shtml#b"); area.setAttribute("coords", "17,0,30,14"); area.setAttribute("alt", "b"); area.setAttribute("shape", "rect"); map.appendChild(area); this.containerNode.appendChild(map); - } + }; this.finalCheck = function insertMap_finalCheck() { var accTree = { SECTION: [ { IMAGE_MAP: [ { LINK: [ ] } ] } ] }; testAccessibleTree(this.container, accTree); - } + }; this.getID = function insertMap_getID() { return "insert map element"; - } + }; } function hideImageMap(aContainerID, aImageID) { this.container = getAccessible(aContainerID); this.imageMap = null; this.imageMapNode = getNode(aImageID); function getImageMap(aThisObj) { @@ -324,27 +324,27 @@ this.eventSeq = [ new invokerChecker(EVENT_HIDE, getImageMap, this), new invokerChecker(EVENT_REORDER, aContainerID) ]; this.invoke = function hideImageMap_invoke() { this.imageMap = getAccessible(this.imageMapNode); this.imageMapNode.style.display = "none"; - } + }; this.finalCheck = function hideImageMap_finalCheck() { var accTree = { SECTION: [ ] }; testAccessibleTree(this.container, accTree); - } + }; this.getID = function hideImageMap_getID() { return "display:none image"; - } + }; } // gA11yEventDumpToConsole = true; // debug stuff function doPreTest() { waitForImageMap("imgmap", doTest); } var gQueue = null;
--- a/accessible/tests/mochitest/treeupdate/test_list.html +++ b/accessible/tests/mochitest/treeupdate/test_list.html @@ -45,61 +45,61 @@ function hideProcessor() { this.liNode = getNode("li"); this.li = getAccessible(this.liNode); this.bullet = this.li.firstChild; this.process = function hideProcessor_process() { this.liNode.style.display = "none"; - } + }; this.onProcessed = function hideProcessor_onProcessed() { window.setTimeout( function(aLiAcc, aLiNode, aBulletAcc) { testDefunctAccessible(aLiAcc, aLiNode); testDefunctAccessible(aBulletAcc); gSequence.processNext(); }, 0, this.li, this.liNode, this.bullet ); - } + }; } function showProcessor() { this.liNode = getNode("li"); this.process = function showProcessor_process() { this.liNode.style.display = "list-item"; - } + }; this.onProcessed = function showProcessor_onProcessed() { testLiAccessibleTree(); gSequence.processNext(); - } + }; } function textReplaceProcessor() { this.liNode = getNode("li"); this.process = function textReplaceProcessor_process() { this.liNode.textContent = "hey"; - } + }; this.onProcessed = function textReplaceProcessor_onProcessed() { var tree = { LISTITEM: [ { STATICTEXT: [] }, { TEXT_LEAF: [] } ] }; testAccessibleTree(this.liNode, tree); SimpleTest.finish(); - } + }; } // ////////////////////////////////////////////////////////////////////////// // Test // gA11yEventDumpToConsole = true; var gSequence = null;
--- a/accessible/tests/mochitest/treeupdate/test_list_editabledoc.html +++ b/accessible/tests/mochitest/treeupdate/test_list_editabledoc.html @@ -28,17 +28,17 @@ this.eventSeq = [ new invokerChecker(EVENT_SHOW, getAccessible, this.liNode), new invokerChecker(EVENT_REORDER, this.listNode) ]; this.invoke = function addLi_invoke() { this.listNode.appendChild(this.liNode); - } + }; this.finalCheck = function addLi_finalCheck() { var tree = { role: ROLE_LIST, children: [ { role: ROLE_LISTITEM, children: [ @@ -51,21 +51,21 @@ role: ROLE_TEXT_LEAF, children: [] } ] } ] }; testAccessibleTree(aID, tree); - } + }; this.getID = function addLi_getID() { return "add li"; - } + }; } // ////////////////////////////////////////////////////////////////////////// // Test // gA11yEventDumpID = "eventdump"; // debug stuff var gQueue = null;
--- a/accessible/tests/mochitest/treeupdate/test_optgroup.html +++ b/accessible/tests/mochitest/treeupdate/test_optgroup.html @@ -30,17 +30,17 @@ opt.text = "Option: Value " + i; optGroup.appendChild(opt); } this.selectNode.add(optGroup, null); var option = document.createElement("option"); this.selectNode.add(option, null); - } + }; this.eventSeq = [ new invokerChecker(EVENT_REORDER, this.selectList) ]; this.finalCheck = function addOptGroup_finalCheck() { var tree = { COMBOBOX: [ @@ -52,51 +52,51 @@ { COMBOBOX_OPTION: [ { TEXT_LEAF: [] } ] }, ]}, { COMBOBOX_OPTION: [] } ] } ] }; testAccessibleTree(this.select, tree); - } + }; this.getID = function addOptGroup_getID() { return "test optgroup's insertion into a select"; - } + }; } function removeOptGroup(aID) { this.selectNode = getNode(aID); this.select = getAccessible(this.selectNode); this.selectList = this.select.firstChild; this.invoke = function removeOptGroup_invoke() { this.option1Node = this.selectNode.firstChild.firstChild; this.selectNode.firstChild.remove(); - } + }; this.eventSeq = [ new invokerChecker(EVENT_REORDER, this.selectList) ]; this.finalCheck = function removeOptGroup_finalCheck() { var tree = { COMBOBOX: [ { COMBOBOX_LIST: [ { COMBOBOX_OPTION: [] } ] } ] }; testAccessibleTree(this.select, tree); is(isAccessible(this.option1Node), false, "removed option shouldn't be accessible anymore!"); - } + }; this.getID = function removeOptGroup_getID() { return "test optgroup's removal from a select"; - } + }; } // gA11yEventDumpToConsole = true; function doTest() { gQueue = new eventQueue(); gQueue.push(new addOptGroup("select"));
--- a/accessible/tests/mochitest/treeupdate/test_recreation.html +++ b/accessible/tests/mochitest/treeupdate/test_recreation.html @@ -47,33 +47,33 @@ } } function changeAttr(aID, aAttr, aValue) { this.__proto__ = new recreateAccessible(aID); this.invoke = function changeAttr_invoke() { this.node.setAttribute(aAttr, aValue); - } + }; this.getID = function changeAttr_getID() { return "change " + aAttr + "attribute for " + aID; - } + }; } function removeAttr(aID, aAttr) { this.__proto__ = new recreateAccessible(aID, true); this.invoke = function remvoeAttr_invoke() { this.node.removeAttribute(aAttr); - } + }; this.getID = function remvoeAttr_getID() { return "remove " + aAttr + "attribute for " + aID; - } + }; } function changeRole(aID, aHasAccessible) { this.__proto__ = new changeAttr(aID, "role", "button"); } function removeRole(aID) { this.__proto__ = new removeAttr(aID, "role");
--- a/accessible/tests/mochitest/treeupdate/test_select.html +++ b/accessible/tests/mochitest/treeupdate/test_select.html @@ -25,17 +25,17 @@ this.invoke = function addOptions_invoke() { for (i = 0; i < 2; i++) { var opt = document.createElement("option"); opt.value = i; opt.text = "Option: Value " + i; this.selectNode.add(opt, null); } - } + }; this.eventSeq = [ new invokerChecker(EVENT_REORDER, this.selectList) ]; this.finalCheck = function addOptions_finalCheck() { var tree = { COMBOBOX: [ @@ -44,76 +44,76 @@ { TEXT_LEAF: [] } ] }, { COMBOBOX_OPTION: [ { TEXT_LEAF: [] } ] } ] } ] }; testAccessibleTree(this.select, tree); - } + }; this.getID = function addOptions_getID() { return "test elements insertion into a select"; - } + }; } function removeOptions(aID) { this.selectNode = getNode(aID); this.select = getAccessible(this.selectNode); this.selectList = this.select.firstChild; this.invoke = function removeOptions_invoke() { while (this.selectNode.length) this.selectNode.remove(0); - } + }; this.eventSeq = [ new invokerChecker(EVENT_REORDER, this.selectList) ]; this.finalCheck = function removeOptions_finalCheck() { var tree = { COMBOBOX: [ { COMBOBOX_LIST: [] } ] }; testAccessibleTree(this.select, tree); - } + }; this.getID = function removeptions_getID() { return "test elements removal from a select"; - } + }; } /** * Setting @href on option makes the accessible to recreate. */ function setHrefOnOption() { this.eventSeq = [ new invokerChecker(EVENT_HIDE, "s2_o"), new invokerChecker(EVENT_SHOW, "s2_o"), ]; this.invoke = function setHrefOnOption_setHref() { getNode("s2_o").setAttribute("href", "1"); - } + }; this.finalCheck = function() { var tree = { COMBOBOX: [ { COMBOBOX_LIST: [ { COMBOBOX_OPTION: [ ] } ] } ] }; testAccessibleTree("s2", tree); - } + }; this.getID = function removeptions_getID() { return "setting @href on select option"; - } + }; } function doTest() { gQueue = new eventQueue(); gQueue.push(new addOptions("select")); gQueue.push(new removeOptions("select")); gQueue.push(new setHrefOnOption());
--- a/accessible/tests/mochitest/treeupdate/test_table.html +++ b/accessible/tests/mochitest/treeupdate/test_table.html @@ -19,17 +19,17 @@ function appendCaption(aTableID) { this.invoke = function appendCaption_invoke() { // append a caption, it should appear as a first element in the // accessible tree. var caption = document.createElement("caption"); caption.textContent = "table caption"; getNode(aTableID).appendChild(caption); - } + }; this.eventSeq = [ new invokerChecker(EVENT_REORDER, aTableID) ]; this.finalCheck = function appendCaption_finalCheck() { var tree = { TABLE: [ @@ -37,21 +37,21 @@ { TEXT_LEAF: [] } ] }, { ROW: [ { CELL: [ {TEXT_LEAF: [] }]}, { CELL: [ {TEXT_LEAF: [] }]} ] } ] }; testAccessibleTree(aTableID, tree); - } + }; this.getID = function appendCaption_getID() { return "append caption"; - } + }; } function doTest() { gQueue = new eventQueue(); gQueue.push(new appendCaption("table")); gQueue.invoke(); // Will call SimpleTest.finish(); }
--- a/accessible/tests/mochitest/treeupdate/test_textleaf.html +++ b/accessible/tests/mochitest/treeupdate/test_textleaf.html @@ -28,17 +28,17 @@ this.eventSeq = [ new invokerChecker(EVENT_REORDER, this.node.parentNode) ]; this.finalCheck = function textLeafUpdate_finalCheck() { var textLeaf = getAccessible(this.node).firstChild; is(textLeaf.actionCount, (aIsTextLeafLinkable ? 1 : 0), "Wrong action numbers!"); - } + }; } function setOnClickAttr(aID) { var node = getNode(aID); node.setAttribute("onclick", "alert(3);"); var textLeaf = getAccessible(node).firstChild; is(textLeaf.actionCount, 1, "setOnClickAttr: wrong action numbers!"); } @@ -52,21 +52,21 @@ } function setOnClickNRoleAttrs(aID) { this.__proto__ = new textLeafUpdate(aID, true); this.invoke = function setOnClickAttr_invoke() { this.node.setAttribute("role", "link"); this.node.setAttribute("onclick", "alert(3);"); - } + }; this.getID = function setOnClickAttr_getID() { return "make " + prettyName(aID) + " linkable"; - } + }; } function removeTextData(aID, aRole) { this.containerNode = getNode(aID); this.textNode = this.containerNode.firstChild; this.eventSeq = [ new invokerChecker(EVENT_REORDER, this.containerNode) @@ -80,29 +80,29 @@ role: ROLE_TEXT_LEAF, name: "text" } ] }; testAccessibleTree(this.containerNode, tree); this.textNode.data = ""; - } + }; this.finalCheck = function removeTextData_finalCheck() { var tree = { role: aRole, children: [] }; testAccessibleTree(this.containerNode, tree); - } + }; this.getID = function removeTextData_finalCheck() { return "remove text data of text node inside '" + aID + "'."; - } + }; } // ////////////////////////////////////////////////////////////////////////// // Test // gA11yEventDumpID = "eventdump"; // debug stuff // gA11yEventDumpToConsole = true;
--- a/accessible/tests/mochitest/treeupdate/test_visibility.html +++ b/accessible/tests/mochitest/treeupdate/test_visibility.html @@ -39,31 +39,31 @@ { SECTION: [ { TEXT_LEAF: [] } ] } ] } ] }; testAccessibleTree(aContainerID, tree); getNode(aParentID).style.visibility = "hidden"; - } + }; this.finalCheck = function finalCheck() { var tree = { SECTION: [ { SECTION: [ { TEXT_LEAF: [] } ] } ] }; testAccessibleTree(aContainerID, tree); - } + }; this.getID = function getID() { return "hide parent while child stays visible"; - } + }; } /** * Hide grand parent while its children stay visible. */ function test2(aContainerID, aGrandParentID, aChildID, aChild2ID) { this.eventSeq = [ new invokerChecker(EVENT_HIDE, getNode(aGrandParentID)), @@ -84,34 +84,34 @@ { TEXT_LEAF: [] } ] } ] } ] } ] }; testAccessibleTree(aContainerID, tree); getNode(aGrandParentID).style.visibility = "hidden"; - } + }; this.finalCheck = function finalCheck() { var tree = { SECTION: [ // container { SECTION: [ // child { TEXT_LEAF: [] } ] }, { SECTION: [ // child2 { TEXT_LEAF: [] } ] } ] }; testAccessibleTree(aContainerID, tree); - } + }; this.getID = function getID() { return "hide grand parent while its children stay visible"; - } + }; } /** * Change container style, hide parents while their children stay visible. */ function test3(aContainerID, aParentID, aParent2ID, aChildID, aChild2ID) { this.eventSeq = [ new invokerChecker(EVENT_HIDE, getNode(aParentID)), @@ -135,34 +135,34 @@ ] }, ] } ] }; testAccessibleTree(aContainerID, tree); getNode(aContainerID).style.color = "red"; getNode(aParentID).style.visibility = "hidden"; getNode(aParent2ID).style.visibility = "hidden"; - } + }; this.finalCheck = function finalCheck() { var tree = { SECTION: [ // container { SECTION: [ // child { TEXT_LEAF: [] } ] }, { SECTION: [ // child2 { TEXT_LEAF: [] } ] } ] }; testAccessibleTree(aContainerID, tree); - } + }; this.getID = function getID() { return "change container style, hide parents while their children stay visible"; - } + }; } /** * Change container style and make visible child inside the table. */ function test4(aContainerID, aChildID) { this.eventSeq = [ new invokerChecker(EVENT_SHOW, getNode(aChildID)), @@ -177,37 +177,37 @@ { CELL: [ ] } ] } ] } ] }; testAccessibleTree(aContainerID, tree); getNode(aContainerID).style.color = "red"; getNode(aChildID).style.visibility = "visible"; - } + }; this.finalCheck = function finalCheck() { var tree = { SECTION: [ { TABLE: [ { ROW: [ { CELL: [ { SECTION: [ { TEXT_LEAF: [] } ] } ] } ] } ] } ] }; testAccessibleTree(aContainerID, tree); - } + }; this.getID = function getID() { return "change container style, make visible child insdie the table"; - } + }; } /** * Hide subcontainer while child inside the table stays visible. */ function test5(aContainerID, aSubContainerID, aChildID) { this.eventSeq = [ new invokerChecker(EVENT_HIDE, getNode(aSubContainerID)), @@ -228,31 +228,31 @@ ] } ] } ] } ] } ] }; testAccessibleTree(aContainerID, tree); getNode(aSubContainerID).style.visibility = "hidden"; - } + }; this.finalCheck = function finalCheck() { var tree = { SECTION: [ // container { SECTION: [ // child { TEXT_LEAF: [] } ] } ] }; testAccessibleTree(aContainerID, tree); - } + }; this.getID = function getID() { return "hide subcontainer while child inside the table stays visible"; - } + }; } /** * Hide subcontainer while its child and child inside the nested table stays visible. */ function test6(aContainerID, aSubContainerID, aChildID, aChild2ID) { this.eventSeq = [ new invokerChecker(EVENT_HIDE, getNode(aSubContainerID)), @@ -275,32 +275,32 @@ { TEXT_LEAF: [] } ]} ]} ]} ]} ]} ]} ]}, { SECTION: [ // child2 { TEXT_LEAF: [] } ]} ]} ]}; testAccessibleTree(aContainerID, tree); // invoke getNode(aSubContainerID).style.visibility = "hidden"; - } + }; this.finalCheck = function finalCheck() { var tree = { SECTION: [ // container { SECTION: [ // child { TEXT_LEAF: [] } ]}, { SECTION: [ // child2 { TEXT_LEAF: [] } ]} ]}; testAccessibleTree(aContainerID, tree); - } + }; this.getID = function getID() { return "hide subcontainer while its child and child inside the nested table stays visible"; - } + }; } // ////////////////////////////////////////////////////////////////////////// // Test // gA11yEventDumpID = "eventdump"; // debug stuff // gA11yEventDumpToConsole = true;
--- a/accessible/tests/mochitest/treeupdate/test_whitespace.html +++ b/accessible/tests/mochitest/treeupdate/test_whitespace.html @@ -48,36 +48,36 @@ var tree = { SECTION: [ { GRAPHIC: [] }, { TEXT_LEAF: [] }, { GRAPHIC: [] } ] }; testAccessibleTree(this.containerNode, tree); - } + }; this.invoke = function setOnClickAttr_invoke() { var tree = { SECTION: [ { GRAPHIC: [] }, { TEXT_LEAF: [] }, { GRAPHIC: [] }, { TEXT_LEAF: [] }, { GRAPHIC: [] } ] }; testAccessibleTree(this.containerNode, tree); this.containerNode.removeChild(this.imgNode); - } + }; this.getID = function setOnClickAttr_getID() { return "remove middle img"; - } + }; } /** * Append image making the whitespace visible and thus accessible. * Note: images and whitespaces are on different leves of accessible trees, * so that image container accessible update doesn't update the tree * of whitespace container. * @@ -109,36 +109,36 @@ { LINK: [ { GRAPHIC: [] } ] } ] }; testAccessibleTree(this.topNode, tree); this.containerNode.appendChild(this.imgNode); - } + }; this.finalCheck = function insertImg_finalCheck() { var tree = { SECTION: [ { LINK: [ { GRAPHIC: [ ] } ] }, { TEXT_LEAF: [ ] }, { LINK: [ { GRAPHIC: [ ] } ] } ] }; testAccessibleTree(this.topNode, tree); - } + }; this.getID = function appendImg_getID() { return "insert img into internal container"; - } + }; } // ////////////////////////////////////////////////////////////////////////// // Test // gA11yEventDumpID = "eventdump"; // debug stuff // gA11yEventDumpToConsole = true;
--- a/accessible/tests/mochitest/treeview.js +++ b/accessible/tests/mochitest/treeview.js @@ -10,29 +10,29 @@ function loadXULTreeAndDoTest(aDoTestFun this.treeNode = getNode(aTreeID); this.eventSeq = [ new invokerChecker(EVENT_REORDER, this.treeNode) ]; this.invoke = function loadXULTree_invoke() { this.treeNode.view = aTreeView; - } + }; this.getID = function loadXULTree_getID() { return "Load XUL tree " + prettyName(aTreeID); - } + }; } gXULTreeLoadContext.queue = new eventQueue(); gXULTreeLoadContext.queue.push(new loadXULTree(treeID, treeView)); gXULTreeLoadContext.queue.onFinish = function() { SimpleTest.executeSoon(doTestFunc); return DO_NOT_FINISH_TEST; - } + }; gXULTreeLoadContext.queue.invoke(); } /** * Analogy of addA11yLoadEvent, nice helper to load XUL tree and start the test. */ function addA11yXULTreeLoadEvent(aDoTestFunc, aTreeID, aTreeView) { gXULTreeLoadContext.doTestFunc = aDoTestFunc;
--- a/browser/base/content/aboutNetError.xhtml +++ b/browser/base/content/aboutNetError.xhtml @@ -429,21 +429,21 @@ // Remove sd's existing children sd.textContent = ""; // Everything up to the first link should be text content. sd.appendChild(document.createTextNode(desc.slice(0, firstResult.index))); // Now create the actual links. if (domainResult) { - createLink(sd, "cert_domain_link", domainResult[1]) + createLink(sd, "cert_domain_link", domainResult[1]); // Append text for anything between the two links. sd.appendChild(document.createTextNode(desc.slice(desc.indexOf("</a>") + "</a>".length, codeResult.index))); } - createLink(sd, "errorCode", codeResult[1]) + createLink(sd, "errorCode", codeResult[1]); // Finally, append text for anything after the last closing </a>. sd.appendChild(document.createTextNode(desc.slice(desc.lastIndexOf("</a>") + "</a>".length))); } if (gIsCertError) { // Initialize the error code link embedded in the error message to // display debug information about the cert error.
--- a/browser/base/content/aboutaccounts/aboutaccounts.js +++ b/browser/base/content/aboutaccounts/aboutaccounts.js @@ -251,17 +251,17 @@ function migrateToDevEdition(urlParams) show("remote"); wrapper.init(url, urlParams); }); }).catch(error => { log("Failed to migrate FX Account: " + error); show("stage", "intro"); // load the remote frame in the background fxAccounts.promiseAccountsSignUpURI().then(uri => { - wrapper.init(uri, urlParams) + wrapper.init(uri, urlParams); }).catch(e => { console.log("Failed to load signup page", e); setErrorPage("configError"); }); }).then(() => { // Reset the pref after migration. Services.prefs.setBoolPref("identity.fxaccounts.migrateToDevEdition", false); return true;
--- a/browser/base/content/abouthealthreport/abouthealth.js +++ b/browser/base/content/abouthealthreport/abouthealth.js @@ -92,17 +92,17 @@ var healthReportWrapper = { // file URIs can't be used for targetOrigin, so we use "*" for this special case // in all other cases, pass in the URL to the report so we properly restrict the message dispatch let reportUrl = report.scheme == "file" ? "*" : report.spec; let data = { type, content - } + }; let iframe = document.getElementById("remote-report"); iframe.contentWindow.postMessage(data, reportUrl); }, handleRemoteCommand(evt) { // Do an origin check to harden against the frame content being loaded from unexpected locations. let allowedPrincipal = Services.scriptSecurityManager.createCodebasePrincipal(this._getReportURI(), {}); @@ -151,22 +151,22 @@ var healthReportWrapper = { // error handling ERROR_INIT_FAILED: 1, ERROR_PAYLOAD_FAILED: 2, ERROR_PREFS_FAILED: 3, reportFailure(error) { let details = { errorType: error, - } + }; healthReportWrapper.injectData("error", details); }, handleInitFailure() { healthReportWrapper.reportFailure(healthReportWrapper.ERROR_INIT_FAILED); }, handlePayloadFailure() { healthReportWrapper.reportFailure(healthReportWrapper.ERROR_PAYLOAD_FAILED); }, -} +}; window.addEventListener("load", function() { healthReportWrapper.init(); });
--- a/browser/base/content/abouthome/aboutHome.js +++ b/browser/base/content/abouthome/aboutHome.js @@ -120,61 +120,61 @@ function ensureSnippetsMapThen(aCallback if (!gSnippetsMap) { gSnippetsMap = Object.freeze(new Map()); } for (let callback of gSnippetsMapCallbacks) { callback(gSnippetsMap); } gSnippetsMapCallbacks.length = 0; - } + }; let openRequest = indexedDB.open(DATABASE_NAME, {version: DATABASE_VERSION, storage: DATABASE_STORAGE}); openRequest.onerror = function(event) { // Try to delete the old database so that we can start this process over // next time. indexedDB.deleteDatabase(DATABASE_NAME); invokeCallbacks(); }; openRequest.onupgradeneeded = function(event) { let db = event.target.result; if (!db.objectStoreNames.contains(SNIPPETS_OBJECTSTORE_NAME)) { db.createObjectStore(SNIPPETS_OBJECTSTORE_NAME); } - } + }; openRequest.onsuccess = function(event) { let db = event.target.result; db.onerror = function() { invokeCallbacks(); - } + }; db.onversionchange = function(versionChangeEvent) { versionChangeEvent.target.close(); invokeCallbacks(); - } + }; let cache = new Map(); let cursorRequest; try { cursorRequest = db.transaction(SNIPPETS_OBJECTSTORE_NAME) .objectStore(SNIPPETS_OBJECTSTORE_NAME).openCursor(); } catch (ex) { console.error(ex); invokeCallbacks(); return; } cursorRequest.onerror = function() { invokeCallbacks(); - } + }; cursorRequest.onsuccess = function(cursorRequestEvent) { let cursor = cursorRequestEvent.target.result; // Populate the cache from the persistent storage. if (cursor) { cache.set(cursor.key, cursor.value); cursor.continue(); @@ -199,18 +199,18 @@ function ensureSnippetsMapThen(aCallback db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite") .objectStore(SNIPPETS_OBJECTSTORE_NAME).clear(); return cache.clear(); }, get size() { return cache.size; }, }); setTimeout(invokeCallbacks, 0); - } - } + }; + }; } function onSearchSubmit(aEvent) { gContentSearchController.search(aEvent); } var gContentSearchController;
--- a/browser/base/content/browser-addons.js +++ b/browser/base/content/browser-addons.js @@ -73,17 +73,17 @@ var gXPInstallObserver = { let showNextConfirmation = () => { // Make sure the browser is still alive. if (gBrowser.browsers.indexOf(browser) == -1) return; let pending = this.pendingInstalls.get(browser); if (pending && pending.length) this.showInstallConfirmation(browser, pending.shift()); - } + }; // If all installs have already been cancelled in some way then just show // the next confirmation if (installInfo.installs.every(i => i.state != AddonManager.STATE_DOWNLOADED)) { showNextConfirmation(); return; } @@ -304,17 +304,17 @@ var gXPInstallObserver = { let popup = PopupNotifications.show(browser, notificationID, messageString, anchorID, action, [secondaryAction], options); removeNotificationOnEnd(popup, installInfo.installs); break; } case "addon-install-started": { let needsDownload = function needsDownload(aInstall) { return aInstall.state != AddonManager.STATE_DOWNLOADED; - } + }; // If all installs have already been downloaded then there is no need to // show the download progress if (!installInfo.installs.some(needsDownload)) return; notificationID = "addon-progress"; messageString = gNavigatorBundle.getString("addonDownloadingAndVerifying"); messageString = PluralForm.get(installInfo.installs.length, messageString); messageString = messageString.replace("#1", installInfo.installs.length);
--- a/browser/base/content/browser-captivePortal.js +++ b/browser/base/content/browser-captivePortal.js @@ -259,13 +259,13 @@ var CaptivePortalWatcher = { let tabCloser = () => { Services.obs.removeObserver(tabCloser, "captive-portal-login-abort"); Services.obs.removeObserver(tabCloser, "captive-portal-login-success"); if (!tab || tab.closing || !tab.parentNode || !tab.linkedBrowser || !tab.linkedBrowser.currentURI.equalsExceptRef(canonicalURI)) { return; } gBrowser.removeTab(tab); - } + }; Services.obs.addObserver(tabCloser, "captive-portal-login-abort"); Services.obs.addObserver(tabCloser, "captive-portal-login-success"); }, };
--- a/browser/base/content/browser-customization.js +++ b/browser/base/content/browser-customization.js @@ -73,9 +73,9 @@ var CustomizationHandler = { let menubar = document.getElementById("main-menubar"); for (let childNode of menubar.childNodes) childNode.setAttribute("disabled", false); let cmd = document.getElementById("cmd_CustomizeToolbars"); cmd.removeAttribute("disabled"); gBrowser.selectedBrowser.focus(); } -} +};
--- a/browser/base/content/browser-feeds.js +++ b/browser/base/content/browser-feeds.js @@ -433,17 +433,17 @@ var FeedHandler = { Services.ppmm.removeMessageListener("FeedConverter:ExecuteClientApp", this); this._prefChangeCallback = null; }, // nsIObserver observe(subject, topic, data) { if (topic == "nsPref:changed") { - LOG(`Pref changed ${data}`) + LOG(`Pref changed ${data}`); if (this._prefChangeCallback) { this._prefChangeCallback.disarm(); } // Multiple prefs are set at the same time, debounce to reduce noise // This can happen in one feed and we want to message all feed pages this._prefChangeCallback = new DeferredTask(() => { this._prefChanged(data); }, PREF_UPDATE_DELAY);
--- a/browser/base/content/browser-gestureSupport.js +++ b/browser/base/content/browser-gestureSupport.js @@ -242,17 +242,17 @@ var gGestureSupport = { gHistorySwipeAnimation.updateAnimation(aEvent.delta); }; this._doEnd = function GS__doEnd(aEvent) { gHistorySwipeAnimation.swipeEndEventReceived(); this._doUpdate = function() {}; this._doEnd = function() {}; - } + }; }, /** * Generator producing the powerset of the input array where the first result * is the complete set and the last result (before StopIteration) is empty. * * @param aArray * Source array containing any number of elements @@ -659,17 +659,17 @@ var gHistorySwipeAnimation = { this._canGoForward = this.canGoForward(); if (this.active) { this._addBoxes(); this._takeSnapshot(); this._installPrevAndNextSnapshots(); this._lastSwipeDir = ""; } this.updateAnimation(0); - } + }; SessionStore.getSessionHistory(gBrowser.selectedTab, updateSessionHistory); } }, /** * Stops the swipe animation. */ stopAnimation: function HSA_stopAnimation() { @@ -831,17 +831,17 @@ var gHistorySwipeAnimation = { */ swipeEndEventReceived: function HSA_swipeEndEventReceived() { // Update the session history before continuing. let updateSessionHistory = sessionHistory => { if (this._lastSwipeDir != "" && this._historyIndex != this._startingIndex) this._navigateToHistoryIndex(); else this.stopAnimation(); - } + }; SessionStore.getSessionHistory(gBrowser.selectedTab, updateSessionHistory); }, /** * Checks whether a particular index exists in the browser history or not. * * @param aIndex * The index to check for availability for in the history.
--- a/browser/base/content/browser-media.js +++ b/browser/base/content/browser-media.js @@ -65,17 +65,17 @@ var gEMEHandler = { this.showPopupNotificationForSuccess(browser, keySystem); } // ... and bail! return; case "api-disabled": case "cdm-disabled": notificationId = "drmContentDisabled"; - buttonCallback = gEMEHandler.ensureEMEEnabled.bind(gEMEHandler, browser, keySystem) + buttonCallback = gEMEHandler.ensureEMEEnabled.bind(gEMEHandler, browser, keySystem); params = [this.getLearnMoreLink(notificationId)]; break; case "cdm-insufficient-version": notificationId = "drmContentCDMInsufficientVersion"; params = [this._brandShortName]; break; @@ -266,17 +266,17 @@ let gDecoderDoctorHandler = { // uses to later find when an issue is resolved. // - 'decodeIssue' is a description of the decode error/warning. // - 'resourceURL' is the resource with the issue. let {type, isSolved, decoderDoctorReportId, formats, decodeIssue, docURL, resourceURL} = parsedData; type = type.toLowerCase(); // Error out early on invalid ReportId if (!(/^\w+$/mi).test(decoderDoctorReportId)) { - return + return; } let title = gDecoderDoctorHandler.getLabelForNotificationBox(type); if (!title) { return; } // We keep the list of formats in prefs for the sake of the decoder itself, // which reads it to determine when issues get solved for these formats. @@ -370,16 +370,16 @@ let gDecoderDoctorHandler = { } else if (formatsInPref) { // Issue is solved, and prefs haven't been cleared yet, meaning it's the // first time we get this resolution -> Clear prefs and report telemetry. Services.prefs.clearUserPref(formatsPref); Services.prefs.clearUserPref(buttonClickedPref); histogram.add(decoderDoctorReportId, TELEMETRY_DDSTAT_SOLVED); } }, -} +}; window.getGroupMessageManager("browsers").addMessageListener("DecoderDoctor:Notification", gDecoderDoctorHandler); window.getGroupMessageManager("browsers").addMessageListener("EMEVideo:ContentMediaKeysRequest", gEMEHandler); window.addEventListener("unload", function() { window.getGroupMessageManager("browsers").removeMessageListener("EMEVideo:ContentMediaKeysRequest", gEMEHandler); window.getGroupMessageManager("browsers").removeMessageListener("DecoderDoctor:Notification", gDecoderDoctorHandler); });
--- a/browser/base/content/browser-places.js +++ b/browser/base/content/browser-places.js @@ -561,17 +561,17 @@ var PlacesCommandHook = { _getPageDetails(browser) { return new Promise(resolve => { let mm = browser.messageManager; mm.addMessageListener("Bookmarks:GetPageDetails:Result", function listener(msg) { mm.removeMessageListener("Bookmarks:GetPageDetails:Result", listener); resolve(msg.data); }); - mm.sendAsyncMessage("Bookmarks:GetPageDetails", { }) + mm.sendAsyncMessage("Bookmarks:GetPageDetails", { }); }); }, /** * Adds a bookmark to the page loaded in the current tab. */ bookmarkCurrentPage: function PCH_bookmarkCurrentPage(aShowEditUI, aParent) { this.bookmarkPage(gBrowser.selectedBrowser, aParent, aShowEditUI) @@ -1304,21 +1304,21 @@ var LibraryUI = { animatableBox.removeAttribute("brighttext"); } animatableBox.removeAttribute("fade"); libraryButton.setAttribute("animate", animation); animatableBox.setAttribute("animate", animation); if (!this._libraryButtonAnimationEndListeners[animation]) { this._libraryButtonAnimationEndListeners[animation] = event => { this._libraryButtonAnimationEndListener(event, animation); - } + }; } animatableBox.addEventListener("animationend", this._libraryButtonAnimationEndListeners[animation]); - window.addEventListener("resize", this._onWindowResize) + window.addEventListener("resize", this._onWindowResize); }, _libraryButtonAnimationEndListeners: {}, _libraryButtonAnimationEndListener(aEvent, animation) { let animatableBox = document.getElementById("library-animatable-box"); if (aEvent.animationName.startsWith(`library-${animation}-animation`)) { animatableBox.setAttribute("fade", "true"); } else if (aEvent.animationName == `library-${animation}-fade`) {
--- a/browser/base/content/browser-safebrowsing.js +++ b/browser/base/content/browser-safebrowsing.js @@ -60,9 +60,9 @@ var gSafeBrowsing = { if (pageUri instanceof Ci.nsIURL) { pageUri.query = ""; } reportInfo = { uri: pageUri.asciiSpec }; } return SafeBrowsing.getReportURL(name, reportInfo); } -} +};
--- a/browser/base/content/browser-sync.js +++ b/browser/base/content/browser-sync.js @@ -335,17 +335,17 @@ var gSync = { _appendSendTabDeviceList(fragment, createDeviceNodeFn, url, title) { const onTargetDeviceCommand = (event) => { let clients = event.target.getAttribute("clientId") ? [event.target.getAttribute("clientId")] : this.remoteClients.map(client => client.id); clients.forEach(clientId => this.sendTabToDevice(url, clientId, title)); - } + }; function addTargetDevice(clientId, name, clientType, lastModified) { const targetDevice = createDeviceNodeFn(clientId, name, clientType, lastModified); targetDevice.addEventListener("command", onTargetDeviceCommand, true); targetDevice.classList.add("sync-menuitem", "sendtab-target"); targetDevice.setAttribute("clientId", clientId); targetDevice.setAttribute("clientType", clientType); targetDevice.setAttribute("label", name);
--- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -461,17 +461,17 @@ const gSessionHistoryObserver = { backCommand.setAttribute("disabled", "true"); var fwdCommand = document.getElementById("Browser:Forward"); fwdCommand.setAttribute("disabled", "true"); // Hide session restore button on about:home window.messageManager.broadcastAsyncMessage("Browser:HideSessionRestoreButton"); // Clear undo history of the URL bar - gURLBar.editor.transactionManager.clear() + gURLBar.editor.transactionManager.clear(); } }; const gStoragePressureObserver = { _lastNotificationTime: -1, observe(subject, topic, data) { if (topic != "QuotaManager::StoragePressure" || @@ -499,17 +499,17 @@ const gStoragePressureObserver = { } this._lastNotificationTime = Date.now(); const BYTES_IN_GIGABYTE = 1073741824; const USAGE_THRESHOLD_BYTES = BYTES_IN_GIGABYTE * Services.prefs.getIntPref("browser.storageManager.pressureNotification.usageThresholdGB"); let msg = ""; let buttons = []; - let usage = subject.QueryInterface(Ci.nsISupportsPRUint64).data + let usage = subject.QueryInterface(Ci.nsISupportsPRUint64).data; let prefStrBundle = document.getElementById("bundle_preferences"); let brandShortName = document.getElementById("bundle_brand").getString("brandShortName"); buttons.push({ label: prefStrBundle.getString("spaceAlert.learnMoreButton.label"), accessKey: prefStrBundle.getString("spaceAlert.learnMoreButton.accesskey"), callback(notificationBar, button) { let learnMoreURL = Services.urlFormatter.formatURLPref("app.support.baseURL") + "storage-permissions"; gBrowser.selectedTab = gBrowser.addTab(learnMoreURL); @@ -942,17 +942,17 @@ function gKeywordURIFixup({ target: brow // show infobar offering to visit the host let notificationBox = gBrowser.getNotificationBox(browserRef); if (notificationBox.getNotificationWithValue("keyword-uri-fixup")) return; let message = gNavigatorBundle.getFormattedString( "keywordURIFixup.message", [hostName]); let yesMessage = gNavigatorBundle.getFormattedString( - "keywordURIFixup.goTo", [hostName]) + "keywordURIFixup.goTo", [hostName]); let buttons = [ { label: yesMessage, accessKey: gNavigatorBundle.getString("keywordURIFixup.goTo.accesskey"), callback() { // Do not set this preference while in private browsing. if (!PrivateBrowsingUtils.isWindowPrivate(window)) { @@ -1121,17 +1121,17 @@ function _loadURIWithFlags(browser, uri, ? gSerializationHelper.serializeToString(triggeringPrincipal) : null, flags, referrer: referrer ? referrer.spec : null, referrerPolicy, remoteType: requiredRemoteType, postData, newFrameloader, - } + }; if (params.userContextId) { loadParams.userContextId = params.userContextId; } LoadInOtherProcess(browser, loadParams); } } catch (e) { @@ -2281,17 +2281,17 @@ function focusAndSelectUrlBar(userInitia function openLocation() { if (focusAndSelectUrlBar(true)) return; if (window.location.href != getBrowserURL()) { var win = getTopWin(); if (win) { // If there's an open browser window, it should handle this command - win.focus() + win.focus(); win.openLocation(); } else { // If there are no open browser windows, open a new one window.openDialog("chrome://browser/content/", "_blank", "chrome,all,dialog=no", BROWSER_NEW_TAB_URL); } } } @@ -2660,17 +2660,17 @@ function BrowserViewSourceOfDocument(aAr sameProcessAsFrameLoader: args.browser ? args.browser.frameLoader : null, triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(), }); args.viewSourceBrowser = tabBrowser.getBrowserForTab(tab); top.gViewSourceUtils.viewSourceInBrowser(args); } else { top.gViewSourceUtils.viewSource(args); } - } + }; // Check if external view source is enabled. If so, try it. If it fails, // fallback to internal view source. if (Services.prefs.getBoolPref("view_source.editor.external")) { top.gViewSourceUtils .openInExternalEditor(args, null, null, null, result => { if (!result) { viewInternal(); @@ -3049,17 +3049,17 @@ var BrowserOnClick = { if (!Services.prefs.getBoolPref("security.ssl.errorReporting.enabled")) { Cu.reportError("User requested certificate error report sending, but certificate error reporting is disabled"); return; } let serhelper = Cc["@mozilla.org/network/serialization-helper;1"] .getService(Ci.nsISerializationHelper); let transportSecurityInfo = serhelper.deserializeObject(securityInfo); - transportSecurityInfo.QueryInterface(Ci.nsITransportSecurityInfo) + transportSecurityInfo.QueryInterface(Ci.nsITransportSecurityInfo); let errorReporter = Cc["@mozilla.org/securityreporter;1"] .getService(Ci.nsISecurityReporter); errorReporter.reportTLSError(transportSecurityInfo, uri.host, uri.port); }, onCertError(browser, elementId, isTopFrame, location, securityInfoAsString) { @@ -3558,17 +3558,17 @@ var PrintPreviewListener = { if (this._chromeState.sidebarOpen) SidebarUI.show(this._sidebarCommand); }, activateBrowser(browser) { gBrowser.activateBrowserForPrintPreview(browser); }, -} +}; function getMarkupDocumentViewer() { return gBrowser.markupDocumentViewer; } // This function is obsolete. Newer code should use <tooltip page="true"/> instead. function FillInHTMLTooltip(tipElement) { document.getElementById("aHTMLTooltip").fillInPageTooltip(tipElement); @@ -3605,17 +3605,17 @@ var homeButtonObserver = { if (gPrefService.prefIsLocked("browser.startup.homepage")) { return; } browserDragAndDrop.dragOver(aEvent); aEvent.dropEffect = "link"; }, onDragExit(aEvent) { } -} +}; function openHomeDialog(aURL) { var promptTitle = gNavigatorBundle.getString("droponhometitle"); var promptMsg; if (aURL.includes("|")) { promptMsg = gNavigatorBundle.getString("droponhomemsgMultiple"); } else { promptMsg = gNavigatorBundle.getString("droponhomemsg"); @@ -3644,34 +3644,34 @@ var newTabButtonObserver = { for (let link of links) { if (link.url) { let data = await getShortcutOrURIAndPostData(link.url); // Allow third-party services to fixup this URL. openNewTabWith(data.url, null, data.postData, aEvent, true); } } } -} +}; var newWindowButtonObserver = { onDragOver(aEvent) { browserDragAndDrop.dragOver(aEvent); }, onDragExit(aEvent) {}, async onDrop(aEvent) { let links = browserDragAndDrop.dropLinks(aEvent); for (let link of links) { if (link.url) { let data = await getShortcutOrURIAndPostData(link.url); // Allow third-party services to fixup this URL. openNewWindowWith(data.url, null, data.postData, true); } } } -} +}; const DOMEventHandler = { init() { let mm = window.messageManager; mm.addMessageListener("Link:AddFeed", this); mm.addMessageListener("Link:SetIcon", this); mm.addMessageListener("Link:AddSearch", this); mm.addMessageListener("Meta:SetPageInfo", this); }, @@ -3725,17 +3725,17 @@ const DOMEventHandler = { addSearch(aBrowser, aEngine, aURL) { let tab = gBrowser.getTabForBrowser(aBrowser); if (!tab) return; BrowserSearch.addEngine(aBrowser, aEngine, makeURI(aURL)); }, -} +}; const BrowserSearch = { addEngine(browser, engine, uri) { // Check to see whether we've already added an engine with this title if (browser.engines) { if (browser.engines.some(e => e.title == engine.title)) return; } @@ -3795,17 +3795,17 @@ const BrowserSearch = { win.BrowserSearch.webSearch(); } else { // If there are no open browser windows, open a new one var observer = function(subject, topic, data) { if (subject == win) { BrowserSearch.webSearch(); Services.obs.removeObserver(observer, "browser-delayed-startup-finished"); } - } + }; win = window.openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", "about:blank"); Services.obs.addObserver(observer, "browser-delayed-startup-finished"); } return; } let focusUrlBarIfSearchFieldIsNotActive = function(aSearchBar) { @@ -4686,37 +4686,37 @@ var XULBrowserWindow = { BrowserPageActions.onLocationChange(); gTabletModePageCounter.inc(); // Utility functions for disabling find var shouldDisableFind = function(aDocument) { let docElt = aDocument.documentElement; return docElt && docElt.getAttribute("disablefastfind") == "true"; - } + }; var disableFindCommands = function(aDisable) { let findCommands = [document.getElementById("cmd_find"), document.getElementById("cmd_findAgain"), document.getElementById("cmd_findPrevious")]; for (let elt of findCommands) { if (aDisable) elt.setAttribute("disabled", "true"); else elt.removeAttribute("disabled"); } - } + }; var onContentRSChange = function(e) { if (e.target.readyState != "interactive" && e.target.readyState != "complete") return; e.target.removeEventListener("readystatechange", onContentRSChange); disableFindCommands(shouldDisableFind(e.target)); - } + }; // Disable find commands in documents that ask for them to be disabled. if (!gMultiProcessBrowser && aLocationURI && (aLocationURI.schemeIs("about") || aLocationURI.schemeIs("chrome"))) { // Don't need to re-enable/disable find commands for same-document location changes // (e.g. the replaceStates in about:addons) if (!(aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT)) { if (window.content.document.readyState == "interactive" || window.content.document.readyState == "complete") @@ -5202,17 +5202,17 @@ var TabsProgressListener = { gBrowser.setBrowserSharing(aBrowser, {}); } webrtcUI.forgetStreamsFromBrowser(aBrowser); gBrowser.getNotificationBox(aBrowser).removeTransientNotifications(); FullZoom.onLocationChange(aLocationURI, false, aBrowser); }, -} +}; function nsBrowserAccess() { } nsBrowserAccess.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIBrowserDOMWindow, Ci.nsISupports]), _openURIInNewTab(aURI, aReferrer, aReferrerPolicy, aIsPrivate, aIsExternal, aForceNotRemote = false, @@ -5390,17 +5390,17 @@ nsBrowserAccess.prototype = { return null; } var isExternal = !!(aFlags & Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL); var userContextId = aParams.openerOriginAttributes && ("userContextId" in aParams.openerOriginAttributes) ? aParams.openerOriginAttributes.userContextId - : Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID + : Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID; let referrer = aParams.referrer ? makeURI(aParams.referrer) : null; return this._openURIInNewTab(aURI, referrer, aParams.referrerPolicy, aParams.isPrivate, isExternal, false, userContextId, null, aParams.openerBrowser, aParams.triggeringPrincipal, @@ -5409,17 +5409,17 @@ nsBrowserAccess.prototype = { isTabContentWindow(aWindow) { return gBrowser.browsers.some(browser => browser.contentWindow == aWindow); }, canClose() { return CanCloseWindow(); }, -} +}; function getTogglableToolbars() { let toolbarNodes = Array.slice(gNavToolbox.childNodes); toolbarNodes = toolbarNodes.concat(gNavToolbox.externalToolbars); toolbarNodes = toolbarNodes.filter(node => node.getAttribute("toolbarname")); return toolbarNodes; } @@ -6918,17 +6918,17 @@ function BrowserOpenAddonsMgr(aView) { .QueryInterface(Ci.nsIDocShellTreeItem) .rootTreeItem .QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIDOMWindow); if (!emWindow || browserWin == window /* favor the current window */) { emWindow = aSubject; browserWindow = browserWin; } - } + }; Services.obs.addObserver(receivePong, "EM-pong"); Services.obs.notifyObservers(null, "EM-ping"); Services.obs.removeObserver(receivePong, "EM-pong"); if (emWindow) { if (aView) { emWindow.loadView(aView); } @@ -6975,17 +6975,17 @@ function AddKeywordForSearchField() { keyword: "", postData: bookmarkData.postData, charSet: bookmarkData.charset, hiddenRows: [ "location", "description", "tags", "loadInSidebar" ] }, window); - } + }; mm.addMessageListener("ContextMenu:SearchFieldBookmarkData:Result", onMessage); mm.sendAsyncMessage("ContextMenu:SearchFieldBookmarkData", {}, { target: gContextMenu.target }); } /** * Re-open a closed tab. * @param aIndex @@ -7126,17 +7126,17 @@ function ReportFalseDeceptiveSite() { getService(Ci.nsIPromptService); let bundle = Services.strings.createBundle("chrome://browser/locale/safebrowsing/safebrowsing.properties"); promptService.alert(window, bundle.GetStringFromName("errorReportFalseDeceptiveTitle"), bundle.formatStringFromName("errorReportFalseDeceptiveMessage", [message.data.blockedInfo.provider], 1)); } - } + }; mm.addMessageListener("DeceptiveBlockedDetails:Result", onMessage); mm.sendAsyncMessage("DeceptiveBlockedDetails"); } } /** * Format a URL @@ -8150,17 +8150,17 @@ const gRemoteControl = { mainWindow.removeAttribute("remotecontrol"); } }, }; function getNotificationBox(aWindow) { var foundBrowser = gBrowser.getBrowserForDocument(aWindow.document); if (foundBrowser) - return gBrowser.getNotificationBox(foundBrowser) + return gBrowser.getNotificationBox(foundBrowser); return null; } function getTabModalPromptBox(aWindow) { var foundBrowser = gBrowser.getBrowserForDocument(aWindow.document); if (foundBrowser) return gBrowser.getTabModalPromptBox(foundBrowser); return null; @@ -8866,17 +8866,17 @@ var ToolbarIconColor = { for (let [toolbar, luminance] of luminances) { if (luminance <= 110) toolbar.removeAttribute("brighttext"); else toolbar.setAttribute("brighttext", "true"); } } -} +}; var PanicButtonNotifier = { init() { this._initialized = true; if (window.PanicButtonNotifierShouldNotify) { delete window.PanicButtonNotifierShouldNotify; this.notify(); }
--- a/browser/base/content/content.js +++ b/browser/base/content/content.js @@ -218,17 +218,17 @@ var AboutBlockedSiteListener = { el.remove(); return; } let anchorEl = content.document.getElementById("advisory_provider"); anchorEl.setAttribute("href", advisoryUrl); anchorEl.textContent = advisoryLinkText; }, -} +}; var AboutNetAndCertErrorListener = { init(chromeGlobal) { addMessageListener("CertErrorDetails", this); addMessageListener("Browser:CaptivePortalFreed", this); chromeGlobal.addEventListener("AboutNetErrorLoad", this, false, true); chromeGlobal.addEventListener("AboutNetErrorOpenCaptivePortal", this, false, true); chromeGlobal.addEventListener("AboutNetErrorSetAutomatic", this, false, true); @@ -416,17 +416,17 @@ var AboutNetAndCertErrorListener = { let {host, port} = content.document.mozDocumentURIIfNotForErrorPages; sendAsyncMessage("Browser:SendSSLErrorReport", { uri: { host, port }, securityInfo: getSerializedSecurityInfo(docShell), }); } }, -} +}; AboutNetAndCertErrorListener.init(this); AboutBlockedSiteListener.init(this); var ClickEventHandler = { init: function init() { Cc["@mozilla.org/eventlistenerservice;1"] .getService(Ci.nsIEventListenerService) @@ -495,17 +495,17 @@ var ClickEventHandler = { if (event.button == 0 && !event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey) { json.bookmark = node.getAttribute("rel") == "sidebar"; if (json.bookmark) { event.preventDefault(); // Need to prevent the pageload. } } } - json.noReferrer = BrowserUtils.linkHasNoReferrer(node) + json.noReferrer = BrowserUtils.linkHasNoReferrer(node); // Check if the link needs to be opened with mixed content allowed. // Only when the owner doc has |mixedContentChannel| and the same origin // should we allow mixed content. json.allowMixedContent = false; let docshell = ownerDoc.defaultView.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIWebNavigation) .QueryInterface(Ci.nsIDocShell); @@ -687,17 +687,17 @@ var PageMetadataMessenger = { case "PageMetadata:GetMicroformats": { let target = contextMenu.getTarget(message); let result = PageMetadata.getMicroformats(content.document, target); sendAsyncMessage("PageMetadata:MicroformatsResult", result); break; } } } -} +}; PageMetadataMessenger.init(); addMessageListener("Bookmarks:GetPageDetails", (message) => { let doc = content.document; let isErrorPage = /^about:(neterror|certerror|blocked)/.test(doc.documentURI); sendAsyncMessage("Bookmarks:GetPageDetails:Result", { isErrorPage, description: PlacesUIUtils.getDescriptionFromDocument(doc) });
--- a/browser/base/content/nsContextMenu.js +++ b/browser/base/content/nsContextMenu.js @@ -872,17 +872,17 @@ nsContextMenu.prototype = { tabBrowser = browserWindow.gBrowser; } let tab = tabBrowser.loadOneTab("about:blank", { relatedToCurrent: true, inBackground: false, triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(), }); return tabBrowser.getBrowserForTab(tab); - } + }; let target = aContext == "mathml" ? this.target : null; top.gViewSourceUtils.viewPartialSourceInBrowser(gBrowser.selectedBrowser, target, openSelectionFn); }, // Open new "view source" window with the frame's URL. viewFrameSource() { BrowserViewSourceOfDocument({ @@ -1118,43 +1118,43 @@ nsContextMenu.prototype = { }, onDataAvailable: function saveLinkAs_onDataAvailable(aRequest, aContext, aInputStream, aOffset, aCount) { this.extListener.onDataAvailable(aRequest, aContext, aInputStream, aOffset, aCount); } - } + }; function callbacks() {} callbacks.prototype = { getInterface: function sLA_callbacks_getInterface(aIID) { if (aIID.equals(Ci.nsIAuthPrompt) || aIID.equals(Ci.nsIAuthPrompt2)) { // If the channel demands authentication prompt, we must cancel it // because the save-as-timer would expire and cancel the channel // before we get credentials from user. Both authentication dialog // and save as dialog would appear on the screen as we fall back to // the old fashioned way after the timeout. timer.cancel(); channel.cancel(NS_ERROR_SAVE_LINK_AS_TIMEOUT); } throw Cr.NS_ERROR_NO_INTERFACE; } - } + }; // if it we don't have the headers after a short time, the user // won't have received any feedback from their click. that's bad. so // we give up waiting for the filename. function timerCallback() {} timerCallback.prototype = { notify: function sLA_timer_notify(aTimer) { channel.cancel(NS_ERROR_SAVE_LINK_AS_TIMEOUT); } - } + }; // setting up a new channel for 'right click - save link as ...' // ideally we should use: // * doc - as the loadingNode, and/or // * this.principal - as the loadingPrincipal // for now lets use systemPrincipal to bypass mixedContentBlocker // checks after redirects, see bug: 1136055 var channel = NetUtil.newChannel({
--- a/browser/base/content/pageinfo/pageInfo.js +++ b/browser/base/content/pageinfo/pageInfo.js @@ -79,17 +79,17 @@ pageInfoTreeView.prototype = { }, handleCopy(row) { return (row < 0 || this.copycol < 0) ? "" : (this.data[row][this.copycol] || ""); }, performActionOnRow(action, row) { if (action == "copy") { - var data = this.handleCopy(row) + var data = this.handleCopy(row); this.tree.treeBody.parentNode.setAttribute("copybuffer", data); } }, onPageMediaSort(columnname) { var tree = document.getElementById(this.treeid); var treecol = tree.columns.getNamedColumn(columnname); @@ -116,17 +116,17 @@ pageInfoTreeView.prototype = { }, getRowProperties(row) { return ""; }, getCellProperties(row, column) { return ""; }, getColumnProperties(column) { return ""; }, isContainer(index) { return false; }, isContainerOpen(index) { return false; }, isSeparator(index) { return false; }, - isSorted() { return this.sortcol > -1 }, + isSorted() { return this.sortcol > -1; }, canDrop(index, orientation) { return false; }, drop(row, orientation) { return false; }, getParentIndex(index) { return 0; }, hasNextSibling(index, after) { return false; }, getLevel(index) { return 0; }, getImageSrc(row, column) { }, getProgressMode(row, column) { }, getCellValue(row, column) { }, @@ -244,17 +244,17 @@ var loadContextInfo = LoadContextInfo.fr .getInterface(Components.interfaces.nsIWebNavigation) .QueryInterface(Components.interfaces.nsILoadContext), false); var diskStorage = cacheService.diskCacheStorage(loadContextInfo, false); const nsICookiePermission = Components.interfaces.nsICookiePermission; const nsIPermissionManager = Components.interfaces.nsIPermissionManager; const nsICertificateDialogs = Components.interfaces.nsICertificateDialogs; -const CERTIFICATEDIALOGS_CONTRACTID = "@mozilla.org/nsCertificateDialogs;1" +const CERTIFICATEDIALOGS_CONTRACTID = "@mozilla.org/nsCertificateDialogs;1"; // clipboard helper function getClipboardHelper() { try { return Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper); } catch (e) { // do nothing, later code will handle the error return null; @@ -265,17 +265,17 @@ const gClipboardHelper = getClipboardHel // Interface for image loading content const nsIImageLoadingContent = Components.interfaces.nsIImageLoadingContent; // namespaces, don't need all of these yet... const XLinkNS = "http://www.w3.org/1999/xlink"; const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; const XMLNS = "http://www.w3.org/XML/1998/namespace"; const XHTMLNS = "http://www.w3.org/1999/xhtml"; -const XHTML2NS = "http://www.w3.org/2002/06/xhtml2" +const XHTML2NS = "http://www.w3.org/2002/06/xhtml2"; const XHTMLNSre = "^http\:\/\/www\.w3\.org\/1999\/xhtml$"; const XHTML2NSre = "^http\:\/\/www\.w3\.org\/2002\/06\/xhtml2$"; const XHTMLre = RegExp(XHTMLNSre + "|" + XHTML2NSre, ""); /* Overlays register functions here. * These arrays are used to hold callbacks that Page Info will call at * various stages. Use them by simply appending a function to them. @@ -885,17 +885,17 @@ function makePreview(row) { if (item.SVGImageElement) { newImage.width = item.SVGImageElementWidth; newImage.height = item.SVGImageElementHeight; } width = newImage.width; height = newImage.height; - document.getElementById("theimagecontainer").collapsed = false + document.getElementById("theimagecontainer").collapsed = false; document.getElementById("brokenimagecontainer").collapsed = true; let imageSize = ""; if (url) { if (width != physWidth || height != physHeight) { imageSize = gBundle.getFormattedString("mediaDimensionsScaled", [formatNumber(physWidth), formatNumber(physHeight), @@ -994,17 +994,17 @@ var imagePermissionObserver = { var row = getSelectedRow(imageTree); var url = gImageView.data[row][COL_IMAGE_ADDRESS]; if (permission.matchesURI(makeURI(url), true)) { makeBlockImage(url); } } } } -} +}; function getContentTypeFromHeaders(cacheEntryDescriptor) { if (!cacheEntryDescriptor) return null; let headers = cacheEntryDescriptor.getMetaDataElement("response-head"); let type = /^Content-Type:\s*(.*?)\s*(?:\;|$)/mi.exec(headers); return type && type[1];
--- a/browser/base/content/pageinfo/security.js +++ b/browser/base/content/pageinfo/security.js @@ -82,20 +82,20 @@ var security = { break; case nsISSLStatus.TLS_VERSION_1: retval.version = "TLS 1.0"; break; case nsISSLStatus.TLS_VERSION_1_1: retval.version = "TLS 1.1"; break; case nsISSLStatus.TLS_VERSION_1_2: - retval.version = "TLS 1.2" + retval.version = "TLS 1.2"; break; case nsISSLStatus.TLS_VERSION_1_3: - retval.version = "TLS 1.3" + retval.version = "TLS 1.3"; break; } // Select the status text to display for Certificate Transparency. // Since we do not yet enforce the CT Policy on secure connections, // we must not complain on policy discompliance (it might be viewed // as a security issue by the user). switch (status.certificateTransparencyStatus) {
--- a/browser/base/content/sanitize.js +++ b/browser/base/content/sanitize.js @@ -613,17 +613,17 @@ Sanitizer.prototype = { let sizemode = docEl.getAttribute("sizemode"); if (!newWindow.fullScreen && sizemode == "fullscreen") { docEl.setAttribute("sizemode", "normal"); e.preventDefault(); e.stopPropagation(); return false; } return undefined; - } + }; newWindow.addEventListener("fullscreen", onFullScreen); } let promiseReady = new Promise(resolve => { // Window creation and destruction is asynchronous. We need to wait // until all existing windows are fully closed, and the new window is // fully open, before continuing. Otherwise the rest of the sanitizer // could run too early (and miss new cookies being set when a page @@ -639,30 +639,30 @@ Sanitizer.prototype = { newWindow.removeEventListener("fullscreen", onFullScreen); } newWindowOpened = true; // If we're the last thing to happen, invoke callback. if (numWindowsClosing == 0) { TelemetryStopwatch.finish("FX_SANITIZE_OPENWINDOWS", refObj); resolve(); } - } + }; let numWindowsClosing = windowList.length; let onWindowClosed = function() { numWindowsClosing--; if (numWindowsClosing == 0) { Services.obs.removeObserver(onWindowClosed, "xul-window-destroyed"); // If we're the last thing to happen, invoke callback. if (newWindowOpened) { TelemetryStopwatch.finish("FX_SANITIZE_OPENWINDOWS", refObj); resolve(); } } - } + }; Services.obs.addObserver(onWindowOpened, "browser-delayed-startup-finished"); Services.obs.addObserver(onWindowClosed, "xul-window-destroyed"); }); // Start the process of closing windows while (windowList.length) { windowList.pop().close(); }
--- a/browser/base/content/test/about/browser_aboutHome_snippets.js +++ b/browser/base/content/test/about/browser_aboutHome_snippets.js @@ -37,17 +37,17 @@ add_task(async function() { }); add_task(async function() { info("Check default snippets are shown"); await withSnippetsMap(null, function() { let doc = content.document; let snippetsElt = doc.getElementById("snippets"); - ok(snippetsElt, "Found snippets element") + ok(snippetsElt, "Found snippets element"); is(snippetsElt.getElementsByTagName("span").length, 1, "A default snippet is present."); }); }); add_task(async function() { info("Check default snippets are shown if snippets are invalid xml"); @@ -83,17 +83,17 @@ add_task(async function() { add_task(async function() { info("Check cached snippets are shown if cached version is current"); await withSnippetsMap( snippetsMap => snippetsMap.set("snippets", "test"), function(args) { let doc = content.document; - let snippetsMap = content.gSnippetsMap + let snippetsMap = content.gSnippetsMap; let snippetsElt = doc.getElementById("snippets"); ok(snippetsElt, "Found snippets element"); is(snippetsElt.innerHTML, "test", "Cached snippet is present."); is(snippetsMap.get("snippets"), "test", "snippets still cached"); is(snippetsMap.get("snippets-cached-version"), args.expectedVersion,
--- a/browser/base/content/test/about/healthreport_testRemoteCommands.html +++ b/browser/base/content/test/about/healthreport_testRemoteCommands.html @@ -197,17 +197,17 @@ function doTest(evt) { var test = tests[currentTest]; if (evt.data.type != test.payloadType) return; // skip unrequested events var error = JSON.stringify(evt.data.content); var pass = false; try { - pass = test.validateResponse(evt.data.content) + pass = test.validateResponse(evt.data.content); } catch (e) {} reportResult(test.info, pass, error); } // start the next test if there are any left if (tests[++currentTest]) sendToBrowser(tests[currentTest].event, tests[currentTest].eventData); else reportFinished();
--- a/browser/base/content/test/alerts/browser_notification_remove_permission.js +++ b/browser/base/content/test/alerts/browser_notification_remove_permission.js @@ -36,17 +36,17 @@ function onAlertShowing() { } ok(Services.perms.testExactPermission(makeURI(notificationURL), "desktop-notification"), "Permission should exist prior to removal"); let disableForOriginMenuItem = alertWindow.document.getElementById("disableForOriginMenuItem"); is(disableForOriginMenuItem.localName, "menuitem", "menuitem found"); Services.obs.addObserver(permObserver, "perm-changed"); alertWindow.addEventListener("beforeunload", onAlertClosing); disableForOriginMenuItem.click(); - info("Clicked on disable-for-origin menuitem") + info("Clicked on disable-for-origin menuitem"); } function permObserver(subject, topic, data) { if (topic != "perm-changed") { return; } let permission = subject.QueryInterface(Ci.nsIPermission);
--- a/browser/base/content/test/captivePortal/browser_captivePortal_certErrorUI.js +++ b/browser/base/content/test/captivePortal/browser_captivePortal_certErrorUI.js @@ -27,17 +27,17 @@ add_task(async function checkCaptivePort let errorTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, () => { let tab = BrowserTestUtils.addTab(gBrowser, BAD_CERT_PAGE); gBrowser.selectedTab = tab; browser = gBrowser.selectedBrowser; certErrorLoaded = BrowserTestUtils.waitForContentEvent(browser, "DOMContentLoaded"); return tab; }, false); - info("Waiting for cert error page to load.") + info("Waiting for cert error page to load."); await certErrorLoaded; let portalTabPromise = BrowserTestUtils.waitForNewTab(gBrowser, CANONICAL_URL); await ContentTask.spawn(browser, null, () => { let doc = content.document; ok(doc.body.classList.contains("captiveportal"), "Captive portal error page UI is visible.");
--- a/browser/base/content/test/captivePortal/head.js +++ b/browser/base/content/test/captivePortal/head.js @@ -102,17 +102,17 @@ function ensurePortalTab(win) { // are two tabs in the window - the default tab and the portal tab. is(win.gBrowser.tabs.length, 2, "There should be a captive portal tab in the window."); } function ensurePortalNotification(win) { let notificationBox = win.document.getElementById("high-priority-global-notificationbox"); - let notification = notificationBox.getNotificationWithValue(PORTAL_NOTIFICATION_VALUE) + let notification = notificationBox.getNotificationWithValue(PORTAL_NOTIFICATION_VALUE); isnot(notification, null, "There should be a captive portal notification in the window."); return notification; } // Helper to test whether the "Show Login Page" is visible in the captive portal // notification (it should be hidden when the portal tab is selected). function testShowLoginPageButtonVisibility(notification, visibility) {
--- a/browser/base/content/test/favicons/browser_rich_icons.js +++ b/browser/base/content/test/favicons/browser_rich_icons.js @@ -1,14 +1,14 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ /* eslint-disable mozilla/no-arbitrary-setTimeout */ -const ROOT = "http://mochi.test:8888/browser/browser/base/content/test/favicons/" +const ROOT = "http://mochi.test:8888/browser/browser/base/content/test/favicons/"; add_task(async function test_richIcons() { const URL = ROOT + "file_rich_icon.html"; const EXPECTED_ICON = ROOT + "moz.png"; const EXPECTED_RICH_ICON = ROOT + "rich_moz_2.png"; // One regular icon and one rich icon. Note that ContentLinkHandler will // choose the best rich icon if there are multiple candidates available // in the page.
--- a/browser/base/content/test/forms/browser_selectpopup.js +++ b/browser/base/content/test/forms/browser_selectpopup.js @@ -155,17 +155,17 @@ async function doSelectTests(contentType EventUtils.synthesizeKey("KEY_ArrowDown", { code: "ArrowDown" }); // On Windows, one can navigate on disabled menuitems is(menulist.menuBoxObject.activeChild, menulist.getItemAtIndex(9), "Skip optgroup header and disabled items select item 7"); is(menulist.selectedIndex, isWindows ? 9 : 1, "Select or skip disabled item selectedIndex"); for (let i = 0; i < 10; i++) { - is(menulist.getItemAtIndex(i).disabled, i >= 4 && i <= 7, "item " + i + " disabled") + is(menulist.getItemAtIndex(i).disabled, i >= 4 && i <= 7, "item " + i + " disabled"); } EventUtils.synthesizeKey("KEY_ArrowUp", { code: "ArrowUp" }); is(menulist.menuBoxObject.activeChild, menulist.getItemAtIndex(3), "Select item 3 again"); is(menulist.selectedIndex, isWindows ? 3 : 1, "Select item 3 selectedIndex"); is((await getInputEvents()), 0, "Before closed - number of input events"); is((await getChangeEvents()), 0, "Before closed - number of change events"); @@ -175,17 +175,17 @@ async function doSelectTests(contentType await ContentTask.spawn(gBrowser.selectedBrowser, { isWindows }, function(args) { Assert.equal(String(content.getSelection()), args.isWindows ? "Text" : "", "Select all while popup is open"); }); // Backspace should not go back let handleKeyPress = function(event) { ok(false, "Should not get keypress event"); - } + }; window.addEventListener("keypress", handleKeyPress); EventUtils.synthesizeKey("VK_BACK_SPACE", { }); window.removeEventListener("keypress", handleKeyPress); await hideSelectPopup(selectPopup); is(menulist.selectedIndex, 3, "Item 3 still selected"); is((await getInputEvents()), 1, "After closed - number of input events"); @@ -556,17 +556,17 @@ async function performLargePopupTests(wi select.getBoundingClientRect(); }); await contentPainted; } if (navigator.platform.indexOf("Mac") == 0) { await ContentTask.spawn(browser, null, async function() { let doc = content.document; - doc.body.style = "padding-top: 400px;" + doc.body.style = "padding-top: 400px;"; let select = doc.getElementById("one"); select.options[41].selected = true; select.focus(); }); await openSelectPopup(selectPopup, "key", "select", win);
--- a/browser/base/content/test/general/browser_accesskeys.js +++ b/browser/base/content/test/general/browser_accesskeys.js @@ -64,17 +64,17 @@ add_task(async function() { Services.focus.clearFocus(window); focusedId = await performAccessKey("y"); is(focusedId, "tab3button", "button accesskey in tab3 should be focused"); newButton.onfocus = () => { ok(false, "chromebutton shouldn't get focus during testing with tab3"); - } + }; // Press the accesskey for the chrome element while the content document is focused. focusedId = await performAccessKey("z"); is(focusedId, "tab3body", "button accesskey in tab3 should keep having focus"); newButton.onfocus = null; gBrowser.removeTab(tab3); @@ -93,17 +93,17 @@ add_task(async function() { focusedId = await performAccessKey("y"); is(focusedId, "tab4button", "button accesskey in tab4 should be focused"); newButton.onfocus = () => { // EventStateManager handles accesskey before dispatching keypress event // into the DOM tree, therefore, chrome accesskey always wins focus from // content. However, this is different from shortcut keys. todo(false, "chromebutton shouldn't get focus during testing with tab4"); - } + }; // Press the accesskey for the chrome element while the content document is focused. focusedId = await performAccessKey("z"); is(focusedId, "tab4body", "button accesskey in tab4 should keep having focus"); newButton.onfocus = null; gBrowser.removeTab(tab4); @@ -112,17 +112,17 @@ add_task(async function() { }); function childHandleFocus() { var sent = false; content.document.body.firstChild.addEventListener("focus", function focused(event) { sent = true; let focusedElement = content.document.activeElement; focusedElement.blur(); - sendAsyncMessage("Test:FocusFromAccessKey", { focus: focusedElement.id }) + sendAsyncMessage("Test:FocusFromAccessKey", { focus: focusedElement.id }); }, true); content.document.body.addEventListener("keydown", function keydown(event) { sent = false; }, true); content.document.body.addEventListener("keyup", function keyup(event) { if (!sent) { sent = true; let focusedElement = content.document.activeElement;
--- a/browser/base/content/test/general/browser_alltabslistener.js +++ b/browser/base/content/test/general/browser_alltabslistener.js @@ -30,17 +30,17 @@ var gFrontProgressListener = { onSecurityChange(aWebProgress, aRequest, aState) { var state = "onSecurityChange"; info("FrontProgress: " + state + " 0x" + aState.toString(16)); ok(gFrontNotificationsPos < gFrontNotifications.length, "Got an expected notification for the front notifications listener"); is(state, gFrontNotifications[gFrontNotificationsPos], "Got a notification for the front notifications listener"); gFrontNotificationsPos++; } -} +}; var gAllProgressListener = { onStateChange(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) { var state = "onStateChange"; info("AllProgress: " + state + " 0x" + aStateFlags.toString(16)); ok(aBrowser == gTestBrowser, state + " notification came from the correct browser"); ok(gAllNotificationsPos < gAllNotifications.length, "Got an expected notification for the all notifications listener"); is(state, gAllNotifications[gAllNotificationsPos], "Got a notification for the all notifications listener"); @@ -71,17 +71,17 @@ var gAllProgressListener = { onSecurityChange(aBrowser, aWebProgress, aRequest, aState) { var state = "onSecurityChange"; info("AllProgress: " + state + " 0x" + aState.toString(16)); ok(aBrowser == gTestBrowser, state + " notification came from the correct browser"); ok(gAllNotificationsPos < gAllNotifications.length, "Got an expected notification for the all notifications listener"); is(state, gAllNotifications[gAllNotificationsPos], "Got a notification for the all notifications listener"); gAllNotificationsPos++; } -} +}; var gFrontNotifications, gAllNotifications, gFrontNotificationsPos, gAllNotificationsPos; var gBackgroundTab, gForegroundTab, gBackgroundBrowser, gForegroundBrowser, gTestBrowser; var gTestPage = "/browser/browser/base/content/test/general/alltabslistener.html"; const kBasePage = "http://example.org/browser/browser/base/content/test/general/dummy_page.html"; var gNextTest; function test() {
--- a/browser/base/content/test/general/browser_audioTabIcon.js +++ b/browser/base/content/test/general/browser_audioTabIcon.js @@ -328,17 +328,17 @@ async function test_browser_swapping(tab let icon = document.getAnonymousElementByAttribute(tab, "anonid", "soundplaying-icon"); await test_mute_tab(tab, icon, true); await BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank", }, async function(newBrowser) { - await test_swapped_browser_while_playing(tab, newBrowser) + await test_swapped_browser_while_playing(tab, newBrowser); // Now, test swapping with a muted but not playing tab. // Note that the tab remains muted, so we only need to pause playback. tab = gBrowser.getTabForBrowser(newBrowser); await pause(tab); await BrowserTestUtils.withNewTab({ gBrowser,
--- a/browser/base/content/test/general/browser_bookmark_popup.js +++ b/browser/base/content/test/general/browser_bookmark_popup.js @@ -18,17 +18,17 @@ const TEST_URL = "data:text/html,<html>< StarUI._closePanelQuickForTesting = true; add_task(async function setup() { bookmarkPanel.setAttribute("animate", false); registerCleanupFunction(() => { bookmarkPanel.removeAttribute("animate"); }); -}) +}); async function test_bookmarks_popup({isNewBookmark, popupShowFn, popupEditFn, shouldAutoClose, popupHideFn, isBookmarkRemoved}) { await BrowserTestUtils.withNewTab({gBrowser, url: TEST_URL}, async function(browser) { try { if (!isNewBookmark) { await PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
--- a/browser/base/content/test/general/browser_bookmark_titles.js +++ b/browser/base/content/test/general/browser_bookmark_titles.js @@ -132,12 +132,12 @@ async function checkBookmark(url, expect // BrowserTestUtils.browserLoaded doesn't work for the about pages, so use a // custom page load listener. function promisePageLoaded(browser) { return ContentTask.spawn(browser, null, async function() { await ContentTaskUtils.waitForEvent(this, "DOMContentLoaded", true, (event) => { return event.originalTarget === content.document && - event.target.location.href !== "about:blank" + event.target.location.href !== "about:blank"; }); }); }
--- a/browser/base/content/test/general/browser_bug321000.js +++ b/browser/base/content/test/general/browser_bug321000.js @@ -53,17 +53,17 @@ function test_paste(aCurrentTest) { element.removeEventListener(event.type, this); is(element.value, this.test.expected, this.test.desc); // Clear the field and go to next test. element.value = ""; setTimeout(next_test, 0); } - } + }; element.addEventListener("input", inputListener); // Focus the window. window.focus(); gBrowser.selectedBrowser.focus(); // Focus the element and wait for focus event. info("About to focus " + element.id);
--- a/browser/base/content/test/general/browser_bug356571.js +++ b/browser/base/content/test/general/browser_bug356571.js @@ -53,17 +53,17 @@ var gProgressListener = { return; // Check we failed on unknown protocol (received an alert from docShell) ok(didFail, "Correctly failed on unknown protocol"); // Check we opened all tabs ok(gBrowser.tabs.length == kURIs.length, "Correctly opened all expected tabs"); finishTest(); } } -} +}; function test() { todo(false, "temp. disabled"); /* FIXME */ /* waitForExplicitFinish(); // Wait for all tabs to finish loading gBrowser.addTabsProgressListener(gProgressListener);
--- a/browser/base/content/test/general/browser_bug537474.js +++ b/browser/base/content/test/general/browser_bug537474.js @@ -1,8 +1,8 @@ add_task(async function() { let browserLoadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); window.browserDOMWindow.openURI(makeURI("about:"), null, Ci.nsIBrowserDOMWindow.OPEN_CURRENTWINDOW, null, - Services.scriptSecurityManager.getSystemPrincipal()) + Services.scriptSecurityManager.getSystemPrincipal()); await browserLoadedPromise; is(gBrowser.currentURI.spec, "about:", "page loads in the current content window"); });
--- a/browser/base/content/test/general/browser_bug561636.js +++ b/browser/base/content/test/general/browser_bug561636.js @@ -174,17 +174,17 @@ add_task(async function() { checkPopupShow(); await checkChildFocus(browser, gInvalidFormPopup.firstChild.textContent); await new Promise((resolve, reject) => { EventUtils.synthesizeKey("a", {}); executeSoon(function() { checkPopupShow(); resolve(); - }) + }); }); gBrowser.removeCurrentTab(); }); /** * In this test, we check that we can hide the popup by blurring the invalid * element.
--- a/browser/base/content/test/general/browser_bug578534.js +++ b/browser/base/content/test/general/browser_bug578534.js @@ -1,16 +1,16 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ add_task(async function test() { let uriString = "http://example.com/"; let cookieBehavior = "network.cookie.cookieBehavior"; - let uriObj = Services.io.newURI(uriString) + let uriObj = Services.io.newURI(uriString); let cp = Components.classes["@mozilla.org/cookie/permission;1"] .getService(Components.interfaces.nsICookiePermission); await SpecialPowers.pushPrefEnv({ set: [[ cookieBehavior, 2 ]] }); cp.setAccess(uriObj, cp.ACCESS_ALLOW); await BrowserTestUtils.withNewTab({ gBrowser, url: uriString }, async function(browser) { await ContentTask.spawn(browser, null, function() {
--- a/browser/base/content/test/general/browser_bug590206.js +++ b/browser/base/content/test/general/browser_bug590206.js @@ -127,33 +127,33 @@ add_task(async function test_resource_ur gBrowser.selectedTab = newTab; is(getConnectionState(), "file", "Connection should be file"); gBrowser.removeTab(newTab); }); add_task(async function test_data_uri() { let oldTab = gBrowser.selectedTab; - let dataURI = "data:text/html,hi" + let dataURI = "data:text/html,hi"; let newTab = await loadNewTab(dataURI); is(getIdentityMode(), "unknownIdentity", "Identity should be unknown"); gBrowser.selectedTab = oldTab; is(getIdentityMode(), "unknownIdentity", "Identity should be unknown"); gBrowser.selectedTab = newTab; is(getIdentityMode(), "unknownIdentity", "Identity should be unknown"); gBrowser.removeTab(newTab); }); add_task(async function test_about_uri() { let oldTab = gBrowser.selectedTab; - let aboutURI = "about:robots" + let aboutURI = "about:robots"; let newTab = await loadNewTab(aboutURI); is(getConnectionState(), "file", "Connection should be file"); gBrowser.selectedTab = oldTab; is(getIdentityMode(), "unknownIdentity", "Identity should be unknown"); gBrowser.selectedTab = newTab;
--- a/browser/base/content/test/general/browser_bug633691.js +++ b/browser/base/content/test/general/browser_bug633691.js @@ -19,12 +19,12 @@ add_task(async function test() { /* eslint-disable no-eval */ let is_hidden = eval(`(() => ${is_hidden_})()`); let is_element_hidden = eval(`(() => ${is_element_hidden_})()`); /* eslint-enable no-eval */ let doc = content.document.getElementsByTagName("iframe")[0].contentDocument; let aP = doc.getElementById("badCertAdvancedPanel"); ok(aP, "Advanced content should exist"); void is_hidden; // Quiet eslint warnings (actual use under is_element_hidden) - is_element_hidden(aP, "Advanced content should not be visible by default") + is_element_hidden(aP, "Advanced content should not be visible by default"); }); }); });
--- a/browser/base/content/test/general/browser_clipboard.js +++ b/browser/base/content/test/general/browser_clipboard.js @@ -49,17 +49,17 @@ add_task(async function() { selection.modify("extend", "right", "word"); await new Promise((resolve, reject) => { addEventListener("copy", function copyEvent(event) { removeEventListener("copy", copyEvent, true); // The data is empty as the selection is copied during the event default phase. Assert.equal(event.clipboardData.mozItemCount, 0, "Zero items on clipboard"); resolve(); - }, true) + }, true); sendKey("c"); }); selection.modify("move", "right", "line"); await new Promise((resolve, reject) => { addEventListener("paste", function copyEvent(event) { @@ -68,17 +68,17 @@ add_task(async function() { Assert.equal(clipboardData.mozItemCount, 1, "One item on clipboard"); Assert.equal(clipboardData.types.length, 2, "Two types on clipboard"); Assert.equal(clipboardData.types[0], "text/html", "text/html on clipboard"); Assert.equal(clipboardData.types[1], "text/plain", "text/plain on clipboard"); Assert.equal(clipboardData.getData("text/html"), arg.htmlPrefix + "t <b>Bold</b>" + arg.htmlPostfix, "text/html value"); Assert.equal(clipboardData.getData("text/plain"), "t Bold", "text/plain value"); resolve(); - }, true) + }, true); sendKey("v"); }); Assert.equal(main.innerHTML, "Test <b>Bold</b> After Textt <b>Bold</b>", "Copy and paste html"); selection.modify("extend", "left", "word"); selection.modify("extend", "left", "word"); selection.modify("extend", "left", "character"); @@ -86,17 +86,17 @@ add_task(async function() { await new Promise((resolve, reject) => { addEventListener("cut", function copyEvent(event) { removeEventListener("cut", copyEvent, true); event.clipboardData.setData("text/plain", "Some text"); event.clipboardData.setData("text/html", "<i>Italic</i> "); selection.deleteFromDocument(); event.preventDefault(); resolve(); - }, true) + }, true); sendKey("x"); }); selection.modify("move", "left", "line"); await new Promise((resolve, reject) => { addEventListener("paste", function copyEvent(event) { removeEventListener("paste", copyEvent, true); @@ -104,17 +104,17 @@ add_task(async function() { Assert.equal(clipboardData.mozItemCount, 1, "One item on clipboard 2"); Assert.equal(clipboardData.types.length, 2, "Two types on clipboard 2"); Assert.equal(clipboardData.types[0], "text/html", "text/html on clipboard 2"); Assert.equal(clipboardData.types[1], "text/plain", "text/plain on clipboard 2"); Assert.equal(clipboardData.getData("text/html"), arg.htmlPrefix + "<i>Italic</i> " + arg.htmlPostfix, "text/html value 2"); Assert.equal(clipboardData.getData("text/plain"), "Some text", "text/plain value 2"); resolve(); - }, true) + }, true); sendKey("v"); }); Assert.equal(main.innerHTML, "<i>Italic</i> Test <b>Bold</b> After<b></b>", "Copy and paste html 2"); }); // Next, check that the Copy Image command works. @@ -147,17 +147,17 @@ add_task(async function() { // DataTransfer doesn't support the image types yet, so only text/html // will be present. if (clipboardData.getData("text/html") !== arg.htmlPrefix + '<img id="img" tabindex="1" src="http://example.org/browser/browser/base/content/test/general/moz.png">' + arg.htmlPostfix) { reject("Clipboard Data did not contain an image, was " + clipboardData.getData("text/html")); } resolve(); - }, true) + }, true); const utils = content.QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIDOMWindowUtils); if (utils.sendKeyEvent("keydown", "v", 0, arg.modifier)) { utils.sendKeyEvent("keypress", "v", "v".charCodeAt(0), arg.modifier); } utils.sendKeyEvent("keyup", "v", 0, arg.modifier);
--- a/browser/base/content/test/general/browser_clipboard_pastefile.js +++ b/browser/base/content/test/general/browser_clipboard_pastefile.js @@ -11,17 +11,17 @@ add_task(async function() { await new Promise((resolve, reject) => { textbox.addEventListener("copy", function(event) { event.clipboardData.setData("text/plain", "Alternate"); // For this test, it doesn't matter that the file isn't actually a file. event.clipboardData.setData("application/x-moz-file", "Sample"); event.preventDefault(); resolve(); - }, {capture: true, once: true}) + }, {capture: true, once: true}); EventUtils.synthesizeKey("c", { accelKey: true }); }); let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "https://example.com/browser/browser/base/content/test/general/clipboard_pastefile.html"); let browser = tab.linkedBrowser;
--- a/browser/base/content/test/general/browser_contentAreaClick.js +++ b/browser/base/content/test/general/browser_contentAreaClick.js @@ -203,17 +203,17 @@ var gClickHandler = { let linkId = event.target.id || event.target.localName; is(event.type, "click", gCurrentTest.desc + ":Handler received a click event on " + linkId); let isPanelClick = linkId == "panellink"; gTestWin.contentAreaClick(event, isPanelClick); let prevent = event.defaultPrevented; is(prevent, gCurrentTest.preventDefault, - gCurrentTest.desc + ": event.defaultPrevented is correct (" + prevent + ")") + gCurrentTest.desc + ": event.defaultPrevented is correct (" + prevent + ")"); // Check that all required methods have been called. gCurrentTest.expectedInvokedMethods.forEach(function(aExpectedMethodName) { isnot(gInvokedMethods.indexOf(aExpectedMethodName), -1, gCurrentTest.desc + ":" + aExpectedMethodName + " was invoked"); }); if (gInvokedMethods.length != gCurrentTest.expectedInvokedMethods.length) { @@ -221,25 +221,25 @@ var gClickHandler = { gInvokedMethods.forEach(method => info(method + " was invoked")); } event.preventDefault(); event.stopPropagation(); executeSoon(runNextTest); } -} +}; // Wraps around the methods' replacement mock function. function wrapperMethod(aInvokedMethods, aMethodName) { return function() { aInvokedMethods.push(aMethodName); // At least getShortcutOrURIAndPostData requires to return url return (aMethodName == "getShortcutOrURIAndPostData") ? arguments.url : arguments[0]; - } + }; } function setupTestBrowserWindow() { // Steal click events and don't propagate them. gTestWin.addEventListener("click", gClickHandler, true); // Replace methods. gReplacedMethods.forEach(function(aMethodName) { @@ -251,28 +251,28 @@ function setupTestBrowserWindow() { let doc = gTestWin.content.document; let mainDiv = doc.createElement("div"); mainDiv.innerHTML = '<p><a id="commonlink" href="http://mochi.test/moz/">Common link</a></p>' + '<p><a id="panellink" href="http://mochi.test/moz/">Panel link</a></p>' + '<p><a id="emptylink">Empty link</a></p>' + '<p><math id="mathxlink" xmlns="http://www.w3.org/1998/Math/MathML" xlink:type="simple" xlink:href="http://mochi.test/moz/"><mtext>MathML XLink</mtext></math></p>' + '<p><svg id="svgxlink" xmlns="http://www.w3.org/2000/svg" width="100px" height="50px" version="1.1"><a xlink:type="simple" xlink:href="http://mochi.test/moz/"><text transform="translate(10, 25)">SVG XLink</text></a></svg></p>' + - '<p><map name="map" id="map"><area href="http://mochi.test/moz/" shape="rect" coords="0,0,128,128" /></map><img id="maplink" usemap="#map" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAIAAABMXPacAAAABGdBTUEAALGPC%2FxhBQAAAOtJREFUeF7t0IEAAAAAgKD9qRcphAoDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGBgwIAAAT0N51AAAAAASUVORK5CYII%3D"/></p>' + '<p><map name="map" id="map"><area href="http://mochi.test/moz/" shape="rect" coords="0,0,128,128" /></map><img id="maplink" usemap="#map" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAIAAABMXPacAAAABGdBTUEAALGPC%2FxhBQAAAOtJREFUeF7t0IEAAAAAgKD9qRcphAoDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGBgwIAAAT0N51AAAAAASUVORK5CYII%3D"/></p>'; doc.body.appendChild(mainDiv); } function runNextTest() { if (!gCurrentTest) { gCurrentTest = gTests.shift(); gCurrentTest.setup(); } if (gCurrentTest.targets.length == 0) { - info(gCurrentTest.desc + ": cleaning up...") + info(gCurrentTest.desc + ": cleaning up..."); gCurrentTest.clean(); if (gTests.length > 0) { gCurrentTest = gTests.shift(); gCurrentTest.setup(); } else { finishTest(); return;
--- a/browser/base/content/test/general/browser_contentSearchUI.js +++ b/browser/base/content/test/general/browser_contentSearchUI.js @@ -391,17 +391,17 @@ add_task(async function cycleEngines() { if (data != "engine-current") { return; } SimpleTest.is(subj.name, newEngineName, "Engine cycled correctly"); Services.obs.removeObserver(resolver, "browser-search-engine-modified"); resolve(); }, "browser-search-engine-modified"); }); - } + }; let p = promiseEngineChange(TEST_ENGINE_PREFIX + " " + TEST_ENGINE_2_BASENAME); await msg("key", { key: "VK_DOWN", modifiers: { accelKey: true }}); await p; p = promiseEngineChange(TEST_ENGINE_PREFIX + " " + TEST_ENGINE_BASENAME); await msg("key", { key: "VK_UP", modifiers: { accelKey: true }}); await p; @@ -439,17 +439,17 @@ add_task(async function search() { await msg("key", "VK_DOWN"); await msg("key", { key: "VK_RETURN", modifiers }); mesg = await p; eventData.searchString = "xfoo"; eventData.engineName = TEST_ENGINE_PREFIX + " " + TEST_ENGINE_BASENAME; eventData.selection = { index: 1, kind: "key", - } + }; SimpleTest.isDeeply(eventData, mesg, "Search event data"); await promiseTab(); await setUp(); // Test typing a query, then selecting a one-off button and pressing enter. p = msg("waitForSearch"); await msg("key", { key: "x", waitForSuggestions: true }); @@ -535,17 +535,17 @@ add_task(async function search() { state = await msg("changeComposition", { data: "x", waitForSuggestions: true }); checkState(state, "x", [{ str: "x", type: "formHistory" }, { str: "xfoo", type: "formHistory" }, "xbar"], -1); await msg("commitComposition"); delete modifiers.button; p = msg("waitForSearch"); await msg("key", { key: "VK_RETURN", modifiers }); mesg = await p; - eventData.searchString = "x" + eventData.searchString = "x"; eventData.originalEvent = modifiers; eventData.engineName = TEST_ENGINE_PREFIX + " " + TEST_ENGINE_BASENAME; delete eventData.selection; SimpleTest.isDeeply(eventData, mesg, "Search event data"); await promiseTab(); await setUp();
--- a/browser/base/content/test/general/browser_contextmenu.js +++ b/browser/base/content/test/general/browser_contextmenu.js @@ -615,17 +615,17 @@ add_task(async function test_dom_full_sc "context-viewinfo", true ], { maybeScreenshotsPresent: true, shiftkey: true, async preCheckContextMenuFn() { await pushPrefs(["full-screen-api.allow-trusted-requests-only", false], ["full-screen-api.transition-duration.enter", "0 0"], - ["full-screen-api.transition-duration.leave", "0 0"]) + ["full-screen-api.transition-duration.leave", "0 0"]); await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() { let doc = content.document; let win = doc.defaultView; let full_screen_element = doc.getElementById("test-dom-full-screen"); let awaitFullScreenChange = ContentTaskUtils.waitForEvent(win, "fullscreenchange"); full_screen_element.requestFullscreen(); await awaitFullScreenChange;
--- a/browser/base/content/test/general/browser_decoderDoctor.js +++ b/browser/base/content/test/general/browser_decoderDoctor.js @@ -84,17 +84,17 @@ function tab_checker_for_sumo(expectedPa }; } function tab_checker_for_webcompat(expectedParams) { return function(openedTab) { let urlString = openedTab.linkedBrowser.currentURI.spec; let endpoint = Services.prefs.getStringPref("media.decoder-doctor.new-issue-endpoint", ""); ok(urlString.startsWith(endpoint), - `Expected URL starting with '${endpoint}', got '${urlString}'`) + `Expected URL starting with '${endpoint}', got '${urlString}'`); let params = new URL(urlString).searchParams; for (let k in expectedParams) { if (!params.has(k)) { ok(false, `Expected ${k} in webcompat URL`); } else { is(params.get(k), expectedParams[k], `Expected ${k}='${expectedParams[k]}' in webcompat URL`); }
--- a/browser/base/content/test/general/browser_e10s_about_process.js +++ b/browser/base/content/test/general/browser_e10s_about_process.js @@ -1,32 +1,32 @@ const CHROME_PROCESS = Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT; const CONTENT_PROCESS = Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT; const CHROME = { id: "cb34538a-d9da-40f3-b61a-069f0b2cb9fb", path: "test-chrome", flags: 0, -} +}; const CANREMOTE = { id: "2480d3e1-9ce4-4b84-8ae3-910b9a95cbb3", path: "test-allowremote", flags: Ci.nsIAboutModule.URI_CAN_LOAD_IN_CHILD, -} +}; const MUSTREMOTE = { id: "f849cee5-e13e-44d2-981d-0fb3884aaead", path: "test-mustremote", flags: Ci.nsIAboutModule.URI_MUST_LOAD_IN_CHILD, -} +}; const TEST_MODULES = [ CHROME, CANREMOTE, MUSTREMOTE -] +]; function AboutModule() { } AboutModule.prototype = { newChannel(aURI, aLoadInfo) { throw Components.results.NS_ERROR_NOT_IMPLEMENTED; },
--- a/browser/base/content/test/general/browser_e10s_chrome_process.js +++ b/browser/base/content/test/general/browser_e10s_chrome_process.js @@ -24,17 +24,17 @@ function makeTest(name, startURL, startP let expectSyncChange = await transitionTask(browser, endURL); if (expectSyncChange) { is(browser.isRemoteBrowser, endProcessIsRemote, "Should have switched to the right process synchronously"); } await docLoadedPromise; is(browser.currentURI.spec, endURL, "Should have made it to the final URL"); is(browser.isRemoteBrowser, endProcessIsRemote, "Should be displayed in the right process"); - } + }; } const CHROME_PROCESS = Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT; const CONTENT_PROCESS = Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT; const PATH = (getRootDirectory(gTestPath) + "test_process_flags_chrome.html").replace("chrome://mochitests", ""); const CHROME = "chrome://mochitests" + PATH; const CANREMOTE = "chrome://mochitests-any" + PATH;
--- a/browser/base/content/test/general/browser_favicon_change.js +++ b/browser/base/content/test/general/browser_favicon_change.js @@ -1,14 +1,14 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; -const TEST_URL = "http://mochi.test:8888/browser/browser/base/content/test/general/file_favicon_change.html" +const TEST_URL = "http://mochi.test:8888/browser/browser/base/content/test/general/file_favicon_change.html"; add_task(async function() { let extraTab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); extraTab.linkedBrowser.loadURI(TEST_URL); let tabLoaded = BrowserTestUtils.browserLoaded(extraTab.linkedBrowser); let expectedFavicon = "http://example.org/one-icon"; let haveChanged = PromiseUtils.defer(); let observer = new MutationObserver(function(mutations) {
--- a/browser/base/content/test/general/browser_favicon_change_not_in_document.js +++ b/browser/base/content/test/general/browser_favicon_change_not_in_document.js @@ -1,11 +1,11 @@ "use strict"; -const TEST_URL = "http://mochi.test:8888/browser/browser/base/content/test/general/file_favicon_change_not_in_document.html" +const TEST_URL = "http://mochi.test:8888/browser/browser/base/content/test/general/file_favicon_change_not_in_document.html"; /* * This test tests a link element won't fire DOMLinkChanged/DOMLinkAdded unless * it is added to the DOM. See more details in bug 1083895. * * Note that there is debounce logic in ContentLinkHandler.jsm, adding a new * icon link after the icon parsing timeout will trigger a new icon extraction * cycle. Hence, there should be two favicons loads in this test as it appends
--- a/browser/base/content/test/general/browser_feed_discovery.js +++ b/browser/base/content/test/general/browser_feed_discovery.js @@ -1,9 +1,9 @@ -const URL = "http://mochi.test:8888/browser/browser/base/content/test/general/feed_discovery.html" +const URL = "http://mochi.test:8888/browser/browser/base/content/test/general/feed_discovery.html"; /** Test for Bug 377611 **/ add_task(async function() { // Open a new tab. gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, URL); registerCleanupFunction(() => gBrowser.removeCurrentTab()); @@ -25,9 +25,9 @@ add_task(async function() { if (/bogus/i.test(aLink.title)) { ok(!contentFeeds[aLink.href], "don't discover " + aLink.href); } else { ok(contentFeeds[aLink.href], "should discover " + aLink.href); } } } }); -}) +});
--- a/browser/base/content/test/general/browser_fullscreen-window-open.js +++ b/browser/base/content/test/general/browser_fullscreen-window-open.js @@ -208,17 +208,17 @@ function waitForTabOpen(aOptions) { if (aOptions.successFn) { aOptions.successFn(); } newBrowser.removeTab(tab); finalize(); }); - } + }; newBrowser.tabContainer.addEventListener("TabOpen", onTabOpen, true); let finalize = function() { aOptions.finalizeFn(); info("Finished: " + message.title); runNextTest(); };
--- a/browser/base/content/test/general/browser_gZipOfflineChild.js +++ b/browser/base/content/test/general/browser_gZipOfflineChild.js @@ -1,14 +1,14 @@ /** * Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -const URL = "http://mochi.test:8888/browser/browser/base/content/test/general/test_offline_gzip.html" +const URL = "http://mochi.test:8888/browser/browser/base/content/test/general/test_offline_gzip.html"; registerCleanupFunction(function() { // Clean up after ourself let uri = Services.io.newURI(URL); let principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {}); Services.perms.removeFromPrincipal(principal, "offline-app"); Services.prefs.clearUserPref("offline-apps.allow_by_default"); });
--- a/browser/base/content/test/general/browser_gestureSupport.js +++ b/browser/base/content/test/general/browser_gestureSupport.js @@ -606,17 +606,17 @@ function test_rotateGesturesOnTab() { } // Quick function to normalize rotation to 0 <= r < 360 var normRot = function(rotation) { rotation = rotation % 360; if (rotation < 0) rotation += 360; return rotation; - } + }; for (var initRot = 0; initRot < 360; initRot += 90) { // Test each case: at each 90 degree snap; cl/ccl; // amount more or less than 45; stop and hold or don't (32 total tests) // The amount added to the initRot is where it is expected to be test_rotateHelperOneGesture(imgElem, normRot(initRot + 0), cl, 35, true ); test_rotateHelperOneGesture(imgElem, normRot(initRot + 0), cl, 35, false); test_rotateHelperOneGesture(imgElem, normRot(initRot + 90), cl, 55, true );
--- a/browser/base/content/test/general/browser_getshortcutoruri.js +++ b/browser/base/content/test/general/browser_getshortcutoruri.js @@ -22,17 +22,17 @@ keyWordData.prototype = { init(aKeyWord, aURL, aPostData, aSearchWord) { this.keyword = aKeyWord; this.uri = makeURI(aURL); this.postData = aPostData; this.searchWord = aSearchWord; this.method = (this.postData ? "POST" : "GET"); } -} +}; function bmKeywordData(aKeyWord, aURL, aPostData, aSearchWord) { this.init(aKeyWord, aURL, aPostData, aSearchWord); } bmKeywordData.prototype = new keyWordData(); function searchKeywordData(aKeyWord, aURL, aPostData, aSearchWord) { this.init(aKeyWord, aURL, aPostData, aSearchWord);
--- a/browser/base/content/test/general/browser_invalid_uri_back_forward_manipulation.js +++ b/browser/base/content/test/general/browser_invalid_uri_back_forward_manipulation.js @@ -20,16 +20,16 @@ add_task(async function checkBackFromInv ok(gBrowser.webNavigation.canGoBack, "Should be able to go back"); if (gBrowser.webNavigation.canGoBack) { // Can't use DOMContentLoaded here because the page is bfcached. Can't use pageshow for // the error page because it doesn't seem to fire for those. let promiseOtherPageLoaded = BrowserTestUtils.waitForEvent(tab.linkedBrowser, "pageshow", false, // Be paranoid we *are* actually seeing this other page load, not some kind of race // for if/when we do start firing pageshow for the error page... - function(e) { return gBrowser.currentURI.spec == "about:robots" } + function(e) { return gBrowser.currentURI.spec == "about:robots"; } ); gBrowser.goBack(); await promiseOtherPageLoaded; ok(gBrowser.webNavigation.canGoForward, "Should be able to go forward from previous page."); } await BrowserTestUtils.removeTab(tab); });
--- a/browser/base/content/test/general/browser_keywordBookmarklets.js +++ b/browser/base/content/test/general/browser_keywordBookmarklets.js @@ -1,9 +1,9 @@ -"use strict" +"use strict"; add_task(async function test_keyword_bookmarklet() { let bm = await PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid, title: "bookmarklet", url: "javascript:'1';" }); let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); registerCleanupFunction(async function() { gBrowser.removeTab(tab); @@ -15,17 +15,17 @@ add_task(async function test_keyword_boo function getPrincipalURI() { return ContentTask.spawn(tab.linkedBrowser, null, function() { return content.document.nodePrincipal.URI.spec; }); } let originalPrincipalURI = await getPrincipalURI(); - await PlacesUtils.keywords.insert({ keyword: "bm", url: "javascript:'1';" }) + await PlacesUtils.keywords.insert({ keyword: "bm", url: "javascript:'1';" }); // Enter bookmarklet keyword in the URL bar gURLBar.value = "bm"; gURLBar.focus(); EventUtils.synthesizeKey("VK_RETURN", {}); await promisePageShow();
--- a/browser/base/content/test/general/browser_new_http_window_opened_from_file_tab.js +++ b/browser/base/content/test/general/browser_new_http_window_opened_from_file_tab.js @@ -29,26 +29,26 @@ add_task(async function() { content.open(uri, "_blank"); }); let win = await promiseNewWindow; registerCleanupFunction(async function() { await BrowserTestUtils.closeWindow(win); }); ok(win, "Check that an http window loaded when using window.open."); ok(win.menubar.visible, - "Check that the menu bar on the new window is visible.") + "Check that the menu bar on the new window is visible."); ok(win.toolbar.visible, - "Check that the tool bar on the new window is visible.") + "Check that the tool bar on the new window is visible."); // Open new http window from a link in file:// page and check that we get a // new window with the correct page and features. promiseNewWindow = BrowserTestUtils.waitForNewWindow(true, TEST_HTTP); await BrowserTestUtils.synthesizeMouseAtCenter("#linkToExample", {}, browser); let win2 = await promiseNewWindow; registerCleanupFunction(async function() { await BrowserTestUtils.closeWindow(win2); }); ok(win2, "Check that an http window loaded when using link."); ok(win2.menubar.visible, - "Check that the menu bar on the new window is visible.") + "Check that the menu bar on the new window is visible."); ok(win2.toolbar.visible, - "Check that the tool bar on the new window is visible.") + "Check that the tool bar on the new window is visible."); });
--- a/browser/base/content/test/general/browser_offlineQuotaNotification.js +++ b/browser/base/content/test/general/browser_offlineQuotaNotification.js @@ -64,17 +64,17 @@ function test() { ok(notification, "have offline-app-usage notification"); // select the default action - this should cause the preferences // tab to open - which we track via an "Initialized" event. PopupNotifications.panel.firstElementChild.button.click(); let newTabBrowser = gBrowser.getBrowserForTab(gBrowser.selectedTab); newTabBrowser.addEventListener("Initialized", function() { executeSoon(function() { checkInContentPreferences(newTabBrowser.contentWindow); - }) + }); }, {capture: true, once: true}); }); onCachedAttached.then(function() { Services.prefs.setIntPref("offline-apps.quota.warn", 1); // Click the notification panel's "Allow" button. This should kick // off updates which will call our oncached handler above. PopupNotifications.panel.firstElementChild.button.click();
--- a/browser/base/content/test/general/browser_page_style_menu.js +++ b/browser/base/content/test/general/browser_page_style_menu.js @@ -14,17 +14,17 @@ function promiseStylesheetsUpdated(brows return ContentTask.spawn(browser, { PAGE }, async function(args) { return new Promise((resolve) => { addEventListener("pageshow", function onPageShow(e) { if (e.target.location == args.PAGE) { removeEventListener("pageshow", onPageShow); content.setTimeout(resolve, 0); } }); - }) + }); }); } const PAGE = "http://example.com/browser/browser/base/content/test/general/page_style_sample.html"; /* * Test that the right stylesheets do (and others don't) show up * in the page style menu.
--- a/browser/base/content/test/general/browser_page_style_menu_update.js +++ b/browser/base/content/test/general/browser_page_style_menu_update.js @@ -16,17 +16,17 @@ function promiseStylesheetsUpdated(brows return ContentTask.spawn(browser, { PAGE }, async function(args) { return new Promise((resolve) => { addEventListener("pageshow", function onPageShow(e) { if (e.target.location == args.PAGE) { removeEventListener("pageshow", onPageShow); content.setTimeout(resolve, 0); } }); - }) + }); }); } /** * Tests that the Page Style menu shows the currently * selected Page Style after a new one has been selected. */ add_task(async function() {
--- a/browser/base/content/test/general/browser_refreshBlocker.js +++ b/browser/base/content/test/general/browser_refreshBlocker.js @@ -1,12 +1,12 @@ "use strict"; -const META_PAGE = "http://example.org/browser/browser/base/content/test/general/refresh_meta.sjs" -const HEADER_PAGE = "http://example.org/browser/browser/base/content/test/general/refresh_header.sjs" +const META_PAGE = "http://example.org/browser/browser/base/content/test/general/refresh_meta.sjs"; +const HEADER_PAGE = "http://example.org/browser/browser/base/content/test/general/refresh_header.sjs"; const TARGET_PAGE = "http://example.org/browser/browser/base/content/test/general/dummy_page.html"; const PREF = "accessibility.blockautorefresh"; /** * Goes into the content, and simulates a meta-refresh header at a very * low level, and checks to see if it was blocked. This will always cancel * the refresh, regardless of whether or not the refresh was blocked. *
--- a/browser/base/content/test/general/browser_remoteTroubleshoot.js +++ b/browser/base/content/test/general/browser_remoteTroubleshoot.js @@ -1,15 +1,15 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var {WebChannel} = Cu.import("resource://gre/modules/WebChannel.jsm", {}); -const TEST_URL_TAIL = "example.com/browser/browser/base/content/test/general/test_remoteTroubleshoot.html" +const TEST_URL_TAIL = "example.com/browser/browser/base/content/test/general/test_remoteTroubleshoot.html"; const TEST_URI_GOOD = Services.io.newURI("https://" + TEST_URL_TAIL); const TEST_URI_BAD = Services.io.newURI("http://" + TEST_URL_TAIL); const TEST_URI_GOOD_OBJECT = Services.io.newURI("https://" + TEST_URL_TAIL + "?object"); // Creates a one-shot web-channel for the test data to be sent back from the test page. function promiseChannelResponse(channelID, originOrPermission) { return new Promise((resolve, reject) => { let channel = new WebChannel(channelID, originOrPermission);
--- a/browser/base/content/test/general/browser_sanitize-timespans.js +++ b/browser/base/content/test/general/browser_sanitize-timespans.js @@ -54,17 +54,17 @@ function countEntries(name, message, che var obj = {}; if (name !== null) obj.fieldname = name; let count; FormHistory.count(obj, { handleResult: result => count = result, handleError(error) { - reject(error) + reject(error); throw new Error("Error occurred searching form history: " + error); }, handleCompletion(reason) { if (!reason) { check(count, message); resolve(); } }, @@ -122,18 +122,18 @@ async function onHistoryReady() { "Pretend visit to 4hour10minutes.com should should still exist"); if (minutesSinceMidnight > 10) { ok((await promiseIsURIVisited(makeURI("http://today.com"))), "Pretend visit to today.com should still exist"); } ok((await promiseIsURIVisited(makeURI("http://before-today.com"))), "Pretend visit to before-today.com should still exist"); - let checkZero = function(num, message) { is(num, 0, message); } - let checkOne = function(num, message) { is(num, 1, message); } + let checkZero = function(num, message) { is(num, 0, message); }; + let checkOne = function(num, message) { is(num, 1, message); }; await countEntries("10minutes", "10minutes form entry should be deleted", checkZero); await countEntries("1hour", "1hour form entry should still exist", checkOne); await countEntries("1hour10minutes", "1hour10minutes form entry should still exist", checkOne); await countEntries("2hour", "2hour form entry should still exist", checkOne); await countEntries("2hour10minutes", "2hour10minutes form entry should still exist", checkOne); await countEntries("4hour", "4hour form entry should still exist", checkOne); await countEntries("4hour10minutes", "4hour10minutes form entry should still exist", checkOne); @@ -595,17 +595,17 @@ async function setupFormHistory() { let lastYear = new Date(); lastYear.setFullYear(lastYear.getFullYear() - 1); timestamp = lastYear.getTime() * 1000; results = await searchEntries(["guid"], { fieldname: "b4today" }); await update({ op: "update", firstUsed: timestamp, guid: results[0].guid }); var checks = 0; - let checkOne = function(num, message) { is(num, 1, message); checks++; } + let checkOne = function(num, message) { is(num, 1, message); checks++; }; // Sanity check. await countEntries("10minutes", "Checking for 10minutes form history entry creation", checkOne); await countEntries("1hour", "Checking for 1hour form history entry creation", checkOne); await countEntries("1hour10minutes", "Checking for 1hour10minutes form history entry creation", checkOne); await countEntries("2hour", "Checking for 2hour form history entry creation", checkOne); await countEntries("2hour10minutes", "Checking for 2hour10minutes form history entry creation", checkOne); await countEntries("4hour", "Checking for 4hour form history entry creation", checkOne);
--- a/browser/base/content/test/general/browser_sanitizeDialog.js +++ b/browser/base/content/test/general/browser_sanitizeDialog.js @@ -393,17 +393,17 @@ add_task(async function test_no_formdata var cb = this.win.document.querySelectorAll( "#itemList > [preference='privacy.cpd.history']"); ok(cb.length == 1 && !cb[0].disabled && cb[0].checked, "There is no history, but history checkbox should always be enabled " + "and will be checked from previous preference."); this.acceptDialog(); - } + }; wh.open(); await wh.promiseClosed; await promiseSanitized; }); add_task(async function test_form_entries() { let formEntry = (await promiseAddFormEntryWithMinutesAgo(10)); @@ -635,17 +635,17 @@ var now_uSec = now_mSec * 1000; * This wraps the dialog and provides some convenience methods for interacting * with it. * * @param aWin * The dialog's nsIDOMWindow */ function WindowHelper(aWin) { this.win = aWin; - this.promiseClosed = new Promise(resolve => { this._resolveClosed = resolve }); + this.promiseClosed = new Promise(resolve => { this._resolveClosed = resolve; }); } WindowHelper.prototype = { /** * "Presses" the dialog's OK button. */ acceptDialog() { is(this.win.document.documentElement.getButton("accept").disabled, false, @@ -676,17 +676,17 @@ WindowHelper.prototype = { "Details should be " + (aShouldBeShown ? "shown" : "hidden") + " but were actually " + (hidden ? "hidden" : "shown")); let dir = hidden ? "down" : "up"; is(button.className, "expander-" + dir, "Details button should be " + dir + " because item list is " + (hidden ? "" : "not ") + "hidden"); let height = 0; if (!hidden) { - ok(list.boxObject.height > 30, "listbox has sufficient size") + ok(list.boxObject.height > 30, "listbox has sufficient size"); height += list.boxObject.height; } if (this.isWarningPanelVisible()) height += this.getWarningPanel().boxObject.height; ok(height < this.win.innerHeight, "Window should be tall enough to fit warning panel and item list"); }, @@ -897,17 +897,17 @@ function promiseAddFormEntryWithMinutesA { handleError(error) { reject(); throw new Error("Error occurred updating form history: " + error); }, handleCompletion(reason) { resolve(name); } }) - ) + ); } /** * Checks if a form entry exists. */ function formNameExists(name) { return new Promise((resolve, reject) => { let count = 0;
--- a/browser/base/content/test/general/browser_save_link-perwindowpb.js +++ b/browser/base/content/test/general/browser_save_link-perwindowpb.js @@ -48,17 +48,17 @@ function triggerSave(aWindow, aCallback) mockTransferCallback = function(downloadSuccess) { info("mockTransferCallback"); onTransferComplete(aWindow, downloadSuccess, destDir); destDir.remove(true); ok(!destDir.exists(), "Destination dir should be removed"); ok(!destFile.exists(), "Destination file should be removed"); mockTransferCallback = null; info("done mockTransferCallback"); - } + }; // Select "Save Link As" option from context menu var saveLinkCommand = aWindow.document.getElementById("context-savelink"); info("saveLinkCommand: " + saveLinkCommand); saveLinkCommand.doCommand(); event.target.hidePopup(); info("popup hidden");
--- a/browser/base/content/test/general/browser_save_link_when_window_navigates.js +++ b/browser/base/content/test/general/browser_save_link_when_window_navigates.js @@ -53,17 +53,17 @@ function triggerSave(aWindow, aCallback) mockTransferCallback = function(downloadSuccess) { info("mockTransferCallback"); onTransferComplete(aWindow, downloadSuccess, destDir); destDir.remove(true); ok(!destDir.exists(), "Destination dir should be removed"); ok(!destFile.exists(), "Destination file should be removed"); mockTransferCallback = null; info("done mockTransferCallback"); - } + }; function onUCTDialog(dialog) { function doLoad() { content.document.querySelector("iframe").remove(); } testBrowser.messageManager.loadFrameScript("data:,(" + doLoad.toString() + ")()", false); executeSoon(continueDownloading); }
--- a/browser/base/content/test/general/browser_save_video_frame.js +++ b/browser/base/content/test/general/browser_save_video_frame.js @@ -33,17 +33,17 @@ function createTemporarySaveDirectory() * allows us to define a callback to be called once the mock file * selector has selected where to save the file. */ function waitForTransferComplete() { return new Promise((resolve) => { mockTransferCallback = () => { ok(true, "Transfer completed"); resolve(); - } + }; }); } /** * Given some browser, loads a framescript that right-clicks * on the video1 element to spawn a contextmenu. */ function rightClickVideo(browser) { @@ -110,17 +110,17 @@ add_task(async function() { info("Synthesizing right-click on video element"); rightClickVideo(browser); info("Waiting for popup to fire popupshown."); await popupPromise; info("Popup fired popupshown"); let saveSnapshotCommand = document.getElementById("context-video-saveimage"); - let promiseTransfer = waitForTransferComplete() + let promiseTransfer = waitForTransferComplete(); info("Firing save snapshot command"); saveSnapshotCommand.doCommand(); context.hidePopup(); info("Waiting for transfer completion"); await promiseTransfer; info("Transfer complete"); gBrowser.removeTab(tab); });
--- a/browser/base/content/test/general/browser_tab_dragdrop.js +++ b/browser/base/content/test/general/browser_tab_dragdrop.js @@ -1,17 +1,17 @@ function swapTabsAndCloseOther(a, b) { gBrowser.swapBrowsersAndCloseOther(gBrowser.tabs[b], gBrowser.tabs[a]); } var getClicks = function(tab) { return ContentTask.spawn(tab.linkedBrowser, {}, function() { return content.wrappedJSObject.clicks; }); -} +}; var clickTest = async function(tab) { let clicks = await getClicks(tab); await ContentTask.spawn(tab.linkedBrowser, {}, function() { let target = content.document.body; let rect = target.getBoundingClientRect(); let left = (rect.left + rect.right) / 2; @@ -61,28 +61,28 @@ async function cacheObjectValue(browser) addMessageListener("Test:CheckObjectValue", win.checkObjectValueListener); }); } // Note, can't run this via registerCleanupFunction because it needs the // browser to still be alive and have a messageManager. async function cleanupObjectValue(browser) { - info("entered cleanupObjectValue") + info("entered cleanupObjectValue"); await ContentTask.spawn(browser, null, async function() { info("in cleanup function"); let win = content.document.defaultView; info(`about to delete objectValue: ${win.objectValue}`); delete win.objectValue; removeMessageListener("Test:CheckObjectValue", win.checkObjectValueListener); info(`about to delete checkObjectValueListener: ${win.checkObjectValueListener}`); delete win.checkObjectValueListener; info(`deleted objectValue (${win.objectValue}) and checkObjectValueListener (${win.checkObjectValueListener})`); }); - info("exiting cleanupObjectValue") + info("exiting cleanupObjectValue"); } // See the notes for cacheObjectValue above. function checkObjectValue(browser) { let mm = browser.messageManager; return new Promise((resolve, reject) => { let listener = ({ data }) => { @@ -120,19 +120,19 @@ add_task(async function() { await BrowserTestUtils.switchTab(gBrowser, tabs[3]); swapTabsAndCloseOther(2, 3); // now: 0 1 2 4 is(gBrowser.tabs[1], tabs[1], "tab1"); is(gBrowser.tabs[2], tabs[3], "tab3"); is(gBrowser.tabs[3], tabs[4], "tab4"); delete tabs[2]; - info("about to cacheObjectValue") + info("about to cacheObjectValue"); await cacheObjectValue(tabs[4].linkedBrowser); - info("just finished cacheObjectValue") + info("just finished cacheObjectValue"); swapTabsAndCloseOther(3, 2); // now: 0 1 4 is(Array.prototype.indexOf.call(gBrowser.tabs, gBrowser.selectedTab), 2, "The third tab should be selected"); delete tabs[4]; ok((await checkObjectValue(gBrowser.tabs[2].linkedBrowser)), "same plugin instance");
--- a/browser/base/content/test/general/browser_tabfocus.js +++ b/browser/base/content/test/general/browser_tabfocus.js @@ -21,17 +21,17 @@ EventStore.prototype = { if (event.indexOf("1") > -1) { this.window1.push(event); } else if (event.indexOf("2") > -1) { this.window2.push(event); } else { this["main-window"].push(event); } } -} +}; var tab1 = null; var tab2 = null; var browser1 = null; var browser2 = null; var _lastfocus; var _lastfocuswindow = null; var actualEvents = new EventStore(); @@ -460,18 +460,18 @@ function compareFocusResults() { currentPromiseResolver(); currentPromiseResolver = null; }); } async function expectFocusShiftAfterTabSwitch(tab, expectedWindow, expectedElement, focusChanged, testid) { let tabSwitchPromise = null; - await expectFocusShift(() => { tabSwitchPromise = BrowserTestUtils.switchTab(gBrowser, tab) }, - expectedWindow, expectedElement, focusChanged, testid) + await expectFocusShift(() => { tabSwitchPromise = BrowserTestUtils.switchTab(gBrowser, tab); }, + expectedWindow, expectedElement, focusChanged, testid); await tabSwitchPromise; } function expectFocusShift(callback, expectedWindow, expectedElement, focusChanged, testid) { currentPromiseResolver = null; currentTestName = testid; expectedEvents = new EventStore();
--- a/browser/base/content/test/general/browser_unknownContentType_title.js +++ b/browser/base/content/test/general/browser_unknownContentType_title.js @@ -5,29 +5,29 @@ function waitForNewWindow() { return new Promise(resolve => { let listener = (win) => { Services.obs.removeObserver(listener, "toplevel-window-ready"); win.addEventListener("load", () => { resolve(win); }); }; - Services.obs.addObserver(listener, "toplevel-window-ready") + Services.obs.addObserver(listener, "toplevel-window-ready"); }); } add_task(async function() { let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, url); let browser = tab.linkedBrowser; await promiseTabLoaded(gBrowser.selectedTab); - is(gBrowser.contentTitle, "Test Page", "Should have the right title.") + is(gBrowser.contentTitle, "Test Page", "Should have the right title."); browser.loadURI(unknown_url); let win = await waitForNewWindow(); is(win.location, "chrome://mozapps/content/downloads/unknownContentType.xul", "Should have seen the unknown content dialog."); - is(gBrowser.contentTitle, "Test Page", "Should still have the right title.") + is(gBrowser.contentTitle, "Test Page", "Should still have the right title."); win.close(); await promiseWaitForFocus(window); gBrowser.removeCurrentTab(); });
--- a/browser/base/content/test/general/browser_utilityOverlay.js +++ b/browser/base/content/test/general/browser_utilityOverlay.js @@ -14,30 +14,30 @@ function test() { waitForExplicitFinish(); executeSoon(runNextTest); } function runNextTest() { if (gTests.length) { let testFun = gTests.shift(); info("Running " + testFun.name); - testFun() + testFun(); } else { finish(); } } function test_eventMatchesKey() { let eventMatchResult; let key; let checkEvent = function(e) { e.stopPropagation(); e.preventDefault(); eventMatchResult = eventMatchesKey(e, key); - } + }; document.addEventListener("keypress", checkEvent); try { key = document.createElement("key"); let keyset = document.getElementById("mainKeyset"); key.setAttribute("key", "t"); key.setAttribute("modifiers", "accel"); keyset.appendChild(key);
--- a/browser/base/content/test/general/browser_visibleTabs_bookmarkAllPages.js +++ b/browser/base/content/test/general/browser_visibleTabs_bookmarkAllPages.js @@ -24,11 +24,11 @@ function test() { gBrowser.removeTab(tabOne); gBrowser.removeTab(tabTwo); Array.forEach(gBrowser.tabs, function(tab) { gBrowser.showTab(tab); }); finish(); - } + }; browser.addEventListener("load", onLoad, true); }
--- a/browser/base/content/test/general/browser_web_channel.js +++ b/browser/base/content/test/general/browser_web_channel.js @@ -206,17 +206,17 @@ var gTests = [ // an unsolicted message is sent from Chrome->Content which is then // echoed back. If the echo is received here, then the content // received the message. let messagePromise = new Promise(function(resolve, reject) { channel.listen(function(id, message, sender) { is(id, "echo"); is(message.command, "unsolicited"); - resolve() + resolve(); }); }); await BrowserTestUtils.withNewTab({ gBrowser, url: HTTP_PATH + HTTP_ENDPOINT + "?unsolicited" }, async function(targetBrowser) { channel.send({ command: "unsolicited" }, { @@ -391,17 +391,17 @@ var gTests = [ is(id, "objects"); if (message.type === "object") { ok(!sawObject); sawObject = true; } else if (message.type === "string") { ok(!sawString); sawString = true; } else { - reject(new Error(`Unknown message type: ${message.type}`)) + reject(new Error(`Unknown message type: ${message.type}`)); } if (sawObject && sawString) { resolve(); } }); }); const webchannelWhitelistPref = "webchannel.allowObject.urlWhitelist"; let origWhitelist = Services.prefs.getCharPref(webchannelWhitelistPref);
--- a/browser/base/content/test/general/contentSearchUI.js +++ b/browser/base/content/test/general/contentSearchUI.js @@ -90,17 +90,17 @@ var messageHandlers = { let allElts = [...gController._suggestionsList.children, ...gController._oneOffButtons, content.document.getElementById("contentSearchSettingsButton")]; row = allElts[itemIndex]; } let event = { type: "mousemove", clickcount: 0, - } + }; row.addEventListener("mousemove", function() { ack("mousemove"); }, {once: true}); content.synthesizeMouseAtCenter(row, event); }, click(arg) { let eltIdx = typeof(arg) == "object" ? arg.eltIdx : arg;
--- a/browser/base/content/test/general/gZipOfflineChild_uncompressed.html +++ b/browser/base/content/test/general/gZipOfflineChild_uncompressed.html @@ -3,19 +3,19 @@ <!-- This file is gzipped to create gZipOfflineChild.html --> <title></title> <script type="text/javascript"> function finish(success) { window.parent.postMessage(success, "*"); } -applicationCache.oncached = function() { finish("oncache"); } -applicationCache.onnoupdate = function() { finish("onupdate"); } -applicationCache.onerror = function() { finish("onerror"); } +applicationCache.oncached = function() { finish("oncache"); }; +applicationCache.onnoupdate = function() { finish("onupdate"); }; +applicationCache.onerror = function() { finish("onerror"); }; </script> </head> <body> <h1>Child</h1> </body> </html>
--- a/browser/base/content/test/general/head.js +++ b/browser/base/content/test/general/head.js @@ -79,17 +79,17 @@ function updateTabContextMenu(tab, onOpe function openToolbarCustomizationUI(aCallback, aBrowserWin) { if (!aBrowserWin) aBrowserWin = window; aBrowserWin.gCustomizeMode.enter(); aBrowserWin.gNavToolbox.addEventListener("customizationready", function() { executeSoon(function() { - aCallback(aBrowserWin) + aCallback(aBrowserWin); }); }, {once: true}); } function closeToolbarCustomizationUI(aCallback, aBrowserWin) { aBrowserWin.gNavToolbox.addEventListener("aftercustomization", function() { executeSoon(aCallback); }, {once: true});
--- a/browser/base/content/test/general/offlineByDefault.js +++ b/browser/base/content/test/general/offlineByDefault.js @@ -3,11 +3,11 @@ var offlineByDefault = { prefBranch: SpecialPowers.Cc["@mozilla.org/preferences-service;1"].getService(SpecialPowers.Ci.nsIPrefBranch), set(allow) { this.defaultValue = this.prefBranch.getBoolPref("offline-apps.allow_by_default", false); this.prefBranch.setBoolPref("offline-apps.allow_by_default", allow); }, reset() { this.prefBranch.setBoolPref("offline-apps.allow_by_default", this.defaultValue); } -} +}; offlineByDefault.set(false);
--- a/browser/base/content/test/general/offlineChild.html +++ b/browser/base/content/test/general/offlineChild.html @@ -2,19 +2,19 @@ <head> <title></title> <script type="text/javascript"> function finish(success) { window.parent.postMessage(success ? "success" : "failure", "*"); } -applicationCache.oncached = function() { finish(true); } -applicationCache.onnoupdate = function() { finish(true); } -applicationCache.onerror = function() { finish(false); } +applicationCache.oncached = function() { finish(true); }; +applicationCache.onnoupdate = function() { finish(true); }; +applicationCache.onerror = function() { finish(false); }; </script> </head> <body> <h1>Child</h1> </body> </html>
--- a/browser/base/content/test/general/offlineChild2.html +++ b/browser/base/content/test/general/offlineChild2.html @@ -2,19 +2,19 @@ <head> <title></title> <script type="text/javascript"> function finish(success) { window.parent.postMessage(success ? "success" : "failure", "*"); } -applicationCache.oncached = function() { finish(true); } -applicationCache.onnoupdate = function() { finish(true); } -applicationCache.onerror = function() { finish(false); } +applicationCache.oncached = function() { finish(true); }; +applicationCache.onnoupdate = function() { finish(true); }; +applicationCache.onerror = function() { finish(false); }; </script> </head> <body> <h1>Child</h1> </body> </html>
--- a/browser/base/content/test/general/test_remoteTroubleshoot.html +++ b/browser/base/content/test/general/test_remoteTroubleshoot.html @@ -3,17 +3,17 @@ <script> // This test is run multiple times, once with only strings allowed through the // WebChannel, and once with objects allowed. This function allows us to handle // both cases without too much pain. function makeDetails(object) { if (window.location.search.indexOf("object") >= 0) { return object; } - return JSON.stringify(object) + return JSON.stringify(object); } // Add a listener for responses to our remote requests. window.addEventListener("WebChannelMessageToContent", function(event) { if (event.detail.id == "remote-troubleshooting") { // Send what we got back to the test. var backEvent = new window.CustomEvent("WebChannelMessageToChrome", { detail: makeDetails({ id: "test-remote-troubleshooting-backchannel", @@ -35,16 +35,16 @@ window.onload = function() { detail: makeDetails({ id: "remote-troubleshooting", message: { command: "request", }, }), }); window.dispatchEvent(event); -} +}; </script> <body> <pre id="troubleshooting"/> </body> </html>
--- a/browser/base/content/test/newtab/browser_newtab_drop_preview.js +++ b/browser/base/content/test/newtab/browser_newtab_drop_preview.js @@ -30,12 +30,12 @@ add_task(async function() { if (pinned != aSite.node.hasAttribute("pinned")) { Assert.ok(false, "invalid state (site.isPinned() != site[pinned])"); } return aSite.url.replace(/^http:\/\/example(\d+)\.com\/$/, "$1") + (pinned ? "p" : ""); }); }); - let expectedSites = "3,1p,2p,4,0p,5p,6,7,8" + let expectedSites = "3,1p,2p,4,0p,5p,6,7,8"; is(foundSites, expectedSites, "grid status = " + expectedSites); });
--- a/browser/base/content/test/newtab/browser_newtab_perwindow_private_browsing.js +++ b/browser/base/content/test/newtab/browser_newtab_perwindow_private_browsing.js @@ -30,17 +30,17 @@ add_task(async function() { await unpinCell(0); await checkGrid("0,2,3,4,5,6,7,8"); // open normal window await testOnWindow(undefined); // check that the grid is the same as before entering pb mode await addNewTabPageTab(); - await checkGrid("0,2,3,4,5,6,7,8") + await checkGrid("0,2,3,4,5,6,7,8"); }); var windowsToClose = []; async function testOnWindow(options) { let newWindowPromise = BrowserTestUtils.waitForNewWindow(); var win = OpenBrowserWindow(options); windowsToClose.push(win); gWindow = win;
--- a/browser/base/content/test/newtab/browser_newtab_update.js +++ b/browser/base/content/test/newtab/browser_newtab_update.js @@ -28,17 +28,17 @@ add_task(async function() { await addNewTabPageTab(); await checkGrid("1,2,,,,,,,"); await fillHistoryAndWaitForPageUpdate([2, 3, 4]); await addNewTabPageTab(); await checkGrid("2,1,3,4,,,,,"); // Make sure these added links have the right type - let type = await performOnCell(1, cell => { return cell.site.link.type }); + let type = await performOnCell(1, cell => { return cell.site.link.type; }); is(type, "history", "added link is history"); }); function fillHistoryAndWaitForPageUpdate(links) { let updatedPromise = whenPagesUpdated; let fillHistoryPromise = fillHistory(links.map(link)); return Promise.all([updatedPromise, fillHistoryPromise]); }
--- a/browser/base/content/test/newtab/head.js +++ b/browser/base/content/test/newtab/head.js @@ -303,17 +303,17 @@ function waitForCondition(aConditionFn, /** * Creates a new tab containing 'about:newtab'. */ async function addNewTabPageTab() { let tab = await BrowserTestUtils.openNewForegroundTab(gWindow.gBrowser, "about:newtab", false); let browser = tab.linkedBrowser; // Wait for the document to become visible in case it was preloaded. - await waitForCondition(() => !browser.contentDocument.hidden) + await waitForCondition(() => !browser.contentDocument.hidden); await new Promise(resolve => { if (NewTabUtils.allPages.enabled) { // Continue when the link cache has been populated. NewTabUtils.links.populateCache(function() { whenSearchInitDone().then(resolve); }); } else { @@ -486,17 +486,17 @@ function whenSearchInitDone() { content.addEventListener(eventName, function onEvent(event) { if (event.detail.type == "State") { content.removeEventListener(eventName, onEvent); let resolver = function() { // Wait for the search controller to receive the event, then resolve. if (content.gSearch._contentSearchController.defaultEngine) { resolve(); } - } + }; content.setTimeout(resolver, 0); } }); }); }); } /**
--- a/browser/base/content/test/performance/browser_tabstrip_overflow_underflow_reflows.js +++ b/browser/base/content/test/performance/browser_tabstrip_overflow_underflow_reflows.js @@ -41,17 +41,17 @@ add_task(async function() { await withReflowObserver(async function(dirtyFrame) { let switchDone = BrowserTestUtils.waitForEvent(window, "TabSwitchDone"); BrowserOpenTab(); await BrowserTestUtils.waitForEvent(gBrowser.selectedTab, "transitionend", false, e => e.propertyName === "max-width"); await switchDone; await BrowserTestUtils.waitForCondition(() => { - return gBrowser.tabContainer.mTabstrip.hasAttribute("scrolledtoend") + return gBrowser.tabContainer.mTabstrip.hasAttribute("scrolledtoend"); }); }, EXPECTED_OVERFLOW_REFLOWS, window); await withReflowObserver(async function() { let switchDone = BrowserTestUtils.waitForEvent(window, "TabSwitchDone"); let transitionPromise = BrowserTestUtils.waitForEvent(gBrowser.selectedTab, "transitionend", false,
--- a/browser/base/content/test/permissions/browser_canvas_fingerprinting_resistance.js +++ b/browser/base/content/test/permissions/browser_canvas_fingerprinting_resistance.js @@ -44,21 +44,21 @@ function enableResistFingerprinting() { return SpecialPowers.pushPrefEnv({ set: [ ["privacy.resistFingerprinting", true] ] }); } function promisePopupShown() { - return BrowserTestUtils.waitForEvent(PopupNotifications.panel, "popupshown") + return BrowserTestUtils.waitForEvent(PopupNotifications.panel, "popupshown"); } function promisePopupHidden() { - return BrowserTestUtils.waitForEvent(PopupNotifications.panel, "popuphidden") + return BrowserTestUtils.waitForEvent(PopupNotifications.panel, "popuphidden"); } function extractCanvasData(grantPermission) { let contentWindow = content.wrappedJSObject; let canvas = contentWindow.document.getElementById("canvas-id-canvas"); let canvasData = canvas.toDataURL(); if (grantPermission) { isnot(canvasData, contentWindow.kPlaceholderData,
--- a/browser/base/content/test/plugins/blocklist_proxy.js +++ b/browser/base/content/test/plugins/blocklist_proxy.js @@ -65,14 +65,14 @@ var BlocklistProxy = { getPluginBlocklistURL(aPluginTag) { return ""; }, getPluginInfoURL(aPluginTag) { return ""; }, -} +}; BlocklistProxy.init(); addEventListener("unload", () => { BlocklistProxy.uninit(); });
--- a/browser/base/content/test/plugins/browser_CTP_favorfallback.js +++ b/browser/base/content/test/plugins/browser_CTP_favorfallback.js @@ -76,9 +76,9 @@ add_task(async function() { for (let fallbackPlugin of fallbackPlugins) { ok(fallbackPlugin instanceof Ci.nsIObjectLoadingContent, "This is a plugin object"); is(fallbackPlugin.pluginFallbackType, Ci.nsIObjectLoadingContent.PLUGIN_ALTERNATE, "Plugin fallback content was used"); } }); await BrowserTestUtils.removeTab(tab); } -}) +});
--- a/browser/base/content/test/plugins/browser_CTP_hide_overlay.js +++ b/browser/base/content/test/plugins/browser_CTP_hide_overlay.js @@ -29,17 +29,17 @@ add_task(async function() { // Work around for delayed PluginBindingAttached await promiseUpdatePluginBindings(gBrowser.selectedBrowser); // Tests that the overlay can be hidden for plugins using the close icon. await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() { let doc = content.document; let plugin = doc.getElementById("test"); let overlay = doc.getAnonymousElementByAttribute(plugin, "anonid", "main"); - let closeIcon = doc.getAnonymousElementByAttribute(plugin, "anonid", "closeIcon") + let closeIcon = doc.getAnonymousElementByAttribute(plugin, "anonid", "closeIcon"); let bounds = closeIcon.getBoundingClientRect(); let left = (bounds.left + bounds.right) / 2; let top = (bounds.top + bounds.bottom) / 2; let utils = content.QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIDOMWindowUtils); utils.sendMouseEvent("mousedown", left, top, 0, 1, 0, false, 0, 0); utils.sendMouseEvent("mouseup", left, top, 0, 1, 0, false, 0, 0); @@ -56,17 +56,17 @@ add_task(async function() { // Work around for delayed PluginBindingAttached await promiseUpdatePluginBindings(gBrowser.selectedBrowser); await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() { let doc = content.document; let plugin = doc.getElementById("test"); let overlay = doc.getAnonymousElementByAttribute(plugin, "anonid", "main"); - let closeIcon = doc.getAnonymousElementByAttribute(plugin, "anonid", "closeIcon") + let closeIcon = doc.getAnonymousElementByAttribute(plugin, "anonid", "closeIcon"); let closeIconBounds = closeIcon.getBoundingClientRect(); let overlayBounds = overlay.getBoundingClientRect(); let overlayLeft = (overlayBounds.left + overlayBounds.right) / 2; let overlayTop = (overlayBounds.left + overlayBounds.right) / 2 ; let closeIconLeft = (closeIconBounds.left + closeIconBounds.right) / 2; let closeIconTop = (closeIconBounds.top + closeIconBounds.bottom) / 2; let utils = content.QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIDOMWindowUtils);
--- a/browser/base/content/test/plugins/browser_bug820497.js +++ b/browser/base/content/test/plugins/browser_bug820497.js @@ -18,17 +18,17 @@ add_task(async function() { Services.prefs.setBoolPref("plugins.click_to_play", true); gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); gTestBrowser = gBrowser.selectedBrowser; setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Second Test Plug-in"); - gTestBrowser.addEventListener("PluginBindingAttached", function() { gNumPluginBindingsAttached++ }, true, true); + gTestBrowser.addEventListener("PluginBindingAttached", function() { gNumPluginBindingsAttached++; }, true, true); await promiseTabLoadEvent(gBrowser.selectedTab, gTestRoot + "plugin_bug820497.html"); await promiseForCondition(function() { return gNumPluginBindingsAttached == 1; }); await ContentTask.spawn(gTestBrowser, null, () => { // Note we add the second plugin in the code farther down, so there's // no way we got here with anything but one plugin loaded.
--- a/browser/base/content/test/plugins/browser_pluginCrashCommentAndURL.js +++ b/browser/base/content/test/plugins/browser_pluginCrashCommentAndURL.js @@ -146,17 +146,17 @@ add_task(async function() { function promisePluginCrashed() { return new ContentTask.spawn(gTestBrowser, {}, async function() { await new Promise((resolve) => { addEventListener("PluginCrashReporterDisplayed", function onPluginCrashed() { removeEventListener("PluginCrashReporterDisplayed", onPluginCrashed); resolve(); }); }); - }) + }); } function onSubmitStatus(aSubject, aData) { // Wait for success or failed, doesn't matter which. if (aData != "success" && aData != "failed") return false; let propBag = aSubject.QueryInterface(Ci.nsIPropertyBag);
--- a/browser/base/content/test/plugins/browser_private_clicktoplay.js +++ b/browser/base/content/test/plugins/browser_private_clicktoplay.js @@ -65,17 +65,17 @@ add_task(async function test1b() { let promiseShown = BrowserTestUtils.waitForEvent(gPrivateWindow.PopupNotifications.panel, "Shown"); popupNotification.reshow(); await promiseShown; let button1 = gPrivateWindow.PopupNotifications.panel.firstChild._primaryButton; let button2 = gPrivateWindow.PopupNotifications.panel.firstChild._secondaryButton; is(button1.getAttribute("action"), "_singleActivateNow", "Test 1b, Blocked plugin in private window should have a activate now button"); - ok(button2.hidden, "Test 1b, Blocked plugin in a private window should not have a secondary button") + ok(button2.hidden, "Test 1b, Blocked plugin in a private window should not have a secondary button"); gPrivateWindow.close(); BrowserTestUtils.loadURI(gTestBrowser, gHttpTestRoot + "plugin_test.html"); await BrowserTestUtils.browserLoaded(gTestBrowser); }); add_task(async function test2a() { // enable test plugin on this site
--- a/browser/base/content/test/popupNotifications/browser_popupNotification_5.js +++ b/browser/base/content/test/popupNotifications/browser_popupNotification_5.js @@ -126,17 +126,17 @@ var tests = [ this.notification = showNotification(this.notifyObj); }, async onShown(popup) { this.complete = false; // Notification should persist after attempt to dismiss by clicking on the // content area. let browser = gBrowser.selectedBrowser; - await BrowserTestUtils.synthesizeMouseAtCenter("body", {}, browser) + await BrowserTestUtils.synthesizeMouseAtCenter("body", {}, browser); // Notification should be hidden after dismissal via Don't Allow. this.complete = true; triggerSecondaryCommand(popup, 0); }, onHidden(popup) { ok(this.complete, "Should have hidden the notification after clicking Not Now"); this.notification.remove();
--- a/browser/base/content/test/popupNotifications/head.js +++ b/browser/base/content/test/popupNotifications/head.js @@ -248,17 +248,17 @@ XPCOMUtils.defineLazyGetter(this, "gActi function onPopupEvent(eventName, callback, condition) { let listener = event => { if (event.target != PopupNotifications.panel || (condition && !condition())) return; PopupNotifications.panel.removeEventListener(eventName, listener); gActiveListeners.delete(listener); executeSoon(() => callback.call(PopupNotifications.panel)); - } + }; gActiveListeners.set(listener, eventName); PopupNotifications.panel.addEventListener(eventName, listener); } function waitForNotificationPanel() { return new Promise(resolve => { onPopupEvent("popupshown", function() { resolve(this);
--- a/browser/base/content/test/siteIdentity/browser_bug822367.js +++ b/browser/base/content/test/siteIdentity/browser_bug822367.js @@ -14,17 +14,17 @@ var gTestBrowser = null; add_task(async function test() { await SpecialPowers.pushPrefEnv({ set: [[ PREF_DISPLAY, true ], [ PREF_ACTIVE, true ]] }); var newTab = BrowserTestUtils.addTab(gBrowser); gBrowser.selectedTab = newTab; gTestBrowser = gBrowser.selectedBrowser; - newTab.linkedBrowser.stop() + newTab.linkedBrowser.stop(); // Mixed Script Test var url = HTTPS_TEST_ROOT + "file_bug822367_1.html"; BrowserTestUtils.loadURI(gTestBrowser, url); await BrowserTestUtils.browserLoaded(gTestBrowser, false, url); }); // Mixed Script Test
--- a/browser/base/content/test/siteIdentity/browser_identityBlock_focus.js +++ b/browser/base/content/test/siteIdentity/browser_identityBlock_focus.js @@ -11,54 +11,54 @@ function synthesizeKeyAndWaitForFocus(el return focused; } // Checks that the identity block is the next element after the urlbar // to be focused if there are no active notification anchors. add_task(async function testWithoutNotifications() { await SpecialPowers.pushPrefEnv({"set": [["accessibility.tabfocus", 7]]}); await BrowserTestUtils.withNewTab("https://example.com", async function() { - await synthesizeKeyAndWaitForFocus(gURLBar, "l", {accelKey: true}) + await synthesizeKeyAndWaitForFocus(gURLBar, "l", {accelKey: true}); is(document.activeElement, gURLBar.inputField, "urlbar should be focused"); - await synthesizeKeyAndWaitForFocus(gIdentityHandler._identityBox, "VK_TAB", {shiftKey: true}) + await synthesizeKeyAndWaitForFocus(gIdentityHandler._identityBox, "VK_TAB", {shiftKey: true}); is(document.activeElement, gIdentityHandler._identityBox, "identity block should be focused"); }); }); // Checks that when there is a notification anchor, it will receive // focus before the identity block. add_task(async function testWithoutNotifications() { await SpecialPowers.pushPrefEnv({"set": [["accessibility.tabfocus", 7]]}); await BrowserTestUtils.withNewTab(PERMISSIONS_PAGE, async function(browser) { let popupshown = BrowserTestUtils.waitForEvent(PopupNotifications.panel, "popupshown"); // Request a permission; BrowserTestUtils.synthesizeMouseAtCenter("#geo", {}, browser); await popupshown; - await synthesizeKeyAndWaitForFocus(gURLBar, "l", {accelKey: true}) + await synthesizeKeyAndWaitForFocus(gURLBar, "l", {accelKey: true}); is(document.activeElement, gURLBar.inputField, "urlbar should be focused"); let geoIcon = document.getElementById("geo-notification-icon"); - await synthesizeKeyAndWaitForFocus(geoIcon, "VK_TAB", {shiftKey: true}) + await synthesizeKeyAndWaitForFocus(geoIcon, "VK_TAB", {shiftKey: true}); is(document.activeElement, geoIcon, "notification anchor should be focused"); - await synthesizeKeyAndWaitForFocus(gIdentityHandler._identityBox, "VK_TAB", {shiftKey: true}) + await synthesizeKeyAndWaitForFocus(gIdentityHandler._identityBox, "VK_TAB", {shiftKey: true}); is(document.activeElement, gIdentityHandler._identityBox, "identity block should be focused"); }); }); // Checks that with invalid pageproxystate the identity block is ignored. add_task(async function testInvalidPageProxyState() { await SpecialPowers.pushPrefEnv({"set": [["accessibility.tabfocus", 7]]}); await BrowserTestUtils.withNewTab("about:blank", async function(browser) { // Loading about:blank will automatically focus the urlbar, which, however, can // race with the test code. So we only send the shortcut if the urlbar isn't focused yet. if (document.activeElement != gURLBar.inputField) { - await synthesizeKeyAndWaitForFocus(gURLBar, "l", {accelKey: true}) + await synthesizeKeyAndWaitForFocus(gURLBar, "l", {accelKey: true}); } is(document.activeElement, gURLBar.inputField, "urlbar should be focused"); - await synthesizeKeyAndWaitForFocus(gBrowser.getTabForBrowser(browser), "VK_TAB", {shiftKey: true}) + await synthesizeKeyAndWaitForFocus(gBrowser.getTabForBrowser(browser), "VK_TAB", {shiftKey: true}); isnot(document.activeElement, gIdentityHandler._identityBox, "identity block should not be focused"); // Restore focus to the url bar. gURLBar.focus(); }); });
--- a/browser/base/content/test/siteIdentity/browser_identity_UI.js +++ b/browser/base/content/test/siteIdentity/browser_identity_UI.js @@ -53,17 +53,17 @@ var tests = [ effectiveHost: null, isHTTPS: true }, { name: "IP address", location: "http://127.0.0.1:8888/", effectiveHost: "127.0.0.1" }, -] +]; var gCurrentTest, gCurrentTestIndex = -1, gTestDesc, gPopupHidden; // Go through the tests in both directions, to add additional coverage for // transitions between different states. var gForward = true; var gCheckETLD = false; function nextTest() { if (!gCheckETLD) {
--- a/browser/base/content/test/siteIdentity/browser_mcb_redirect.js +++ b/browser/base/content/test/siteIdentity/browser_mcb_redirect.js @@ -123,17 +123,17 @@ function test3() { info("test3"); var url = HTTPS_TEST_ROOT + "test_mcb_redirect_image.html"; BrowserTestUtils.loadURI(gTestBrowser, url); BrowserTestUtils.browserLoaded(gTestBrowser).then(checkLoadEventForTest3); } function checkLoadEventForTest3() { ContentTask.spawn(gTestBrowser, null, async function() { - var expected = "image blocked" + var expected = "image blocked"; await ContentTaskUtils.waitForCondition( () => content.document.getElementById("mctestdiv").innerHTML == expected, "OK: Expected result in innerHTML for Test3!"); }).then(test4); } // ------------------------ Test 4 ------------------------------ // HTTP page loading insecure image @@ -141,17 +141,17 @@ function test4() { info("test4"); var url = HTTP_TEST_ROOT + "test_mcb_redirect_image.html"; BrowserTestUtils.loadURI(gTestBrowser, url); BrowserTestUtils.browserLoaded(gTestBrowser).then(checkLoadEventForTest4); } function checkLoadEventForTest4() { ContentTask.spawn(gTestBrowser, null, async function() { - var expected = "image loaded" + var expected = "image loaded"; await ContentTaskUtils.waitForCondition( () => content.document.getElementById("mctestdiv").innerHTML == expected, "OK: Expected result in innerHTML for Test4!"); }).then(test5); } // ------------------------ Test 5 ------------------------------ // HTTP page laoding insecure cached image @@ -164,17 +164,17 @@ function test5() { Services.io.offline = true; var url = HTTP_TEST_ROOT + "test_mcb_redirect_image.html"; BrowserTestUtils.loadURI(gTestBrowser, url); BrowserTestUtils.browserLoaded(gTestBrowser).then(checkLoadEventForTest5); } function checkLoadEventForTest5() { ContentTask.spawn(gTestBrowser, null, async function() { - var expected = "image loaded" + var expected = "image loaded"; await ContentTaskUtils.waitForCondition( () => content.document.getElementById("mctestdiv").innerHTML == expected, "OK: Expected result in innerHTML for Test5!"); }).then(() => { // Go back online Services.io.offline = false; test6(); }); @@ -191,17 +191,17 @@ function test6() { Services.io.offline = true; var url = HTTPS_TEST_ROOT + "test_mcb_redirect_image.html"; BrowserTestUtils.loadURI(gTestBrowser, url); BrowserTestUtils.browserLoaded(gTestBrowser).then(checkLoadEventForTest6); } function checkLoadEventForTest6() { ContentTask.spawn(gTestBrowser, null, async function() { - var expected = "image blocked" + var expected = "image blocked"; await ContentTaskUtils.waitForCondition( () => content.document.getElementById("mctestdiv").innerHTML == expected, "OK: Expected result in innerHTML for Test6!"); }).then(() => { // Go back online Services.io.offline = false; test7(); }); @@ -212,17 +212,17 @@ function checkLoadEventForTest6() { function test7() { var url = HTTP_TEST_ROOT + "test_mcb_double_redirect_image.html"; BrowserTestUtils.loadURI(gTestBrowser, url); BrowserTestUtils.browserLoaded(gTestBrowser).then(checkLoadEventForTest7); } function checkLoadEventForTest7() { ContentTask.spawn(gTestBrowser, null, async function() { - var expected = "image loaded" + var expected = "image loaded"; await ContentTaskUtils.waitForCondition( () => content.document.getElementById("mctestdiv").innerHTML == expected, "OK: Expected result in innerHTML for Test7!"); }).then(test8); } // ------------------------ Test 8 ------------------------------ // HTTP page loading insecure cached image that went through a double redirect @@ -234,17 +234,17 @@ function test8() { Services.io.offline = true; var url = HTTP_TEST_ROOT + "test_mcb_double_redirect_image.html"; BrowserTestUtils.loadURI(gTestBrowser, url); BrowserTestUtils.browserLoaded(gTestBrowser).then(checkLoadEventForTest8); } function checkLoadEventForTest8() { ContentTask.spawn(gTestBrowser, null, async function() { - var expected = "image loaded" + var expected = "image loaded"; await ContentTaskUtils.waitForCondition( () => content.document.getElementById("mctestdiv").innerHTML == expected, "OK: Expected result in innerHTML for Test8!"); }).then(() => { // Go back online Services.io.offline = false; test9(); }); @@ -260,17 +260,17 @@ function test9() { Services.io.offline = true; var url = HTTPS_TEST_ROOT + "test_mcb_double_redirect_image.html"; BrowserTestUtils.loadURI(gTestBrowser, url); BrowserTestUtils.browserLoaded(gTestBrowser).then(checkLoadEventForTest9); } function checkLoadEventForTest9() { ContentTask.spawn(gTestBrowser, null, async function() { - var expected = "image blocked" + var expected = "image blocked"; await ContentTaskUtils.waitForCondition( () => content.document.getElementById("mctestdiv").innerHTML == expected, "OK: Expected result in innerHTML for Test9!"); }).then(() => { // Go back online Services.io.offline = false; cleanUpAfterTests(); });
--- a/browser/base/content/test/siteIdentity/browser_no_mcb_on_http_site.js +++ b/browser/base/content/test/siteIdentity/browser_no_mcb_on_http_site.js @@ -34,17 +34,17 @@ function cleanUpAfterTests() { gBrowser.removeCurrentTab(); window.focus(); } add_task(async function init() { await SpecialPowers.pushPrefEnv({ set: [[ PREF_ACTIVE, true ], [ PREF_DISPLAY, true ]] }); let url = HTTP_TEST_ROOT + "test_no_mcb_on_http_site_img.html"; - let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url) + let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url); gTestBrowser = tab.linkedBrowser; }); // ------------- TEST 1 ----------------------------------------- add_task(async function test1() { let expected = "Verifying MCB does not trigger warning/error for an http page "; expected += "with https css that includes http image"; @@ -82,17 +82,17 @@ add_task(async function test2() { let url = HTTP_TEST_ROOT + "test_no_mcb_on_http_site_font2.html"; BrowserTestUtils.loadURI(gTestBrowser, url); await BrowserTestUtils.browserLoaded(gTestBrowser); }); // ------------- TEST 3 ----------------------------------------- add_task(async function test3() { - let expected = "Verifying MCB does not trigger warning/error for an http page " + let expected = "Verifying MCB does not trigger warning/error for an http page "; expected += "with https css that imports another http css which includes http font"; await ContentTask.spawn(gTestBrowser, expected, async function(condition) { await ContentTaskUtils.waitForCondition( () => content.document.getElementById("testDiv").innerHTML == condition, "Waited too long for status in Test 3!"); });
--- a/browser/base/content/test/static/browser_all_files_referenced.js +++ b/browser/base/content/test/static/browser_all_files_referenced.js @@ -340,17 +340,17 @@ function parseCodeFile(fileUri) { if (match && match[1]) { let path = match[1]; for (let rule of rules) { if (path.startsWith(rule[0] + "/")) { path = path.replace(rule[0], rule[1]); if (!/\.(properties|js|jsm|json|css)$/.test(path)) path += ".js"; gReferencesFromCode.add(path); - break + break; } } } match = line.match(/require\(['"](\.[^'"]+)['"]\)/); if (match && match[1]) { let url = match[1]; url = Services.io.newURI(url, null, baseUri || fileUri).spec; @@ -574,22 +574,22 @@ add_task(async function checkAllTheFiles } unreferencedFiles = unreferencedFiles.filter(file => { // resource://app/features/ will only contain .xpi files when the test runs // on a packaged build, so the following two exceptions only matter when // running the test on a local non-packaged build. if (/resource:\/\/app\/features\/[^/]+\/bootstrap\.js/.test(file)) { - info("not reporting feature boostrap file: " + file) + info("not reporting feature boostrap file: " + file); return false; } // Bug 1351892 - can stop shipping these? if (/resource:\/\/app\/features\/[^/]+\/chrome\/skin\//.test(file)) { - info("not reporting feature skin file that may be for another platform: " + file) + info("not reporting feature skin file that may be for another platform: " + file); return false; } return true; }); is(unreferencedFiles.length, 0, "there should be no unreferenced files"); for (let file of unreferencedFiles) { ok(false, "unreferenced file: " + file);