|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 const URL = "data:text/html;charset=utf8,<p>JavaScript Profiler test</p>"; |
|
5 |
|
6 let gTab, gPanel; |
|
7 |
|
8 function test() { |
|
9 waitForExplicitFinish(); |
|
10 |
|
11 setUp(URL, function (tab, browser, panel) { |
|
12 gTab = tab; |
|
13 gPanel = panel; |
|
14 |
|
15 let record = gPanel.controls.record; |
|
16 |
|
17 gPanel.once("started", () => { |
|
18 gPanel.once("stopped", () => { |
|
19 let [ win, doc ] = getProfileInternals(gPanel.activeProfile.uid); |
|
20 |
|
21 let expl = "<script>function f() {}</script></textarea><img/src='about:logo'>"; |
|
22 let expl2 = "<script>function f() {}</script></pre><img/src='about:logo'>"; |
|
23 |
|
24 is(win.escapeHTML(expl), |
|
25 "<script>function f() {}</script></textarea><img/src='about:logo'>"); |
|
26 |
|
27 is(win.escapeHTML(expl2), |
|
28 "<script>function f() {}</script></pre><img/src='about:logo'>"); |
|
29 |
|
30 tearDown(gTab, () => { |
|
31 gTab = null; |
|
32 gPanel = null; |
|
33 }); |
|
34 }); |
|
35 |
|
36 setTimeout(() => { |
|
37 record.click(); |
|
38 }, 50); |
|
39 }); |
|
40 |
|
41 record.click(); |
|
42 }); |
|
43 } |