2012-03-28 22:46:54 -07:00
|
|
|
/*
|
|
|
|
* Any copyright is dedicated to the Public Domain.
|
|
|
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Tests that iframes can be added as debuggees.
|
|
|
|
|
|
|
|
var gPane = null;
|
|
|
|
var gTab = null;
|
|
|
|
|
|
|
|
const TEST_URL = EXAMPLE_URL + "browser_dbg_iframes.html";
|
|
|
|
|
|
|
|
function test() {
|
|
|
|
debug_tab_pane(TEST_URL, function(aTab, aDebuggee, aPane) {
|
|
|
|
gTab = aTab;
|
|
|
|
gPane = aPane;
|
2012-11-30 00:07:59 -08:00
|
|
|
let gDebugger = gPane.panelWin;
|
2012-03-28 22:46:54 -07:00
|
|
|
|
2012-04-08 22:15:47 -07:00
|
|
|
is(gDebugger.DebuggerController.activeThread.paused, false,
|
2012-03-28 22:46:54 -07:00
|
|
|
"Should be running after debug_tab_pane.");
|
|
|
|
|
2012-04-08 22:15:47 -07:00
|
|
|
gDebugger.DebuggerController.activeThread.addOneTimeListener("framesadded", function() {
|
2012-03-28 22:46:54 -07:00
|
|
|
Services.tm.currentThread.dispatch({ run: function() {
|
|
|
|
|
2012-10-26 10:10:17 -07:00
|
|
|
let frames = gDebugger.DebuggerView.StackFrames._container._list;
|
2012-03-28 22:46:54 -07:00
|
|
|
let childNodes = frames.childNodes;
|
|
|
|
|
2012-04-08 22:15:47 -07:00
|
|
|
is(gDebugger.DebuggerController.activeThread.paused, true,
|
2012-03-28 22:46:54 -07:00
|
|
|
"Should be paused after an interrupt request.");
|
|
|
|
|
|
|
|
is(frames.querySelectorAll(".dbg-stackframe").length, 1,
|
|
|
|
"Should have one frame in the stack.");
|
|
|
|
|
2012-04-08 22:15:47 -07:00
|
|
|
gDebugger.DebuggerController.activeThread.addOneTimeListener("resumed", function() {
|
2012-03-28 22:46:54 -07:00
|
|
|
Services.tm.currentThread.dispatch({ run: function() {
|
2012-05-31 03:01:13 -07:00
|
|
|
closeDebuggerAndFinish();
|
2012-03-28 22:46:54 -07:00
|
|
|
}}, 0);
|
|
|
|
});
|
|
|
|
|
2012-10-26 10:10:17 -07:00
|
|
|
EventUtils.sendMouseEvent({ type: "mousedown" },
|
2012-03-28 22:46:54 -07:00
|
|
|
gDebugger.document.getElementById("resume"),
|
|
|
|
gDebugger);
|
|
|
|
}}, 0);
|
|
|
|
});
|
|
|
|
|
|
|
|
let iframe = gTab.linkedBrowser.contentWindow.wrappedJSObject.frames[0];
|
|
|
|
is(iframe.document.title, "Browser Debugger Test Tab", "Found the iframe");
|
|
|
|
|
2012-11-02 07:39:12 -07:00
|
|
|
function handler() {
|
|
|
|
if (iframe.document.readyState != "complete") {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
iframe.window.removeEventListener("load", handler, false);
|
|
|
|
executeSoon(iframe.runDebuggerStatement);
|
|
|
|
};
|
|
|
|
iframe.window.addEventListener("load", handler, false);
|
|
|
|
handler();
|
2012-03-28 22:46:54 -07:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
registerCleanupFunction(function() {
|
|
|
|
removeTab(gTab);
|
|
|
|
gPane = null;
|
|
|
|
gTab = null;
|
|
|
|
});
|