PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/image/test/mochitest/test_bug512435.html

http://github.com/zpao/v8monkey
HTML | 50 lines | 40 code | 7 blank | 3 comment | 0 complexity | 12a2a82b4f08b163799c6073b6014c66 MD5 | raw file
 1<!DOCTYPE HTML>
 2<html>
 3<!--
 4https://bugzilla.mozilla.org/show_bug.cgi?id=512435
 5-->
 6<head>
 7  <title>Test for Bug 512435</title>
 8  <script type="application/javascript" src="/MochiKit/MochiKit.js"></script>
 9  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
10  <script type="text/javascript" src="/tests/image/test/mochitest/imgutils.js"></script>
11  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
12</head>
13<body>
14<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=512435">Mozilla Bug 512435</a>
15<img id="img_a">
16<img id="img_b">
17</div>
18<pre id="test">
19<script type="application/javascript">
20
21// Boilerplate
22netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
23const Ci = Components.interfaces;
24const Cc = Components.classes;
25SimpleTest.waitForExplicitFinish();
26
27// We're relying on very particular behavior for certain images - clear the
28// image cache, _then_ set src
29clearImageCache();
30document.getElementById("img_a").src = "damon.jpg";
31document.getElementById("img_b").src = "shaver.png";
32
33// Our handler
34function loadHandler() {
35
36  // The two images should be decoded
37  ok(isFrameDecoded("img_a"), "img_a should be decoded before onload fires");
38  ok(isFrameDecoded("img_b"), "img_b should be decoded before onload fires");
39
40  // All done
41  SimpleTest.finish();
42}
43
44// Set our onload handler
45window.onload = loadHandler;
46
47</script>
48</pre>
49</body>
50</html>