Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / console / console-tainted-globals.html
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/console-test.js"></script>
5 <script>
6
7 function foo()
8 {
9     Object.defineProperty(Array.prototype, "push", {
10         get: function () { throw new Error("FAIL"); }
11     });
12     Object.defineProperty(Math, "max", {
13         get: function () { throw new Error("FAIL"); }
14     });
15     return [1, 2, 3];
16 }
17
18 function test()
19 {
20     InspectorTest.evaluateInConsole("foo()");
21     InspectorTest.runAfterPendingDispatches(step1);
22
23     function step1()
24     {
25         InspectorTest.dumpConsoleMessages();
26         InspectorTest.completeTest();
27     }
28 }
29 </script>
30 </head>
31
32 <body onload="runTest()">
33 <p>
34 Tests that overriding global methods (like Array.prototype.push, Math.max) will not break the inspector.
35 </p>
36
37 </body>
38 </html>