Backed out changeset 6b0e836a33a9 (bug 1316265) for leaks in Linux x64 devtools tests. r=backout

This commit is contained in:
Sebastian Hengst
2016-12-20 19:35:54 +01:00
parent 3115bb8104
commit 098c830dc0
3 changed files with 10 additions and 209 deletions

View File

@@ -27,24 +27,16 @@ define(function (require, exports, module) {
}, },
getTitle: function (grip) { getTitle: function (grip) {
let title = "function ";
if (grip.isGenerator) {
title = "function* ";
}
if (grip.isAsync) {
title = "async " + title;
}
if (this.props.objectLink) { if (this.props.objectLink) {
return this.props.objectLink({ return this.props.objectLink({
object: grip object: grip
}, title); }, "function ");
} }
return title; return "";
}, },
summarizeFunction: function (grip) { summarizeFunction: function (grip) {
let name = grip.userDisplayName || grip.displayName || grip.name || ""; let name = grip.userDisplayName || grip.displayName || grip.name || "function";
return cropString(name + "()", 100); return cropString(name + "()", 100);
}, },

View File

@@ -19,7 +19,6 @@ Test Func rep
window.onload = Task.async(function* () { window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep"); let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { Func } = browserRequire("devtools/client/shared/components/reps/function"); let { Func } = browserRequire("devtools/client/shared/components/reps/function");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
const componentUnderTest = Func; const componentUnderTest = Func;
@@ -33,9 +32,6 @@ window.onload = Task.async(function* () {
yield testVarNamed(); yield testVarNamed();
yield testAnon(); yield testAnon();
yield testLongName(); yield testLongName();
yield testAsyncFunction();
yield testAnonAsyncFunction();
yield testGeneratorFunction();
} catch(e) { } catch(e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e)); ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally { } finally {
@@ -43,10 +39,10 @@ window.onload = Task.async(function* () {
} }
function testNamed() { function testNamed() {
// Test declaration: `function testName() { let innerVar = "foo" }` // Test declaration: `function testName{ let innerVar = "foo" }`
const testName = "testNamed"; const testName = "testNamed";
const defaultOutput = "function testName()"; const defaultOutput = `testName()`;
const modeTests = [ const modeTests = [
{ {
@@ -59,10 +55,10 @@ window.onload = Task.async(function* () {
} }
function testUserNamed() { function testUserNamed() {
// Test declaration: `function testName() { let innerVar = "foo" }` // Test declaration: `function testName{ let innerVar = "foo" }`
const testName = "testUserNamed"; const testName = "testUserNamed";
const defaultOutput = "function testUserName()"; const defaultOutput = `testUserName()`;
const modeTests = [ const modeTests = [
{ {
@@ -78,7 +74,7 @@ window.onload = Task.async(function* () {
// Test declaration: `let testVarName = function() { }` // Test declaration: `let testVarName = function() { }`
const testName = "testVarNamed"; const testName = "testVarNamed";
const defaultOutput = "function testVarName()"; const defaultOutput = `testVarName()`;
const modeTests = [ const modeTests = [
{ {
@@ -94,7 +90,7 @@ window.onload = Task.async(function* () {
// Test declaration: `() => {}` // Test declaration: `() => {}`
const testName = "testAnon"; const testName = "testAnon";
const defaultOutput = "function ()"; const defaultOutput = `function()`;
const modeTests = [ const modeTests = [
{ {
@@ -110,7 +106,7 @@ window.onload = Task.async(function* () {
// Test declaration: `let f = function loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong() { }` // Test declaration: `let f = function loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong() { }`
const testName = "testLongName"; const testName = "testLongName";
const defaultOutput = "function looooooooooooooooooooooooooooooooooooooooooooooooo\u2026ooooooooooooooooooooooooooooooooooooooooooooong()"; const defaultOutput = `looooooooooooooooooooooooooooooooooooooooooooooooo\u2026ooooooooooooooooooooooooooooooooooooooooooooong()`;
const modeTests = [ const modeTests = [
{ {
@@ -122,110 +118,6 @@ window.onload = Task.async(function* () {
testRepRenderModes(modeTests, testName, componentUnderTest, getGripStub(testName)); testRepRenderModes(modeTests, testName, componentUnderTest, getGripStub(testName));
} }
function testAsyncFunction() {
const testName = "testAsyncFunction";
const defaultOutput = "async function waitUntil2017()";
const modeTests = [
{
mode: undefined,
expectedOutput: defaultOutput,
},
{
mode: MODE.TINY,
expectedOutput: defaultOutput,
},
{
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
testRepRenderModes(modeTests, testName, componentUnderTest, getGripStub(testName));
}
function testAnonAsyncFunction() {
const testName = "testAnonAsyncFunction";
const defaultOutput = "async function ()";
const modeTests = [
{
mode: undefined,
expectedOutput: defaultOutput,
},
{
mode: MODE.TINY,
expectedOutput: defaultOutput,
},
{
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
testRepRenderModes(modeTests, testName, componentUnderTest, getGripStub(testName));
}
function testGeneratorFunction() {
const testName = "testGeneratorFunction";
const defaultOutput = "function* fib()";
const modeTests = [
{
mode: undefined,
expectedOutput: defaultOutput,
},
{
mode: MODE.TINY,
expectedOutput: defaultOutput,
},
{
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
testRepRenderModes(modeTests, testName, componentUnderTest, getGripStub(testName));
}
function testAnonGeneratorFunction() {
const testName = "testAnonGeneratorFunction";
const defaultOutput = "function* ()";
const modeTests = [
{
mode: undefined,
expectedOutput: defaultOutput,
},
{
mode: MODE.TINY,
expectedOutput: defaultOutput,
},
{
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
testRepRenderModes(modeTests, testName, componentUnderTest, getGripStub(testName));
}
function getGripStub(functionName) { function getGripStub(functionName) {
switch (functionName) { switch (functionName) {
case "testNamed": case "testNamed":
@@ -236,8 +128,6 @@ window.onload = Task.async(function* () {
"extensible": true, "extensible": true,
"frozen": false, "frozen": false,
"sealed": false, "sealed": false,
"isAsync": false,
"isGenerator": false,
"name": "testName", "name": "testName",
"displayName": "testName", "displayName": "testName",
"location": { "location": {
@@ -254,8 +144,6 @@ window.onload = Task.async(function* () {
"extensible": true, "extensible": true,
"frozen": false, "frozen": false,
"sealed": false, "sealed": false,
"isAsync": false,
"isGenerator": false,
"name": "testName", "name": "testName",
"userDisplayName": "testUserName", "userDisplayName": "testUserName",
"displayName": "testName", "displayName": "testName",
@@ -273,8 +161,6 @@ window.onload = Task.async(function* () {
"extensible": true, "extensible": true,
"frozen": false, "frozen": false,
"sealed": false, "sealed": false,
"isAsync": false,
"isGenerator": false,
"displayName": "testVarName", "displayName": "testVarName",
"location": { "location": {
"url": "debugger eval code", "url": "debugger eval code",
@@ -290,8 +176,6 @@ window.onload = Task.async(function* () {
"extensible": true, "extensible": true,
"frozen": false, "frozen": false,
"sealed": false, "sealed": false,
"isAsync": false,
"isGenerator": false,
"location": { "location": {
"url": "debugger eval code", "url": "debugger eval code",
"line": 1 "line": 1
@@ -306,8 +190,6 @@ window.onload = Task.async(function* () {
"extensible": true, "extensible": true,
"frozen": false, "frozen": false,
"sealed": false, "sealed": false,
"isAsync": false,
"isGenerator": false,
"name": "loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong", "name": "loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong",
"displayName": "loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong", "displayName": "loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong",
"location": { "location": {
@@ -315,75 +197,6 @@ window.onload = Task.async(function* () {
"line": 1 "line": 1
} }
}; };
case "testAsyncFunction":
return {
"type": "object",
"class": "Function",
"actor": "server1.conn7.obj45",
"extensible": true,
"frozen": false,
"sealed": false,
"isAsync": true,
"isGenerator": false,
"name": "waitUntil2017",
"displayName": "waitUntil2017",
"location": {
"url": "debugger eval code",
"line": 1
}
};
case "testAnonAsyncFunction":
return {
"type": "object",
"class": "Function",
"actor": "server1.conn7.obj45",
"extensible": true,
"frozen": false,
"sealed": false,
"isAsync": true,
"isGenerator": false,
"location": {
"url": "debugger eval code",
"line": 1
}
};
case "testGeneratorFunction":
return {
"type": "object",
"class": "Function",
"actor": "server1.conn7.obj45",
"extensible": true,
"frozen": false,
"sealed": false,
"isAsync": false,
"isGenerator": true,
"name": "fib",
"displayName": "fib",
"location": {
"url": "debugger eval code",
"line": 1
}
};
case "testAnonGeneratorFunction":
return {
"type": "object",
"class": "Function",
"actor": "server1.conn7.obj45",
"extensible": true,
"frozen": false,
"sealed": false,
"isAsync": false,
"isGenerator": true,
"location": {
"url": "debugger eval code",
"line": 1
}
};
} }
} }
}); });

View File

@@ -1127,10 +1127,6 @@ DebuggerServer.ObjectActorPreviewers = {
grip.parameterNames = obj.parameterNames; grip.parameterNames = obj.parameterNames;
} }
let type = DevToolsUtils.getProperty(obj, "constructor").name;
grip.isAsync = type === "AsyncFunction";
grip.isGenerator = type === "GeneratorFunction";
// Check if the developer has added a de-facto standard displayName // Check if the developer has added a de-facto standard displayName
// property for us to use. // property for us to use.
let userDisplayName; let userDisplayName;