Bug 1180290 - Part 4: Add tests for builtin getter name. r=till

This commit is contained in:
Tooru Fujisawa 2016-01-05 03:21:24 +09:00
parent b686853bd0
commit 29d07849ad
8 changed files with 97 additions and 0 deletions

View File

@ -0,0 +1,10 @@
var BUGNUMBER = 1180290;
var summary = 'Array getters should have get prefix';
print(BUGNUMBER + ": " + summary);
// FIXME: bug 1165052
// assertEq(Object.getOwnPropertyDescriptor(Array, Symbol.species).get.name, "get [Symbol.species]");
if (typeof reportCompare === 'function')
reportCompare(true, true);

View File

@ -0,0 +1,11 @@
var BUGNUMBER = 1180290;
var summary = 'ArrayBuffer getters should have get prefix';
print(BUGNUMBER + ": " + summary);
// FIXME: bug 1165053
// assertEq(Object.getOwnPropertyDescriptor(ArrayBuffer, Symbol.species).get.name, "get [Symbol.species]");
assertEq(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get.name, "get byteLength");
if (typeof reportCompare === 'function')
reportCompare(true, true);

View File

@ -0,0 +1,11 @@
var BUGNUMBER = 1180290;
var summary = 'DataView getters should have get prefix';
print(BUGNUMBER + ": " + summary);
assertEq(Object.getOwnPropertyDescriptor(DataView.prototype, "buffer").get.name, "get buffer");
assertEq(Object.getOwnPropertyDescriptor(DataView.prototype, "byteLength").get.name, "get byteLength");
assertEq(Object.getOwnPropertyDescriptor(DataView.prototype, "byteOffset").get.name, "get byteOffset");
if (typeof reportCompare === 'function')
reportCompare(true, true);

View File

@ -0,0 +1,10 @@
var BUGNUMBER = 1180290;
var summary = 'Map getters should have get prefix';
print(BUGNUMBER + ": " + summary);
assertEq(Object.getOwnPropertyDescriptor(Map, Symbol.species).get.name, "get [Symbol.species]");
assertEq(Object.getOwnPropertyDescriptor(Map.prototype, "size").get.name, "get size");
if (typeof reportCompare === 'function')
reportCompare(true, true);

View File

@ -0,0 +1,10 @@
var BUGNUMBER = 1180290;
var summary = 'Object accessors should have get prefix';
print(BUGNUMBER + ": " + summary);
assertEq(Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").get.name, "get __proto__");
assertEq(Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set.name, "set __proto__");
if (typeof reportCompare === 'function')
reportCompare(true, true);

View File

@ -0,0 +1,17 @@
var BUGNUMBER = 1180290;
var summary = 'RegExp getters should have get prefix';
print(BUGNUMBER + ": " + summary);
// FIXME: bug 887016
// assertEq(Object.getOwnPropertyDescriptor(RegExp, Symbol.species).get.name, "get [Symbol.species]");
assertEq(Object.getOwnPropertyDescriptor(RegExp.prototype, "flags").get.name, "get flags");
assertEq(Object.getOwnPropertyDescriptor(RegExp.prototype, "global").get.name, "get global");
assertEq(Object.getOwnPropertyDescriptor(RegExp.prototype, "ignoreCase").get.name, "get ignoreCase");
assertEq(Object.getOwnPropertyDescriptor(RegExp.prototype, "multiline").get.name, "get multiline");
assertEq(Object.getOwnPropertyDescriptor(RegExp.prototype, "source").get.name, "get source");
assertEq(Object.getOwnPropertyDescriptor(RegExp.prototype, "sticky").get.name, "get sticky");
assertEq(Object.getOwnPropertyDescriptor(RegExp.prototype, "unicode").get.name, "get unicode");
if (typeof reportCompare === 'function')
reportCompare(true, true);

View File

@ -0,0 +1,10 @@
var BUGNUMBER = 1180290;
var summary = 'Set getters should have get prefix';
print(BUGNUMBER + ": " + summary);
assertEq(Object.getOwnPropertyDescriptor(Set, Symbol.species).get.name, "get [Symbol.species]");
assertEq(Object.getOwnPropertyDescriptor(Set.prototype, "size").get.name, "get size");
if (typeof reportCompare === 'function')
reportCompare(true, true);

View File

@ -0,0 +1,18 @@
var BUGNUMBER = 1180290;
var summary = 'TypedArray getters should have get prefix';
print(BUGNUMBER + ": " + summary);
let TypedArray = Object.getPrototypeOf(Float32Array.prototype).constructor;
// FIXME: bug 1165053
// assertEq(Object.getOwnPropertyDescriptor(TypedArray, Symbol.species).get.name, "get [Symbol.species]");
assertEq(Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.name, "get buffer");
assertEq(Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.name, "get byteLength");
assertEq(Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.name, "get byteOffset");
assertEq(Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.name, "get length");
// FIXME: bug 1114580
// assertEq(Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.name, "get [Symbol.toStringTag]");
if (typeof reportCompare === 'function')
reportCompare(true, true);