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
|
|
|
|
|
|
|
testEvalCall();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function testEvalCall() {
|
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() {
|
|
|
|
|
2012-10-26 10:10:17 -07:00
|
|
|
let frames = gDebugger.DebuggerView.StackFrames._container._list;
|
2012-02-07 09:22:30 -08:00
|
|
|
let childNodes = frames.childNodes;
|
|
|
|
|
2012-04-08 22:15:47 -07:00
|
|
|
is(gDebugger.DebuggerController.activeThread.state, "paused",
|
2012-02-07 09:22:30 -08:00
|
|
|
"Should only be getting stack frames while paused.");
|
|
|
|
|
|
|
|
is(frames.querySelectorAll(".dbg-stackframe").length, 2,
|
|
|
|
"Should have two frames.");
|
|
|
|
|
|
|
|
is(childNodes.length, frames.querySelectorAll(".dbg-stackframe").length,
|
|
|
|
"All children should be frames.");
|
|
|
|
|
2012-05-20 13:49:51 -07:00
|
|
|
is(frames.querySelector("#stackframe-0 .dbg-stackframe-name").getAttribute("value"),
|
2012-02-07 09:22:30 -08:00
|
|
|
"(eval)", "Frame name should be (eval)");
|
|
|
|
|
|
|
|
ok(frames.querySelector("#stackframe-0").classList.contains("selected"),
|
|
|
|
"First frame should be selected by default.");
|
|
|
|
|
|
|
|
ok(!frames.querySelector("#stackframe-1").classList.contains("selected"),
|
|
|
|
"Second frame should not be selected.");
|
|
|
|
|
|
|
|
|
|
|
|
EventUtils.sendMouseEvent({ type: "click" },
|
|
|
|
frames.querySelector("#stackframe-1"),
|
|
|
|
gDebugger);
|
|
|
|
|
|
|
|
ok(!frames.querySelector("#stackframe-0").classList.contains("selected"),
|
|
|
|
"First frame should not be selected after click.");
|
|
|
|
|
|
|
|
ok(frames.querySelector("#stackframe-1").classList.contains("selected"),
|
|
|
|
"Second frame should be selected after click.");
|
|
|
|
|
|
|
|
|
|
|
|
EventUtils.sendMouseEvent({ type: "click" },
|
|
|
|
frames.querySelector("#stackframe-0 .dbg-stackframe-name"),
|
|
|
|
gDebugger);
|
|
|
|
|
|
|
|
ok(frames.querySelector("#stackframe-0").classList.contains("selected"),
|
|
|
|
"First frame should be selected after click inside the first frame.");
|
|
|
|
|
|
|
|
ok(!frames.querySelector("#stackframe-1").classList.contains("selected"),
|
|
|
|
"Second frame should not be selected after click inside the first frame.");
|
|
|
|
|
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.evalCall();
|
|
|
|
}
|
|
|
|
|
2012-03-06 00:22:17 -08:00
|
|
|
registerCleanupFunction(function() {
|
|
|
|
removeTab(gTab);
|
|
|
|
gPane = null;
|
|
|
|
gTab = null;
|
|
|
|
gDebuggee = null;
|
|
|
|
gDebugger = null;
|
|
|
|
});
|