2 <?xml-stylesheet href=
"chrome://global/skin" type=
"text/css"?>
4 <window id=
"303267Test"
5 xmlns=
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
9 title=
"bug 582176 test">
11 <script type=
"application/javascript" src=
"chrome://mochikit/content/chrome-harness.js" />
12 <script type=
"application/javascript" src=
"docshell_helpers.js" />
13 <script type=
"application/javascript"><![CDATA[
17 async function runTest()
21 var notificationCount =
0;
23 let onGlobalCreation = () =
> {
27 await promisePageNavigation({
28 uri:
"http://mochi.test:8888/chrome/docshell/test/chrome/582176_dummy.html",
31 is(await SpecialPowers.spawn(TestWindow.getBrowser(), [], () =
> {
32 let testVar = content.testVar;
36 "variable unexpectedly there already");
37 is(notificationCount,
1,
"Should notify on first navigation");
39 await promisePageNavigation({
40 uri:
"http://mochi.test:8888/chrome/docshell/test/chrome/582176_dummy.html?2",
43 is(await SpecialPowers.spawn(TestWindow.getBrowser(), [], () =
> {
44 return content.testVar;
46 "variable should no longer be there");
47 is(notificationCount,
2,
"Should notify on second navigation");
49 await promisePageNavigation({
52 is(await SpecialPowers.spawn(TestWindow.getBrowser(), [], () =
> {
53 return content.testVar;
55 "variable should still be there");
56 is(notificationCount,
2,
"Should not notify on back navigation");
58 await promisePageNavigation({
59 uri:
"http://mochi.test:8888/chrome/docshell/test/chrome/582176_xml.xml",
62 is(await SpecialPowers.spawn(TestWindow.getBrowser(), [], () =
> {
63 return content.document.body.textContent;
65 "Transform performed successfully");
66 is(notificationCount,
3,
"Should notify only once on XSLT navigation");
68 // Tell the framework the test is finished.
73 <browser type=
"content" primary=
"true" flex=
"1" id=
"content" remote=
"true" maychangeremoteness=
"true" />