michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: const URL = "data:text/html;charset=utf8,
JavaScript Profiler test
"; michael@0: michael@0: let gTab, gPanel; michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: setUp(URL, function onSetUp(tab, browser, panel) { michael@0: gTab = tab; michael@0: gPanel = panel; michael@0: michael@0: function done() { michael@0: tearDown(gTab, () => { gPanel = null; gTab = null; }); michael@0: } michael@0: michael@0: Services.prefs.setBoolPref(SHOW_PLATFORM_DATA, false); michael@0: recordProfile() michael@0: .then(toggleGeckoDataOption) michael@0: .then(recordProfile) michael@0: .then(done); michael@0: }); michael@0: } michael@0: michael@0: function recordProfile() { michael@0: let deferred = promise.defer(); michael@0: let record = gPanel.controls.record; michael@0: michael@0: gPanel.once("started", () => { michael@0: gPanel.once("parsed", () => { michael@0: // We cannot be sure which data is returned by michael@0: // the profiler within a test. Until we get rid michael@0: // of Cleopatra, at least. michael@0: deferred.resolve(); michael@0: }); michael@0: michael@0: record.click(); michael@0: }); michael@0: michael@0: record.click(); michael@0: return deferred.promise; michael@0: } michael@0: michael@0: function toggleGeckoDataOption() { michael@0: ok(!gPanel.showPlatformData, "showPlatformData is not set"); michael@0: michael@0: Services.prefs.setBoolPref(SHOW_PLATFORM_DATA, true); michael@0: michael@0: ok(gPanel.showPlatformData, "showPlatformData is set"); michael@0: }