Backed out changeset 951aa830b051 (bug 1286864) for Mochitest M(oth), M(c1) cases failed

This commit is contained in:
Iris Hsiao 2016-07-27 11:33:08 +08:00
parent f050631553
commit b761be74a0
8 changed files with 22 additions and 19 deletions

View File

@ -32,7 +32,7 @@ define(function (require, exports, module) {
let items = [];
let delim;
for (let i = 0; i < array.length && i < max; i++) {
for (let i = 0; i < array.length && i <= max; i++) {
try {
let value = array[i];
@ -61,12 +61,14 @@ define(function (require, exports, module) {
}
if (array.length > max) {
items.pop();
let objectLink = this.props.objectLink || DOM.span;
items.push(Caption({
key: "more",
object: objectLink({
object: this.props.object
}, (array.length - max) + " more…")
}, "more…")
}));
}

View File

@ -59,7 +59,7 @@ define(function (require, exports, module) {
let delim;
let provider = this.props.provider;
for (let i = 0; i < array.length && i < max; i++) {
for (let i = 0; i < array.length && i <= max; i++) {
try {
let itemGrip = array[i];
let value = provider ? provider.getValue(itemGrip) : itemGrip;
@ -89,12 +89,13 @@ define(function (require, exports, module) {
}
if (array.length > max) {
items.pop();
let objectLink = this.props.objectLink || span;
items.push(Caption({
key: "more",
object: objectLink({
object: this.props.object
}, (grip.preview.length - max) + " more…")
}, "more…")
}));
}

View File

@ -79,7 +79,7 @@ define(function (require, exports, module) {
key: "more",
object: objectLink({
object: object
}, ((object ? object.ownPropertyLength : 0) - max) + " more…")
}, "more…")
}));
} else if (props.length > 0) {
// Remove the last comma.

View File

@ -78,7 +78,7 @@ define(function (require, exports, module) {
key: "more",
object: objectLink({
object: object
}, (Object.keys(object).length - max) + " more…")
}, "more…")
}));
} else if (props.length > 0) {
// Remove the last comma.

View File

@ -107,7 +107,7 @@ window.onload = Task.async(function* () {
function testMoreThanShortMaxProps() {
const stub = Array(maxLength.short + 1).fill("foo");
const defaultShortOutput = `[${Array(maxLength.short).fill("\"foo\"").join(", ")}, 1 more…]`;
const defaultShortOutput = `[${Array(maxLength.short).fill("\"foo\"").join(", ")}, more…]`;
const modeTests = [
{
@ -133,8 +133,8 @@ window.onload = Task.async(function* () {
function testMoreThanLongMaxProps() {
const stub = Array(maxLength.long + 1).fill("foo");
const defaultShortOutput = `[${Array(maxLength.short).fill("\"foo\"").join(", ")}, ${maxLength.long + 1 - maxLength.short} more…]`;
const defaultLongOutput = `[${Array(maxLength.long).fill("\"foo\"").join(", ")}, 1 more…]`;
const defaultShortOutput = `[${Array(maxLength.short).fill("\"foo\"").join(", ")}, more…]`;
const defaultLongOutput = `[${Array(maxLength.long).fill("\"foo\"").join(", ")}, more…]`;
const modeTests = [
{
@ -194,7 +194,7 @@ window.onload = Task.async(function* () {
p4: "s4"
}
];
const defaultOutput = `[Object{p1: "s1", p3: "s3", p4: "s4", 1 more…}]`;
const defaultOutput = `[Object{p1: "s1", p3: "s3", p4: "s4", more…}]`;
const modeTests = [
{

View File

@ -106,7 +106,7 @@ window.onload = Task.async(function* () {
// Test array = `["test string"…] //4 items`
const testName = "testMoreThanShortMaxProps";
const defaultOutput = `Array[${Array(maxLength.short).fill("\"test string\"").join(", ")}, 1 more…]`;
const defaultOutput = `Array[${Array(maxLength.short).fill("\"test string\"").join(", ")}, more…]`;
const modeTests = [
{
@ -134,8 +134,8 @@ window.onload = Task.async(function* () {
// Test array = `["test string"…] //301 items`
const testName = "testMoreThanLongMaxProps";
const defaultShortOutput = `Array[${Array(maxLength.short).fill("\"test string\"").join(", ")}, ${maxLength.long + 1 - maxLength.short} more…]`;
const defaultLongOutput = `Array[${Array(maxLength.long).fill("\"test string\"").join(", ")}, 1 more…]`;
const defaultShortOutput = `Array[${Array(maxLength.short).fill("\"test string\"").join(", ")}, more…]`;
const defaultLongOutput = `Array[${Array(maxLength.long).fill("\"test string\"").join(", ")}, more…]`;
const modeTests = [
{

View File

@ -100,10 +100,10 @@ window.onload = Task.async(function* () {
}
function testMoreThanMaxProps() {
// Test object = `{p0: "0", p1: "1", p2: "2", …, p100: "100"}`
// Test object = `{p0: "0", p1: "1", p2: "2", …, p101: "101"}`
const testName = "testMoreThanMaxProps";
const defaultOutput = `Object {p0: "0", p1: "1", p2: "2", 98 more…}`;
const defaultOutput = `Object {p0: "0", p1: "1", p2: "2", more…}`;
// Generate string with 100 properties, which is the max limit
// for 'long' mode.
@ -112,7 +112,7 @@ window.onload = Task.async(function* () {
props += "p" + i + ": \"" + i + "\", ";
}
const longOutput = `Object {${props}1 more…}`;
const longOutput = `Object {${props}more…}`;
const modeTests = [
{
@ -140,7 +140,7 @@ window.onload = Task.async(function* () {
// Test object: `{a: undefined, b: undefined, c: "c", d: 1}`
// @TODO This is not how we actually want the preview to be output.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1276376
const expectedOutput = `Object {a: undefined, b: undefined, c: "c", 1 more…}`;
const expectedOutput = `Object {a: undefined, b: undefined, c: "c", more…}`;
}
function testNestedObject() {

View File

@ -101,7 +101,7 @@ window.onload = Task.async(function* () {
for (let i = 0; i<100; i++) {
stub[`p${i}`] = i
}
const defaultOutput = `Object{p0: 0, p1: 1, p2: 2, 97 more…}`;
const defaultOutput = `Object{p0: 0, p1: 1, p2: 2, more…}`;
const modeTests = [
{
@ -127,7 +127,7 @@ window.onload = Task.async(function* () {
function testUninterestingProps() {
const stub = {a:undefined, b:undefined, c:"c", d:0};
const defaultOutput = `Object{c: "c", d: 0, a: undefined, 1 more…}`;
const defaultOutput = `Object{c: "c", d: 0, a: undefined, more…}`;
const modeTests = [
{