1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/devtools/debugger/test/browser_dbg_aaa_run_first_leaktest.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,28 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +/** 1.8 + * This tests if the debugger leaks on initialization and sudden destruction. 1.9 + * You can also use this initialization format as a template for other tests. 1.10 + * If leaks happen here, there's something very, very fishy going on. 1.11 + */ 1.12 + 1.13 +const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html"; 1.14 + 1.15 +function test() { 1.16 + // Wait longer for this very simple test that comes first, to make sure that 1.17 + // GC from previous tests does not interfere with the debugger suite. 1.18 + requestLongerTimeout(2); 1.19 + 1.20 + initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => { 1.21 + ok(aTab, "Should have a tab available."); 1.22 + ok(aDebuggee, "Should have a debuggee available."); 1.23 + ok(aPanel, "Should have a debugger pane available."); 1.24 + 1.25 + waitForSourceAndCaretAndScopes(aPanel, "-02.js", 1).then(() => { 1.26 + resumeDebuggerThenCloseAndFinish(aPanel); 1.27 + }); 1.28 + 1.29 + aDebuggee.firstCall(); 1.30 + }); 1.31 +}