Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / debugger-ui / function-display-name-call-stack.html
blobfc4b737928b5c3c443d3838163baec5c9f257f27
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/debugger-test.js"></script>
5 <script>
6 var error = false;
8 function func1()
10 debugger;
12 func1.displayName = "my.framework.foo";
14 var func2 = (function() {
15 var f = function() { func1(); }
16 f.displayName = "my.framework.bar";
17 return f;
18 })();
20 var func3 = function() { func2(); }
21 func3.__defineGetter__("displayName", function() { error = true; throw new Error("Should not crash!"); });
23 function func4() { func3(); }
24 func4.__defineGetter__("displayName", function() { error = true; return "FAIL: Should not execute getters!"; });
26 function func5() { func4(); }
27 func5.displayName = "my.framework.func5";
28 func5.__defineSetter__("displayName", function() { error = true; throw new Error("FAIL: Should not call setter!"); });
30 function func6() { func5(); }
31 func6.displayName = { "foo": 6, toString: function() { error = true; return "FAIL: Should not call toString!"; } };
33 function testFunction()
35 (function() {
36 arguments.callee.displayName = "<anonymous_inside_testFunction>";
37 func6();
38 })();
39 console.assert(!error, "FAIL: No getter or setter or toString should have been called!");
41 testFunction.displayName = "<InspectorTest::testFunction>";
43 function test()
45 InspectorTest.startDebuggerTest(step1);
47 function step1()
49 InspectorTest.runTestFunctionAndWaitUntilPaused(step2);
52 function step2(callFrames)
54 InspectorTest.captureStackTrace(callFrames);
55 InspectorTest.completeDebuggerTest();
59 </script>
61 </head>
63 <body onload="runTest()">
64 <p>Tests that we display function's "displayName" property in the call stack.
65 <a href="http://code.google.com/p/chromium/issues/detail?id=17356">CrBug 17356</a>
66 </p>
68 </body>
69 </html>