2012-02-07 09:22:30 -08:00
|
|
|
/* vim:set ts=2 sw=2 sts=2 et: */
|
|
|
|
/*
|
|
|
|
* Any copyright is dedicated to the Public Domain.
|
|
|
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
|
|
|
*/
|
|
|
|
var gPane = null;
|
|
|
|
var gTab = null;
|
|
|
|
var gDebuggee = null;
|
|
|
|
var gDebugger = null;
|
|
|
|
|
|
|
|
function test() {
|
|
|
|
debug_tab_pane(STACK_URL, function(aTab, aDebuggee, aPane) {
|
|
|
|
gTab = aTab;
|
|
|
|
gDebuggee = aDebuggee;
|
|
|
|
gPane = aPane;
|
2012-05-03 10:36:40 -07:00
|
|
|
gDebugger = gPane.contentWindow;
|
2012-02-07 09:22:30 -08:00
|
|
|
|
|
|
|
testSimpleCall();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function testSimpleCall() {
|
2012-04-08 22:15:47 -07:00
|
|
|
gDebugger.DebuggerController.activeThread.addOneTimeListener("framesadded", function() {
|
2012-02-07 09:22:30 -08:00
|
|
|
Services.tm.currentThread.dispatch({ run: function() {
|
|
|
|
|
|
|
|
let testScope = gDebugger.DebuggerView.Properties._addScope("test");
|
|
|
|
let testVar = testScope.addVar("something");
|
|
|
|
|
2012-10-05 11:20:47 -07:00
|
|
|
let properties = testVar.addProperties({
|
|
|
|
"child": {
|
|
|
|
"value": {
|
|
|
|
"type": "object",
|
|
|
|
"class": "Object"
|
|
|
|
},
|
|
|
|
|
|
|
|
"enumerable": true
|
|
|
|
}
|
|
|
|
});
|
2012-02-07 09:22:30 -08:00
|
|
|
|
|
|
|
is(testVar.querySelector(".details").childNodes.length, 1,
|
|
|
|
"A new detail node should have been added in the variable tree.");
|
|
|
|
|
|
|
|
ok(testVar.child,
|
|
|
|
"The added detail property should be accessible from the variable.");
|
|
|
|
|
|
|
|
is(testVar.child, properties.child,
|
|
|
|
"Adding a detail property should return that exact property.");
|
|
|
|
|
|
|
|
|
2012-10-05 11:20:47 -07:00
|
|
|
let properties2 = testVar.child.addProperties({
|
|
|
|
"grandchild": {
|
|
|
|
"value": {
|
|
|
|
"type": "object",
|
|
|
|
"class": "Object"
|
|
|
|
},
|
|
|
|
|
|
|
|
"enumerable": true
|
|
|
|
}
|
|
|
|
});
|
2012-02-07 09:22:30 -08:00
|
|
|
|
|
|
|
is(testVar.child.querySelector(".details").childNodes.length, 1,
|
|
|
|
"A new detail node should have been added in the variable tree.");
|
|
|
|
|
|
|
|
ok(testVar.child.grandchild,
|
|
|
|
"The added detail property should be accessible from the variable.");
|
|
|
|
|
|
|
|
is(testVar.child.grandchild, properties2.grandchild,
|
|
|
|
"Adding a detail property should return that exact property.");
|
|
|
|
|
|
|
|
|
|
|
|
testVar.child.empty();
|
|
|
|
|
|
|
|
is(testVar.child.querySelector(".details").childNodes.length, 0,
|
|
|
|
"The child should remove all it's details container tree children.");
|
|
|
|
|
|
|
|
testVar.child.remove();
|
|
|
|
|
|
|
|
is(testVar.querySelector(".details").childNodes.length, 0,
|
|
|
|
"The child should have been removed from the parent container tree.");
|
|
|
|
|
|
|
|
|
|
|
|
testVar.empty();
|
|
|
|
|
|
|
|
is(testVar.querySelector(".details").childNodes.length, 0,
|
|
|
|
"The var should remove all it's details container tree children.");
|
|
|
|
|
|
|
|
testVar.remove();
|
|
|
|
|
|
|
|
is(testScope.querySelector(".details").childNodes.length, 0,
|
|
|
|
"The var should have been removed from the parent container tree.");
|
|
|
|
|
2012-04-08 22:15:47 -07:00
|
|
|
gDebugger.DebuggerController.activeThread.resume(function() {
|
2012-05-31 03:01:13 -07:00
|
|
|
closeDebuggerAndFinish();
|
2012-03-06 00:22:17 -08:00
|
|
|
});
|
2012-02-07 09:22:30 -08:00
|
|
|
}}, 0);
|
|
|
|
});
|
|
|
|
|
|
|
|
gDebuggee.simpleCall();
|
|
|
|
}
|
|
|
|
|
2012-03-06 00:22:17 -08:00
|
|
|
registerCleanupFunction(function() {
|
|
|
|
removeTab(gTab);
|
|
|
|
gPane = null;
|
|
|
|
gTab = null;
|
|
|
|
gDebuggee = null;
|
|
|
|
gDebugger = null;
|
|
|
|
});
|