Skip to content
This repository has been archived by the owner on May 2, 2018. It is now read-only.

Commit

Permalink
migrate reps tests to use load-reps
Browse files Browse the repository at this point in the history
  • Loading branch information
juliandescottes committed Jan 19, 2017
1 parent d1bb228 commit b2a1b13
Show file tree
Hide file tree
Showing 30 changed files with 61 additions and 70 deletions.
1 change: 1 addition & 0 deletions src/reps/rep.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ module.exports = {
NaNRep,
Null,
Number,
Obj,
ObjectWithText,
ObjectWithURL,
PromiseRep,
Expand Down
5 changes: 2 additions & 3 deletions src/test/mochitest/test_reps_array.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
/* import-globals-from head.js */

window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { ArrayRep } = browserRequire("devtools/client/shared/components/reps/array");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
const { REPS, MODE } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, ArrayRep } = REPS;

let componentUnderTest = ArrayRep;
const maxLength = {
Expand Down
4 changes: 2 additions & 2 deletions src/test/mochitest/test_reps_attribute.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<script type="application/javascript;version=1.8">
window.onload = Task.async(function* () {
try {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { Attribute } = browserRequire("devtools/client/shared/components/reps/attribute");
const { REPS } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, Attribute } = REPS;

let gripStub = {
"type": "object",
Expand Down
5 changes: 2 additions & 3 deletions src/test/mochitest/test_reps_comment-node.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@

window.onload = Task.async(function* () {
try {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { CommentNode } = browserRequire("devtools/client/shared/components/reps/comment-node");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
const { REPS, MODE } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, CommentNode } = REPS;

let gripStub = {
"type": "object",
Expand Down
4 changes: 2 additions & 2 deletions src/test/mochitest/test_reps_date-time.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { DateTime } = browserRequire("devtools/client/shared/components/reps/date-time");
const { REPS } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, DateTime } = REPS;

try {
testValid();
Expand Down
4 changes: 2 additions & 2 deletions src/test/mochitest/test_reps_document.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { Document } = browserRequire("devtools/client/shared/components/reps/document");
const { REPS } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, Document } = REPS;

try {
let gripStub = {
Expand Down
5 changes: 2 additions & 3 deletions src/test/mochitest/test_reps_element-node.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
"use strict";

window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { ElementNode } = browserRequire("devtools/client/shared/components/reps/element-node");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
const { REPS, MODE } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, ElementNode } = REPS;

try {
yield testBodyNode();
Expand Down
5 changes: 2 additions & 3 deletions src/test/mochitest/test_reps_error.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
"use strict";

window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { ErrorRep } = browserRequire("devtools/client/shared/components/reps/error");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
const { REPS, MODE } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, ErrorRep } = REPS;

try {
// Test errors with different properties
Expand Down
5 changes: 2 additions & 3 deletions src/test/mochitest/test_reps_event.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { Event } = browserRequire("devtools/client/shared/components/reps/event");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
const { REPS, MODE } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, Event } = REPS;

try {
// Test that correct rep is chosen
Expand Down
5 changes: 2 additions & 3 deletions src/test/mochitest/test_reps_failure.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
<script type="application/javascript;version=1.8">
window.onload = Task.async(function* () {
try {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { ArrayRep } = browserRequire("devtools/client/shared/components/reps/array");
let { RegExp } = browserRequire("devtools/client/shared/components/reps/regexp");
const { REPS } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, ArrayRep, RegExp } = REPS;

// Force the RegExp rep to crash by creating RegExp grip that throws when accessing
// the displayString property
Expand Down
4 changes: 2 additions & 2 deletions src/test/mochitest/test_reps_function.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { Func } = browserRequire("devtools/client/shared/components/reps/function");
const { REPS } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, Func } = REPS;

const componentUnderTest = Func;

Expand Down
5 changes: 2 additions & 3 deletions src/test/mochitest/test_reps_grip-array.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { GripArray } = browserRequire("devtools/client/shared/components/reps/grip-array");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
const { REPS, MODE } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, GripArray } = REPS;

let componentUnderTest = GripArray;
const maxLength = {
Expand Down
5 changes: 2 additions & 3 deletions src/test/mochitest/test_reps_grip-map.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
"use strict";

window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { GripMap } = browserRequire("devtools/client/shared/components/reps/grip-map");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
const { REPS, MODE } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, GripMap } = REPS;

const componentUnderTest = GripMap;

Expand Down
5 changes: 2 additions & 3 deletions src/test/mochitest/test_reps_grip.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { Grip } = browserRequire("devtools/client/shared/components/reps/grip");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
const { REPS, MODE } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, Grip } = REPS;

const componentUnderTest = Grip;

Expand Down
4 changes: 2 additions & 2 deletions src/test/mochitest/test_reps_infinity.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"use strict";

window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { InfinityRep } = browserRequire("devtools/client/shared/components/reps/infinity");
const { REPS } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, InfinityRep } = REPS;

try {
yield testInfinity();
Expand Down
4 changes: 2 additions & 2 deletions src/test/mochitest/test_reps_long-string.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { LongStringRep } = browserRequire("devtools/client/shared/components/reps/long-string");
const { REPS } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, LongStringRep } = REPS;

try {
// Test that correct rep is chosen
Expand Down
4 changes: 2 additions & 2 deletions src/test/mochitest/test_reps_nan.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"use strict";

window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { NaNRep } = browserRequire("devtools/client/shared/components/reps/nan");
const { REPS } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, NaNRep } = REPS;

try {
yield testNaN();
Expand Down
4 changes: 2 additions & 2 deletions src/test/mochitest/test_reps_null.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<script type="application/javascript;version=1.8">
window.onload = Task.async(function* () {
try {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { Null } = browserRequire("devtools/client/shared/components/reps/null");
const { REPS } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, Null } = REPS;

let gripStub = {
"type": "null"
Expand Down
4 changes: 2 additions & 2 deletions src/test/mochitest/test_reps_number.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { Number } = browserRequire("devtools/client/shared/components/reps/number");
const { REPS } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, Number } = REPS;

try {
yield testInt();
Expand Down
4 changes: 2 additions & 2 deletions src/test/mochitest/test_reps_object-with-text.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<script type="application/javascript;version=1.8">
window.onload = Task.async(function* () {
try {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { ObjectWithText } = browserRequire("devtools/client/shared/components/reps/object-with-text");
const { REPS } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, ObjectWithText } = REPS;

let gripStub = {
"type": "object",
Expand Down
5 changes: 3 additions & 2 deletions src/test/mochitest/test_reps_object-with-url.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
try {
let ReactDOM = browserRequire("devtools/client/shared/vendor/react-dom");
let React = browserRequire("devtools/client/shared/vendor/react");
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { ObjectWithURL } = browserRequire("devtools/client/shared/components/reps/object-with-url");

const { REPS } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, ObjectWithURL } = REPS;

let gripStub = {
"type": "object",
Expand Down
5 changes: 2 additions & 3 deletions src/test/mochitest/test_reps_object.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { Obj } = browserRequire("devtools/client/shared/components/reps/object");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
const { REPS, MODE } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, Obj } = REPS;

const componentUnderTest = Obj;

Expand Down
5 changes: 2 additions & 3 deletions src/test/mochitest/test_reps_promise.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
"use strict";

window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { PromiseRep } = browserRequire("devtools/client/shared/components/reps/promise");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
const { REPS, MODE } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, PromiseRep } = REPS;

const componentUnderTest = PromiseRep;

Expand Down
4 changes: 2 additions & 2 deletions src/test/mochitest/test_reps_regexp.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<script type="application/javascript;version=1.8">
window.onload = Task.async(function* () {
try {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { RegExp } = browserRequire("devtools/client/shared/components/reps/regexp");
const { REPS } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, RegExp } = REPS;

let gripStub = {
"type": "object",
Expand Down
4 changes: 2 additions & 2 deletions src/test/mochitest/test_reps_string.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<script src="head.js" type="application/javascript;version=1.8"></script>
<script type="application/javascript;version=1.8">
window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { StringRep } = browserRequire("devtools/client/shared/components/reps/string");
const { REPS } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, StringRep } = REPS;

try {
// Test that correct rep is chosen
Expand Down
4 changes: 2 additions & 2 deletions src/test/mochitest/test_reps_stylesheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<script type="application/javascript;version=1.8">
window.onload = Task.async(function* () {
try {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { StyleSheet } = browserRequire("devtools/client/shared/components/reps/stylesheet");
const { REPS } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, StyleSheet } = REPS;

let gripStub = {
"type": "object",
Expand Down
4 changes: 2 additions & 2 deletions src/test/mochitest/test_reps_symbol.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
/* import-globals-from head.js */

window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { SymbolRep } = browserRequire("devtools/client/shared/components/reps/symbol");
const { REPS } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, SymbolRep } = REPS;

let gripStubs = new Map();
gripStubs.set("testSymbolFoo", {
Expand Down
5 changes: 2 additions & 3 deletions src/test/mochitest/test_reps_text-node.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
"use strict";

window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { TextNode } = browserRequire("devtools/client/shared/components/reps/text-node");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
const { REPS, MODE } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, TextNode } = REPS;

let gripStubs = new Map();
gripStubs.set("testRendering", {
Expand Down
4 changes: 2 additions & 2 deletions src/test/mochitest/test_reps_undefined.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
try {
let ReactDOM = browserRequire("devtools/client/shared/vendor/react-dom");
let React = browserRequire("devtools/client/shared/vendor/react");
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { Undefined } = browserRequire("devtools/client/shared/components/reps/undefined");
const { REPS } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, Undefined } = REPS;

let gripStub = {
"type": "undefined"
Expand Down
5 changes: 3 additions & 2 deletions src/test/mochitest/test_reps_window.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
try {
let ReactDOM = browserRequire("devtools/client/shared/vendor/react-dom");
let React = browserRequire("devtools/client/shared/vendor/react");
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { Window } = browserRequire("devtools/client/shared/components/reps/window");

const { REPS } = browserRequire("devtools/client/shared/components/reps/load-reps");
let { Rep, Window } = REPS;

let gripStub = {
"type": "object",
Expand Down

0 comments on commit b2a1b13

Please sign in to comment.