mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
Bug 806748 - Intermittent browser_dbg_location-changes-blank.js | The source editor not have any text displayed. - Got 546, expected 0, r=rcampbell
This commit is contained in:
parent
de250abaca
commit
7af0261d05
@ -13,43 +13,61 @@ var gDebugger = null;
|
||||
|
||||
function test()
|
||||
{
|
||||
let scriptShown = false;
|
||||
let framesAdded = false;
|
||||
|
||||
debug_tab_pane(STACK_URL, function(aTab, aDebuggee, aPane) {
|
||||
gTab = aTab;
|
||||
gDebuggee = aDebuggee;
|
||||
gPane = aPane;
|
||||
gDebugger = gPane.contentWindow;
|
||||
|
||||
testSimpleCall();
|
||||
gDebugger.DebuggerController.activeThread.addOneTimeListener("framesadded", function() {
|
||||
framesAdded = true;
|
||||
runTest();
|
||||
});
|
||||
|
||||
gDebuggee.simpleCall();
|
||||
});
|
||||
|
||||
window.addEventListener("Debugger:SourceShown", function _onEvent(aEvent) {
|
||||
let url = aEvent.detail.url;
|
||||
if (url.indexOf("browser_dbg_stack") != -1) {
|
||||
scriptShown = true;
|
||||
window.removeEventListener(aEvent.type, _onEvent);
|
||||
runTest();
|
||||
}
|
||||
});
|
||||
|
||||
function runTest()
|
||||
{
|
||||
if (scriptShown && framesAdded) {
|
||||
Services.tm.currentThread.dispatch({ run: testSimpleCall }, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function testSimpleCall() {
|
||||
gDebugger.DebuggerController.activeThread.addOneTimeListener("framesadded", function() {
|
||||
Services.tm.currentThread.dispatch({
|
||||
run: function() {
|
||||
var frames = gDebugger.DebuggerView.StackFrames._container._list,
|
||||
childNodes = frames.childNodes;
|
||||
var frames = gDebugger.DebuggerView.StackFrames._container._list,
|
||||
childNodes = frames.childNodes;
|
||||
|
||||
is(gDebugger.DebuggerController.activeThread.state, "paused",
|
||||
"Should only be getting stack frames while paused.");
|
||||
is(gDebugger.DebuggerController.activeThread.state, "paused",
|
||||
"Should only be getting stack frames while paused.");
|
||||
|
||||
is(frames.querySelectorAll(".dbg-stackframe").length, 1,
|
||||
"Should have only one frame.");
|
||||
is(frames.querySelectorAll(".dbg-stackframe").length, 1,
|
||||
"Should have only one frame.");
|
||||
|
||||
is(childNodes.length, frames.querySelectorAll(".dbg-stackframe").length,
|
||||
"All children should be frames.");
|
||||
is(childNodes.length, frames.querySelectorAll(".dbg-stackframe").length,
|
||||
"All children should be frames.");
|
||||
|
||||
isnot(gDebugger.DebuggerView.Sources.selectedValue, null,
|
||||
"There should be a selected script.");
|
||||
isnot(gDebugger.editor.getText().length, 0,
|
||||
"The source editor should have some text displayed.");
|
||||
isnot(gDebugger.DebuggerView.Sources.selectedValue, null,
|
||||
"There should be a selected script.");
|
||||
isnot(gDebugger.editor.getText().length, 0,
|
||||
"The source editor should have some text displayed.");
|
||||
isnot(gDebugger.editor.getText(), gDebugger.L10N.getStr("loadingText"),
|
||||
"The source editor text should not be 'Loading...'");
|
||||
|
||||
testLocationChange();
|
||||
}
|
||||
}, 0);
|
||||
});
|
||||
|
||||
gDebuggee.simpleCall();
|
||||
testLocationChange();
|
||||
}
|
||||
|
||||
function testLocationChange()
|
||||
|
@ -13,43 +13,61 @@ var gDebugger = null;
|
||||
|
||||
function test()
|
||||
{
|
||||
let scriptShown = false;
|
||||
let framesAdded = false;
|
||||
|
||||
debug_tab_pane(STACK_URL, function(aTab, aDebuggee, aPane) {
|
||||
gTab = aTab;
|
||||
gDebuggee = aDebuggee;
|
||||
gPane = aPane;
|
||||
gDebugger = gPane.contentWindow;
|
||||
|
||||
testSimpleCall();
|
||||
gDebugger.DebuggerController.activeThread.addOneTimeListener("framesadded", function() {
|
||||
framesAdded = true;
|
||||
runTest();
|
||||
});
|
||||
|
||||
gDebuggee.simpleCall();
|
||||
});
|
||||
|
||||
window.addEventListener("Debugger:SourceShown", function _onEvent(aEvent) {
|
||||
let url = aEvent.detail.url;
|
||||
if (url.indexOf("browser_dbg_stack") != -1) {
|
||||
scriptShown = true;
|
||||
window.removeEventListener(aEvent.type, _onEvent);
|
||||
runTest();
|
||||
}
|
||||
});
|
||||
|
||||
function runTest()
|
||||
{
|
||||
if (scriptShown && framesAdded) {
|
||||
Services.tm.currentThread.dispatch({ run: testSimpleCall }, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function testSimpleCall() {
|
||||
gDebugger.DebuggerController.activeThread.addOneTimeListener("framesadded", function() {
|
||||
Services.tm.currentThread.dispatch({
|
||||
run: function() {
|
||||
var frames = gDebugger.DebuggerView.StackFrames._container._list,
|
||||
childNodes = frames.childNodes;
|
||||
var frames = gDebugger.DebuggerView.StackFrames._container._list,
|
||||
childNodes = frames.childNodes;
|
||||
|
||||
is(gDebugger.DebuggerController.activeThread.state, "paused",
|
||||
"Should only be getting stack frames while paused.");
|
||||
is(gDebugger.DebuggerController.activeThread.state, "paused",
|
||||
"Should only be getting stack frames while paused.");
|
||||
|
||||
is(frames.querySelectorAll(".dbg-stackframe").length, 1,
|
||||
"Should have only one frame.");
|
||||
is(frames.querySelectorAll(".dbg-stackframe").length, 1,
|
||||
"Should have only one frame.");
|
||||
|
||||
is(childNodes.length, frames.querySelectorAll(".dbg-stackframe").length,
|
||||
"All children should be frames.");
|
||||
is(childNodes.length, frames.querySelectorAll(".dbg-stackframe").length,
|
||||
"All children should be frames.");
|
||||
|
||||
isnot(gDebugger.DebuggerView.Sources.selectedValue, null,
|
||||
"There should be a selected script.");
|
||||
isnot(gDebugger.editor.getText().length, 0,
|
||||
"The source editor should have some text displayed.");
|
||||
isnot(gDebugger.DebuggerView.Sources.selectedValue, null,
|
||||
"There should be a selected script.");
|
||||
isnot(gDebugger.editor.getText().length, 0,
|
||||
"The source editor should have some text displayed.");
|
||||
isnot(gDebugger.editor.getText(), gDebugger.L10N.getStr("loadingText"),
|
||||
"The source editor text should not be 'Loading...'");
|
||||
|
||||
testLocationChange();
|
||||
}
|
||||
}, 0);
|
||||
});
|
||||
|
||||
gDebuggee.simpleCall();
|
||||
testLocationChange();
|
||||
}
|
||||
|
||||
function testLocationChange()
|
||||
|
Loading…
Reference in New Issue
Block a user