diff -r 000000000000 -r 6474c204b198 browser/devtools/profiler/test/browser_profiler_escape.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/browser/devtools/profiler/test/browser_profiler_escape.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,43 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +const URL = "data:text/html;charset=utf8,

JavaScript Profiler test

"; + +let gTab, gPanel; + +function test() { + waitForExplicitFinish(); + + setUp(URL, function (tab, browser, panel) { + gTab = tab; + gPanel = panel; + + let record = gPanel.controls.record; + + gPanel.once("started", () => { + gPanel.once("stopped", () => { + let [ win, doc ] = getProfileInternals(gPanel.activeProfile.uid); + + let expl = ""; + let expl2 = ""; + + is(win.escapeHTML(expl), + "<script>function f() {}</script></textarea><img/src='about:logo'>"); + + is(win.escapeHTML(expl2), + "<script>function f() {}</script></pre><img/src='about:logo'>"); + + tearDown(gTab, () => { + gTab = null; + gPanel = null; + }); + }); + + setTimeout(() => { + record.click(); + }, 50); + }); + + record.click(); + }); +} \ No newline at end of file