Bug 943152 - Tests. r=jgriffin

This commit is contained in:
Bobby Holley 2013-12-04 19:15:40 -08:00
parent 995f82531d
commit 2cd2b2d5d1
4 changed files with 20 additions and 2 deletions

View File

@ -22,7 +22,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=361111
SimpleTest.waitForExplicitFinish();
document.documentElement.setAttribute("onclick", "%");
is(1, 1, "Good, setting a bogus onclick did not throw.");
SimpleTest.finish();
// Bonus test - make sure that flushPrefEnv is appropriately
// called at the end of the test. It would be nice if there were
// somewhere in the harness that this could live, but there isn't.
SpecialPowers.pushPrefEnv({set: [['testing.some_arbitrary_pref', true]]},
function() { SimpleTest.finish(); });
]]></script>
</window>

View File

@ -19,6 +19,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=448587.xul
<script type="application/javascript">
<![CDATA[
// Bonus test - collaborate with test_bug361111.xul to make sure that
// flushPrefEnv is appropriately called.
ok(!SpecialPowers.Services.prefs.prefHasUserValue('testing.some_arbitrary_pref'),
"Pref shouldn't carry over from previous test!");
/** Test for Bug 448587 **/
const Cu = Components.utils;
var sandbox = new Cu.Sandbox("about:blank");

View File

@ -161,7 +161,12 @@ function starttest(){
// bug 855192
ok(SpecialPowers.MockPermissionPrompt, "check mock permission prompt");
SimpleTest.finish();
// Set a pref using pushPrefEnv to make sure that flushPrefEnv is
// automatically called before we invoke
// test_SpecialPowersExtension2.html.
SpecialPowers.pushPrefEnv({set: [['testing.some_arbitrary_pref', true]]},
function() { SimpleTest.finish(); });
}
</script>
</pre>

View File

@ -11,6 +11,8 @@
<script type="text/javascript">
dump("\nSPECIALPTEST2:::Loading test2 file now " + (new Date).getTime() + "\n");
is(SpecialPowers.sanityCheck(), "foo", "Special Powers top level");
ok(!SpecialPowers.Services.prefs.prefHasUserValue('testing.some_arbitrary_pref'),
"should not retain pref from previous test");
</script>
<iframe id="frame1" src="file_SpecialPowersFrame1.html">
</iframe>