Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <!--
5 https://bugzilla.mozilla.org/show_bug.cgi?id=403852
6 -->
7 <title>Test for Bug 403852</title>
8 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
10 </head>
12 <body>
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=403852">Mozilla Bug 403852</a>
14 <p id="display">
15 <input id="fileList" type="file"></input>
16 <canvas id="canvas"></canvas>
17 </p>
18 <div id="content" style="display: none">
19 </div>
21 <pre id="test">
22 <script class="testbody" type="text/javascript">
24 var testFile = SpecialPowers.Services.dirsvc.get("ProfD", SpecialPowers.Ci.nsIFile);
25 testFile.append("prefs.js");
27 var fileList = document.getElementById('fileList');
28 SpecialPowers.wrap(fileList).value = testFile.path;
30 // Make sure the file is accessible with indexed notation
31 var domFile = fileList.files[0];
33 is(domFile.name, "prefs.js", "fileName should be prefs.js");
35 ok("lastModifiedDate" in domFile, "lastModifiedDate must be present");
37 var d = new Date(testFile.lastModifiedTime);
38 ok(d.getTime() == domFile.lastModifiedDate.getTime(), "lastModifiedDate should be the same.");
40 var cf = document.getElementById("canvas").mozGetAsFile("canvFile");
42 var x = new Date();
43 var y = cf.lastModifiedDate;
44 var z = new Date();
46 ok((x.getTime() <= y.getTime()) && (y.getTime() <= z.getTime()), "lastModifiedDate of file which does not have last modified date should be current time");
48 </script>
49 </pre>
50 </body> </html>