| OLD | NEW |
| 1 const Cc = Components.classes; | 1 const Cc = Components.classes; |
| 2 const Ci = Components.interfaces; | 2 const Ci = Components.interfaces; |
| 3 const Cr = Components.results; | 3 const Cr = Components.results; |
| 4 const Cu = Components.utils; | 4 const Cu = Components.utils; |
| 5 | 5 |
| 6 const MILLIS_IN_SECOND = 1000; | 6 const MILLIS_IN_SECOND = 1000; |
| 7 const MILLIS_IN_MINUTE = 60 * MILLIS_IN_SECOND; | 7 const MILLIS_IN_MINUTE = 60 * MILLIS_IN_SECOND; |
| 8 const MILLIS_IN_HOUR = 60 * MILLIS_IN_MINUTE; | 8 const MILLIS_IN_HOUR = 60 * MILLIS_IN_MINUTE; |
| 9 const MILLIS_IN_DAY = 24 * MILLIS_IN_HOUR; | 9 const MILLIS_IN_DAY = 24 * MILLIS_IN_HOUR; |
| 10 | 10 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 FilterStorage.knownSubscriptions = {__proto__: null}; | 76 FilterStorage.knownSubscriptions = {__proto__: null}; |
| 77 Subscription.knownSubscriptions = {__proto__: null}; | 77 Subscription.knownSubscriptions = {__proto__: null}; |
| 78 Filter.knownFilters = {__proto__: null}; | 78 Filter.knownFilters = {__proto__: null}; |
| 79 if (!keepListeners) | 79 if (!keepListeners) |
| 80 { | 80 { |
| 81 FilterNotifierGlobal.listeners = []; | 81 FilterNotifierGlobal.listeners = []; |
| 82 } | 82 } |
| 83 | 83 |
| 84 defaultMatcher.clear(); | 84 defaultMatcher.clear(); |
| 85 ElemHide.clear(); | 85 ElemHide.clear(); |
| 86 | |
| 87 try | |
| 88 { | |
| 89 // Disable timeline functions, they slow down tests otherwise | |
| 90 let {TimeLine} = require("timeline"); | |
| 91 | |
| 92 this._backup.timelineLog = TimeLine.log; | |
| 93 this._backup.timelineEnter = TimeLine.enter; | |
| 94 this._backup.timelineLeave = TimeLine.leave; | |
| 95 | |
| 96 TimeLine.log = function(){}; | |
| 97 TimeLine.enter = function(){}; | |
| 98 TimeLine.leave = function(){}; | |
| 99 } | |
| 100 catch(e) | |
| 101 { | |
| 102 // TimeLine module might not be present, catch exceptions | |
| 103 } | |
| 104 } | 86 } |
| 105 | 87 |
| 106 function restoreFilterComponents() | 88 function restoreFilterComponents() |
| 107 { | 89 { |
| 108 let FilterNotifierGlobal = getModuleGlobal("filterNotifier"); | 90 let FilterNotifierGlobal = getModuleGlobal("filterNotifier"); |
| 109 | 91 |
| 110 FilterStorage.subscriptions = this._backup.subscriptions; | 92 FilterStorage.subscriptions = this._backup.subscriptions; |
| 111 FilterStorage.knownSubscriptions = this._backup.storageKnown; | 93 FilterStorage.knownSubscriptions = this._backup.storageKnown; |
| 112 Subscription.knownSubscriptions = this._backup.subscriptionsKnown; | 94 Subscription.knownSubscriptions = this._backup.subscriptionsKnown; |
| 113 Filter.knownFilters = this._backup.filtersKnown; | 95 Filter.knownFilters = this._backup.filtersKnown; |
| 114 FilterNotifierGlobal.listeners = this._backup.listeners; | 96 FilterNotifierGlobal.listeners = this._backup.listeners; |
| 115 Object.defineProperty(FilterStorage, "sourceFile", {value: this._backup.source
File, configurable: true}); | 97 Object.defineProperty(FilterStorage, "sourceFile", {value: this._backup.source
File, configurable: true}); |
| 116 | 98 |
| 117 scheduleReinit(); | 99 scheduleReinit(); |
| 118 | |
| 119 if ("timelineLeave" in this._backup) | |
| 120 { | |
| 121 let {TimeLine} = require("timeline"); | |
| 122 | |
| 123 TimeLine.log = this._backup.timelineLog; | |
| 124 TimeLine.enter = this._backup.timelineEnter; | |
| 125 TimeLine.leave = this._backup.timelineLeave; | |
| 126 } | |
| 127 } | 100 } |
| 128 | 101 |
| 129 // Only reinit our data structures when all the tests are done to prevent | 102 // Only reinit our data structures when all the tests are done to prevent |
| 130 // slowing down text execution | 103 // slowing down text execution |
| 131 let reinitScheduled = false; | 104 let reinitScheduled = false; |
| 132 function scheduleReinit() | 105 function scheduleReinit() |
| 133 { | 106 { |
| 134 if (reinitScheduled) | 107 if (reinitScheduled) |
| 135 return; | 108 return; |
| 136 | 109 |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 return oldFinish.apply(this, arguments); | 521 return oldFinish.apply(this, arguments); |
| 549 } | 522 } |
| 550 window.addEventListener("unload", function() | 523 window.addEventListener("unload", function() |
| 551 { | 524 { |
| 552 debuggerService.off(); | 525 debuggerService.off(); |
| 553 }, true); | 526 }, true); |
| 554 debuggerService.on(); | 527 debuggerService.on(); |
| 555 debuggerService.flags |= debuggerService.COLLECT_PROFILE_DATA; | 528 debuggerService.flags |= debuggerService.COLLECT_PROFILE_DATA; |
| 556 debuggerService.clearProfileData(); | 529 debuggerService.clearProfileData(); |
| 557 } | 530 } |
| OLD | NEW |