Thu, 15 Jan 2015 15:55:04 +0100
Back out 97036ab72558 which inappropriately compared turds to third parties.
1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <head>
3 <title>Storage interface</title>
5 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
8 <script type="text/javascript">
10 function startTest()
11 {
12 var functionCalled = false;
13 is(localStorage instanceof Storage, true, "localStorage is instance of Storage");
14 Storage.prototype.exists = function(key) {
15 functionCalled = true;
16 return this.getItem(key) != null;
17 }
18 localStorage.setItem("test_prototype", "value");
19 is(functionCalled, false, "Overridden function not called");
20 is(localStorage.exists("test_prototype"), true, "Prototype overridden");
21 is(functionCalled, true, "Overridden function called");
22 localStorage.clear();
24 SimpleTest.finish();
25 }
27 SimpleTest.waitForExplicitFinish();
29 </script>
31 </head>
33 <body onload="startTest();">
34 </body>
35 </html>