зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1146136 - Fix most in-tree tests that parenthesize destructuring pattern assignment targets, as ES6 forbids such parenthesization. (The patch making SpiderMonkey reject this syntax will follow shortly.) r=efaust, r=testingonlychange
This commit is contained in:
Родитель
e94846adea
Коммит
8ebc2cc372
|
@ -12,7 +12,7 @@ add_task(function*() {
|
||||||
let {inspector, panel} = yield openAnimationInspector();
|
let {inspector, panel} = yield openAnimationInspector();
|
||||||
yield testEmptyPanel(inspector, panel);
|
yield testEmptyPanel(inspector, panel);
|
||||||
|
|
||||||
({inspector, panel}) = yield closeAnimationInspectorAndRestartWithNewUI();
|
({inspector, panel} = yield closeAnimationInspectorAndRestartWithNewUI());
|
||||||
yield testEmptyPanel(inspector, panel, true);
|
yield testEmptyPanel(inspector, panel, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ add_task(function*() {
|
||||||
ok(panel, "The animation panel exists");
|
ok(panel, "The animation panel exists");
|
||||||
ok(panel.playersEl, "The animation panel has been initialized");
|
ok(panel.playersEl, "The animation panel has been initialized");
|
||||||
|
|
||||||
({panel, controller}) = yield closeAnimationInspectorAndRestartWithNewUI();
|
({panel, controller} = yield closeAnimationInspectorAndRestartWithNewUI());
|
||||||
|
|
||||||
ok(controller, "The animation controller exists");
|
ok(controller, "The animation controller exists");
|
||||||
ok(controller.animationsFront, "The animation controller has been initialized");
|
ok(controller.animationsFront, "The animation controller has been initialized");
|
||||||
|
|
|
@ -14,7 +14,7 @@ add_task(function*() {
|
||||||
is(panel.playerWidgets.length, 1,
|
is(panel.playerWidgets.length, 1,
|
||||||
"One animation player is displayed after init");
|
"One animation player is displayed after init");
|
||||||
|
|
||||||
({panel}) = yield closeAnimationInspectorAndRestartWithNewUI();
|
({panel} = yield closeAnimationInspectorAndRestartWithNewUI());
|
||||||
is(panel.animationsTimelineComponent.animations.length, 1,
|
is(panel.animationsTimelineComponent.animations.length, 1,
|
||||||
"One animation is handled by the timeline after init");
|
"One animation is handled by the timeline after init");
|
||||||
is(panel.animationsTimelineComponent.animationsEl.childNodes.length, 1,
|
is(panel.animationsTimelineComponent.animationsEl.childNodes.length, 1,
|
||||||
|
|
|
@ -31,7 +31,7 @@ add_task(function*() {
|
||||||
"The icon to select the target element in the inspector exists");
|
"The icon to select the target element in the inspector exists");
|
||||||
|
|
||||||
info("Test again with the new timeline UI");
|
info("Test again with the new timeline UI");
|
||||||
({inspector, panel}) = yield closeAnimationInspectorAndRestartWithNewUI();
|
({inspector, panel} = yield closeAnimationInspectorAndRestartWithNewUI());
|
||||||
|
|
||||||
info("Select the simple animated node");
|
info("Select the simple animated node");
|
||||||
yield selectNode(".animated", inspector);
|
yield selectNode(".animated", inspector);
|
||||||
|
|
|
@ -12,7 +12,7 @@ add_task(function*() {
|
||||||
let {inspector, panel} = yield openAnimationInspector();
|
let {inspector, panel} = yield openAnimationInspector();
|
||||||
yield testRefreshOnNewAnimation(inspector, panel);
|
yield testRefreshOnNewAnimation(inspector, panel);
|
||||||
|
|
||||||
({inspector, panel}) = yield closeAnimationInspectorAndRestartWithNewUI();
|
({inspector, panel} = yield closeAnimationInspectorAndRestartWithNewUI());
|
||||||
yield testRefreshOnNewAnimation(inspector, panel);
|
yield testRefreshOnNewAnimation(inspector, panel);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ add_task(function*() {
|
||||||
yield testAddedAnimationWorks(inspector, panel);
|
yield testAddedAnimationWorks(inspector, panel);
|
||||||
|
|
||||||
info("Reload and test again with the new UI");
|
info("Reload and test again with the new UI");
|
||||||
({inspector, panel}) = yield closeAnimationInspectorAndRestartWithNewUI(true);
|
({inspector, panel} = yield closeAnimationInspectorAndRestartWithNewUI(true));
|
||||||
yield testRefreshOnRemove(inspector, panel, true);
|
yield testRefreshOnRemove(inspector, panel, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ add_task(function*() {
|
||||||
let {inspector, panel} = yield openAnimationInspector();
|
let {inspector, panel} = yield openAnimationInspector();
|
||||||
yield testRefresh(inspector, panel);
|
yield testRefresh(inspector, panel);
|
||||||
|
|
||||||
({inspector, panel}) = yield closeAnimationInspectorAndRestartWithNewUI();
|
({inspector, panel} = yield closeAnimationInspectorAndRestartWithNewUI());
|
||||||
yield testRefresh(inspector, panel);
|
yield testRefresh(inspector, panel);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ add_task(function*() {
|
||||||
|
|
||||||
info("Test again with the new UI, making sure the same number of " +
|
info("Test again with the new UI, making sure the same number of " +
|
||||||
"animation timelines is created");
|
"animation timelines is created");
|
||||||
({inspector, panel, controller}) = yield closeAnimationInspectorAndRestartWithNewUI();
|
({inspector, panel, controller} = yield closeAnimationInspectorAndRestartWithNewUI());
|
||||||
let timeline = panel.animationsTimelineComponent;
|
let timeline = panel.animationsTimelineComponent;
|
||||||
|
|
||||||
info("Selecting the test animated node again");
|
info("Selecting the test animated node again");
|
||||||
|
|
|
@ -13,7 +13,7 @@ add_task(function*() {
|
||||||
let {inspector, panel} = yield openAnimationInspector();
|
let {inspector, panel} = yield openAnimationInspector();
|
||||||
yield testShowsAnimations(inspector, panel);
|
yield testShowsAnimations(inspector, panel);
|
||||||
|
|
||||||
({inspector, panel}) = yield closeAnimationInspectorAndRestartWithNewUI();
|
({inspector, panel} = yield closeAnimationInspectorAndRestartWithNewUI());
|
||||||
yield testShowsAnimations(inspector, panel);
|
yield testShowsAnimations(inspector, panel);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -73,13 +73,13 @@ const TEST_DATA = [
|
||||||
let {d} = yield getHighlighterRegionPath("margin", toolbox.highlighter);
|
let {d} = yield getHighlighterRegionPath("margin", toolbox.highlighter);
|
||||||
ok(!d, "margin region is hidden");
|
ok(!d, "margin region is hidden");
|
||||||
|
|
||||||
({d}) = yield getHighlighterRegionPath("border", toolbox.highlighter);
|
({d} = yield getHighlighterRegionPath("border", toolbox.highlighter));
|
||||||
ok(!d, "border region is hidden");
|
ok(!d, "border region is hidden");
|
||||||
|
|
||||||
({d}) = yield getHighlighterRegionPath("padding", toolbox.highlighter);
|
({d} = yield getHighlighterRegionPath("padding", toolbox.highlighter));
|
||||||
ok(!d, "padding region is hidden");
|
ok(!d, "padding region is hidden");
|
||||||
|
|
||||||
({d}) = yield getHighlighterRegionPath("content", toolbox.highlighter);
|
({d} = yield getHighlighterRegionPath("content", toolbox.highlighter));
|
||||||
ok(d, "content region is shown");
|
ok(d, "content region is shown");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -90,13 +90,13 @@ const TEST_DATA = [
|
||||||
let {d} = yield getHighlighterRegionPath("margin", toolbox.highlighter);
|
let {d} = yield getHighlighterRegionPath("margin", toolbox.highlighter);
|
||||||
ok(d, "margin region is shown");
|
ok(d, "margin region is shown");
|
||||||
|
|
||||||
({d}) = yield getHighlighterRegionPath("border", toolbox.highlighter);
|
({d} = yield getHighlighterRegionPath("border", toolbox.highlighter));
|
||||||
ok(!d, "border region is hidden");
|
ok(!d, "border region is hidden");
|
||||||
|
|
||||||
({d}) = yield getHighlighterRegionPath("padding", toolbox.highlighter);
|
({d} = yield getHighlighterRegionPath("padding", toolbox.highlighter));
|
||||||
ok(!d, "padding region is hidden");
|
ok(!d, "padding region is hidden");
|
||||||
|
|
||||||
({d}) = yield getHighlighterRegionPath("content", toolbox.highlighter);
|
({d} = yield getHighlighterRegionPath("content", toolbox.highlighter));
|
||||||
ok(!d, "content region is hidden");
|
ok(!d, "content region is hidden");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -71,11 +71,11 @@ function* isUpdatedAfterScroll(highlighterFront, inspector) {
|
||||||
|
|
||||||
info("Asking the content window to scroll relative to the current position");
|
info("Asking the content window to scroll relative to the current position");
|
||||||
|
|
||||||
({ data }) = yield executeInContent("Test:ScrollWindow", {
|
({ data } = yield executeInContent("Test:ScrollWindow", {
|
||||||
x: -50,
|
x: -50,
|
||||||
y: -60,
|
y: -60,
|
||||||
relative: true
|
relative: true
|
||||||
});
|
}));
|
||||||
|
|
||||||
is(data.x, x - 50, "window scrolled properly horizontally");
|
is(data.x, x - 50, "window scrolled properly horizontally");
|
||||||
is(data.y, y - 60, "window scrolled properly vertically");
|
is(data.y, y - 60, "window scrolled properly vertically");
|
||||||
|
|
|
@ -29,7 +29,7 @@ add_task(function*() {
|
||||||
yield nodeMutated;
|
yield nodeMutated;
|
||||||
|
|
||||||
info("Checking for links in the updated attribute");
|
info("Checking for links in the updated attribute");
|
||||||
({editor}) = yield getContainerForSelector("body", inspector);
|
({editor} = yield getContainerForSelector("body", inspector));
|
||||||
linkEls = editor.attrElements.get("contextmenu").querySelectorAll(".link");
|
linkEls = editor.attrElements.get("contextmenu").querySelectorAll(".link");
|
||||||
is(linkEls.length, 1, "There is one link in the contextmenu attribute");
|
is(linkEls.length, 1, "There is one link in the contextmenu attribute");
|
||||||
is(linkEls[0].dataset.type, "idref", "The link has the right type");
|
is(linkEls[0].dataset.type, "idref", "The link has the right type");
|
||||||
|
|
|
@ -29,7 +29,7 @@ add_task(function*() {
|
||||||
yield onMutated;
|
yield onMutated;
|
||||||
|
|
||||||
info("Checking for links in the updated attribute");
|
info("Checking for links in the updated attribute");
|
||||||
({editor}) = yield getContainerForSelector("body", inspector);
|
({editor} = yield getContainerForSelector("body", inspector));
|
||||||
linkEls = editor.attrElements.get("contextmenu").querySelectorAll(".link");
|
linkEls = editor.attrElements.get("contextmenu").querySelectorAll(".link");
|
||||||
is(linkEls.length, 1, "There is one link in the contextmenu attribute");
|
is(linkEls.length, 1, "There is one link in the contextmenu attribute");
|
||||||
is(linkEls[0].dataset.type, "idref", "The link has the right type");
|
is(linkEls[0].dataset.type, "idref", "The link has the right type");
|
||||||
|
|
|
@ -35,7 +35,7 @@ add_task(function*() {
|
||||||
yield selectNode("label", inspector);
|
yield selectNode("label", inspector);
|
||||||
|
|
||||||
info("Set the popupNode to the node that contains the ref");
|
info("Set the popupNode to the node that contains the ref");
|
||||||
({editor}) = yield getContainerForSelector("label", inspector);
|
({editor} = yield getContainerForSelector("label", inspector));
|
||||||
popupNode = editor.attrElements.get("for").querySelector(".link");
|
popupNode = editor.attrElements.get("for").querySelector(".link");
|
||||||
inspector.panelDoc.popupNode = popupNode;
|
inspector.panelDoc.popupNode = popupNode;
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ add_task(function*() {
|
||||||
yield selectNode("output", inspector);
|
yield selectNode("output", inspector);
|
||||||
|
|
||||||
info("Set the popupNode to the node that contains the ref");
|
info("Set the popupNode to the node that contains the ref");
|
||||||
({editor}) = yield getContainerForSelector("output", inspector);
|
({editor} = yield getContainerForSelector("output", inspector));
|
||||||
popupNode = editor.attrElements.get("for").querySelectorAll(".link")[2];
|
popupNode = editor.attrElements.get("for").querySelectorAll(".link")[2];
|
||||||
inspector.panelDoc.popupNode = popupNode;
|
inspector.panelDoc.popupNode = popupNode;
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ add_task(function*() {
|
||||||
yield selectNode("script", inspector);
|
yield selectNode("script", inspector);
|
||||||
|
|
||||||
info("Set the popupNode to the node that contains the uri");
|
info("Set the popupNode to the node that contains the uri");
|
||||||
({editor}) = yield getContainerForSelector("script", inspector);
|
({editor} = yield getContainerForSelector("script", inspector));
|
||||||
popupNode = editor.attrElements.get("src").querySelector(".link");
|
popupNode = editor.attrElements.get("src").querySelector(".link");
|
||||||
inspector.panelDoc.popupNode = popupNode;
|
inspector.panelDoc.popupNode = popupNode;
|
||||||
|
|
||||||
|
|
|
@ -829,10 +829,10 @@ InplaceEditor.prototype = {
|
||||||
this.popup.selectedIndex >= 0) {
|
this.popup.selectedIndex >= 0) {
|
||||||
let label, preLabel;
|
let label, preLabel;
|
||||||
if (this._selectedIndex === undefined) {
|
if (this._selectedIndex === undefined) {
|
||||||
({label, preLabel}) = this.popup.getItemAtIndex(this.popup.selectedIndex);
|
({label, preLabel} = this.popup.getItemAtIndex(this.popup.selectedIndex));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
({label, preLabel}) = this.popup.getItemAtIndex(this._selectedIndex);
|
({label, preLabel} = this.popup.getItemAtIndex(this._selectedIndex));
|
||||||
}
|
}
|
||||||
let input = this.input;
|
let input = this.input;
|
||||||
let pre = "";
|
let pre = "";
|
||||||
|
|
|
@ -49,7 +49,7 @@ testAll(testConst);
|
||||||
|
|
||||||
function testGlobal(pattern, input) {
|
function testGlobal(pattern, input) {
|
||||||
return new Function('input',
|
return new Function('input',
|
||||||
'(' + pattern + ') = input;' +
|
'(' + pattern + ' = input);' +
|
||||||
'return [a, b, c, d, e, f];'
|
'return [a, b, c, d, e, f];'
|
||||||
)(input);
|
)(input);
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ testAll(testGlobal);
|
||||||
function testClosure(pattern, input) {
|
function testClosure(pattern, input) {
|
||||||
return new Function('input',
|
return new Function('input',
|
||||||
'var rest; (function () {' +
|
'var rest; (function () {' +
|
||||||
'(' + pattern + ') = input;' +
|
'(' + pattern + ' = input);' +
|
||||||
'})();' +
|
'})();' +
|
||||||
'return [a, b, c, d, e, f];'
|
'return [a, b, c, d, e, f];'
|
||||||
)(input);
|
)(input);
|
||||||
|
@ -113,7 +113,7 @@ assertEq(cc, 3);
|
||||||
|
|
||||||
// test that the assignment happens in source order
|
// test that the assignment happens in source order
|
||||||
var a = undefined, b = undefined, c = undefined;
|
var a = undefined, b = undefined, c = undefined;
|
||||||
({a: a = 1, c: c = 2, b: b = 3}) = {
|
({a: a = 1, c: c = 2, b: b = 3} = {
|
||||||
get a() {
|
get a() {
|
||||||
assertEq(a, undefined);
|
assertEq(a, undefined);
|
||||||
assertEq(c, undefined);
|
assertEq(c, undefined);
|
||||||
|
@ -132,7 +132,7 @@ var a = undefined, b = undefined, c = undefined;
|
||||||
assertEq(b, undefined);
|
assertEq(b, undefined);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
assertEq(b, 4);
|
assertEq(b, 4);
|
||||||
|
|
||||||
assertThrowsInstanceOf(() => { var {a: {a} = null} = {}; }, TypeError);
|
assertThrowsInstanceOf(() => { var {a: {a} = null} = {}; }, TypeError);
|
||||||
|
@ -150,7 +150,7 @@ assertEq(a.y, 2);
|
||||||
|
|
||||||
// defaults are evaluated even if there is no binding
|
// defaults are evaluated even if there is no binding
|
||||||
var evaled = false;
|
var evaled = false;
|
||||||
({a: {} = (evaled = true, {})}) = {};
|
({a: {} = (evaled = true, {})} = {});
|
||||||
assertEq(evaled, true);
|
assertEq(evaled, true);
|
||||||
evaled = false;
|
evaled = false;
|
||||||
assertThrowsInstanceOf(() => { [[] = (evaled = true, 2)] = [] }, TypeError);
|
assertThrowsInstanceOf(() => { [[] = (evaled = true, 2)] = [] }, TypeError);
|
||||||
|
|
|
@ -81,7 +81,7 @@ testDeclaration(testVar);
|
||||||
function testGlobal(pattern, input, binding) {
|
function testGlobal(pattern, input, binding) {
|
||||||
binding = binding || 'rest';
|
binding = binding || 'rest';
|
||||||
return new Function('input',
|
return new Function('input',
|
||||||
'(' + pattern + ') = input;' +
|
'(' + pattern + ' = input);' +
|
||||||
'return ' + binding
|
'return ' + binding
|
||||||
)(input);
|
)(input);
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ function testClosure(pattern, input, binding) {
|
||||||
binding = binding || 'rest';
|
binding = binding || 'rest';
|
||||||
return new Function('input',
|
return new Function('input',
|
||||||
'var ' + binding + '; (function () {' +
|
'var ' + binding + '; (function () {' +
|
||||||
'(' + pattern + ') = input;' +
|
'(' + pattern + ' = input);' +
|
||||||
'})();' +
|
'})();' +
|
||||||
'return ' + binding
|
'return ' + binding
|
||||||
)(input);
|
)(input);
|
||||||
|
|
|
@ -30,7 +30,7 @@ function partialEvalObj()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
({a:a, b:b}) = exceptObj();
|
({a:a, b:b} = exceptObj());
|
||||||
throw "FAILED";
|
throw "FAILED";
|
||||||
}
|
}
|
||||||
catch (ex)
|
catch (ex)
|
||||||
|
@ -114,7 +114,7 @@ function objWithGetters()
|
||||||
|
|
||||||
function partialEvalObj2()
|
function partialEvalObj2()
|
||||||
{
|
{
|
||||||
({g: g, h: h, i: i, j: j, k: k}) = objWithGetters();
|
({g: g, h: h, i: i, j: j, k: k} = objWithGetters());
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
|
@ -20,7 +20,7 @@ function test()
|
||||||
printBugNumber(BUGNUMBER);
|
printBugNumber(BUGNUMBER);
|
||||||
printStatus (summary);
|
printStatus (summary);
|
||||||
|
|
||||||
({ x: a }) = {}
|
({ x: a } = {});
|
||||||
|
|
||||||
reportCompare(expect, actual, summary);
|
reportCompare(expect, actual, summary);
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ function test()
|
||||||
|
|
||||||
reportCompare(expect, actual, summary);
|
reportCompare(expect, actual, summary);
|
||||||
|
|
||||||
(function () { ({ y: [] }) = {} });
|
(function () { ({ y: [] } = {}); });
|
||||||
|
|
||||||
exitFunc ('test');
|
exitFunc ('test');
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,7 +115,7 @@
|
||||||
Cc["@mozilla.org/network/http-auth-manager;1"].getService(SpecialPowers.Ci.nsIHttpAuthManager).clearAll();
|
Cc["@mozilla.org/network/http-auth-manager;1"].getService(SpecialPowers.Ci.nsIHttpAuthManager).clearAll();
|
||||||
if (pendingTests.length > 0) {
|
if (pendingTests.length > 0) {
|
||||||
({expectedDialogs: gExpectedDialogs,
|
({expectedDialogs: gExpectedDialogs,
|
||||||
test: gCurrentTest}) = pendingTests.shift();
|
test: gCurrentTest} = pendingTests.shift());
|
||||||
gCurrentTest.call(this);
|
gCurrentTest.call(this);
|
||||||
} else {
|
} else {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
|
|
@ -266,7 +266,7 @@ function createScreenshotData(document, args) {
|
||||||
}
|
}
|
||||||
else if (args.selector) {
|
else if (args.selector) {
|
||||||
const lh = new LayoutHelpers(window);
|
const lh = new LayoutHelpers(window);
|
||||||
({ top, left, width, height }) = lh.getRect(args.selector, window);
|
({ top, left, width, height } = lh.getRect(args.selector, window));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
left = window.scrollX;
|
left = window.scrollX;
|
||||||
|
|
|
@ -50,7 +50,7 @@ function newConnection(aPrefix)
|
||||||
/* Create the main connection for these tests. */
|
/* Create the main connection for these tests. */
|
||||||
function createMainConnection()
|
function createMainConnection()
|
||||||
{
|
{
|
||||||
({ conn: gMainConnection, transport: gMainTransport }) = newConnection();
|
({ conn: gMainConnection, transport: gMainTransport } = newConnection());
|
||||||
gClient = new DebuggerClient(gMainTransport);
|
gClient = new DebuggerClient(gMainTransport);
|
||||||
gClient.connect((aType, aTraits) => run_next_test());
|
gClient.connect((aType, aTraits) => run_next_test());
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче