Bug 853003 - Clear the scrolling interval when cleaning up in browser_dbg_stack-03.js. r=me, a=test-only
authorVictor Porof <vporof@mozilla.com>
Tue, 17 Sep 2013 10:47:37 +0300
changeset 160315 9635324eac4060fc08ceabfb58b7d202e66ac8dc
parent 160314 c3cd681e553d44d30773b4a13078eac2f63cc85c
child 160316 2a903a84368e61b8bdebfe1bbc7f69d68cf0c08d
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme, test-only
bugs853003
milestone26.0a2
Bug 853003 - Clear the scrolling interval when cleaning up in browser_dbg_stack-03.js. r=me, a=test-only
browser/devtools/debugger/test/browser_dbg_stack-03.js
--- a/browser/devtools/debugger/test/browser_dbg_stack-03.js
+++ b/browser/devtools/debugger/test/browser_dbg_stack-03.js
@@ -3,17 +3,17 @@
 
 /**
  * Test that stackframes are scrollable.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_recursion-stack.html";
 
 let gTab, gDebuggee, gPanel, gDebugger;
-let gFrames;
+let gFrames, gFramesScrollingInterval;
 
 function test() {
   initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
     gTab = aTab;
     gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gFrames = gDebugger.DebuggerView.StackFrames;
@@ -35,26 +35,29 @@ function performTest() {
     is(gFrames.itemCount, gDebugger.gCallStackPageSize * 2,
       "Should now have twice the max limit of frames.");
 
     gDebugger.gThreadClient.addOneTimeListener("framesadded", () => {
       is(gFrames.itemCount, gDebuggee.gRecurseLimit,
         "Should have reached the recurse limit.");
 
       gDebugger.gThreadClient.resume(() => {
-        window.clearInterval(scrollingIntervalId);
+        window.clearInterval(gFramesScrollingInterval);
         closeDebuggerAndFinish(gPanel);
       });
     });
   });
 
-  let scrollingIntervalId = window.setInterval(() => {
+  gFramesScrollingInterval = window.setInterval(() => {
     gFrames.widget._list.scrollByIndex(-1);
   }, 100);
 }
 
 registerCleanupFunction(function() {
+  window.clearInterval(gFramesScrollingInterval);
+  gFramesScrollingInterval = null;
+
   gTab = null;
   gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gFrames = null;
 });