editor/composer/test/test_bug738440.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/editor/composer/test/test_bug738440.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,37 @@
     1.4 +<!doctype html>
     1.5 +<!--
     1.6 +https://bugzilla.mozilla.org/show_bug.cgi?id=738440
     1.7 +-->
     1.8 +<title>Test for Bug 738440</title>
     1.9 +<script src="/tests/SimpleTest/SimpleTest.js"></script>
    1.10 +<link rel="stylesheet" href="/tests/SimpleTest/test.css" />
    1.11 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=738440">Mozilla Bug 738440</a>
    1.12 +<div contenteditable></div>
    1.13 +<script>
    1.14 +
    1.15 +/** Test for Bug 738440 **/
    1.16 +document.execCommand("stylewithcss", false, "true");
    1.17 +is(document.queryCommandState("stylewithcss"), true,
    1.18 +   "setting stylewithcss to true should cause its state to be true");
    1.19 +is(document.queryCommandState("usecss"), false,
    1.20 +   "usecss state should always be false");
    1.21 +
    1.22 +document.execCommand("stylewithcss", false, "false");
    1.23 +is(document.queryCommandState("stylewithcss"), false,
    1.24 +   "setting stylewithcss to false should cause its state to be false");
    1.25 +is(document.queryCommandState("usecss"), false,
    1.26 +   "usecss state should always be false");
    1.27 +
    1.28 +document.execCommand("usecss", false, "true");
    1.29 +is(document.queryCommandState("stylewithcss"), false,
    1.30 +   "setting usecss to true should cause stylewithcss state to be false");
    1.31 +is(document.queryCommandState("usecss"), false,
    1.32 +   "usecss state should always be false");
    1.33 +
    1.34 +document.execCommand("usecss", false, "false");
    1.35 +is(document.queryCommandState("stylewithcss"), true,
    1.36 +   "setting usecss to false should cause stylewithcss state to be true");
    1.37 +is(document.queryCommandState("usecss"), false,
    1.38 +   "usecss state should always be false");
    1.39 +
    1.40 +</script>

mercurial