gecko-dev/dom/smil/test/test_smilXHR.xhtml
Brian Grinstead 0d460e3432 Bug 1544322 - Part 2.2 - Remove the [type] attribute for one-liner <script> tags loading files in /tests/SimpleTest/ in dom/ r=bzbarsky
This is split from the previous changeset since if we include dom/ the file size is too
large for phabricator to handle.

This is an autogenerated commit to handle scripts loading mochitest harness files, in
the simple case where the script src is on the same line as the tag.

This was generated with https://bug1544322.bmoattachments.org/attachment.cgi?id=9058170
using the `--part 2` argument.

Differential Revision: https://phabricator.services.mozilla.com/D27457

--HG--
extra : moz-landing-system : lando
2019-04-16 03:53:28 +00:00

89 lines
2.5 KiB
HTML

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test for SMIL Behavior in Data Documents</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="smilTestUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=529387">Mozilla Bug 529387</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
<![CDATA[
/** Test for SMIL Behavior in Data Documents, with XMLHttpRequest **/
SimpleTest.waitForExplicitFinish();
function tryPausing(svg) {
// Check that pausing has no effect
ok(!svg.animationsPaused(),
"shouldn't be paused (because we shouldn't have even started");
svg.pauseAnimations();
ok(!svg.animationsPaused(), "attempts to pause should have no effect");
svg.unpauseAnimations();
ok(!svg.animationsPaused(), "still shouldn't be paused, after pause/unpause");
}
function trySeeking(svg) {
// Check that seeking is ineffective
is(svg.getCurrentTime(), 0, "should start out at time=0");
svg.setCurrentTime(1);
is(svg.getCurrentTime(), 0, "shouldn't be able to seek away from time=0");
}
function tryBeginEnd(anim) {
// Check that beginning / ending a particular animation element will trigger
// exceptions.
var didThrow = false;
ok(anim, "need a non-null animate element");
try {
anim.beginElement();
} catch (e) {
didThrow = true;
}
ok(didThrow, "beginElement should fail");
didThrow = false;
try {
anim.endElement();
} catch (e) {
didThrow = true;
}
ok(didThrow, "endElement should fail");
}
function main() {
var xhr = new XMLHttpRequest();
xhr.open("GET", "smilXHR_helper.svg", false);
xhr.send();
var xdoc = xhr.responseXML;
var svg = xdoc.getElementById("svg");
var circ = xdoc.getElementById("circ");
var animXML = xdoc.getElementById("animXML");
var animCSS = xdoc.getElementById("animCSS");
tryPausing(svg);
trySeeking(svg);
tryBeginEnd(animXML);
tryBeginEnd(animCSS);
// Check that the actual values of our animated attr/prop aren't affected
is(circ.cx.animVal.value, circ.cx.baseVal.value,
"animation of attribute shouldn't be taking effect");
is(SMILUtil.getComputedStyleSimple(circ, "opacity"), "1",
"animation of CSS property shouldn't be taking effect");
SimpleTest.finish();
}
window.addEventListener("load", main);
]]>
</script>
</pre>
</body>
</html>