Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / sources / debugger / async-callstack-get-as-string.html
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
7 function testFunction()
8 {
9     setTimeout(timeout, 0);
10 }
11
12 function timeout()
13 {
14     window.addEventListener("paste", onPaste, false);
15
16     var input = document.getElementById("input");
17     input.value = "value";
18     input.focus();
19     input.select();
20     document.execCommand("Copy");
21
22     input.value = "";
23     input.focus();
24     document.execCommand("Paste");
25 }
26
27 function onPaste(e)
28 {
29     debugger;
30     window.removeEventListener("paste", onPaste, false);
31     var items = (e.originalEvent || e).clipboardData.items;
32     var item = items[0];
33     item.getAsString(onGetAsString);
34 }
35
36 function onGetAsString()
37 {
38     debugger;
39 }
40
41 function test()
42 {
43     var totalDebuggerStatements = 2;
44     var maxAsyncCallStackDepth = 4;
45     InspectorTest.runAsyncCallStacksTest(totalDebuggerStatements, maxAsyncCallStackDepth);
46 }
47
48 </script>
49 </head>
50
51 <body onload="runTest()">
52 <input type="text" id="input"></input>
53 <p>
54 Tests asynchronous call stacks for DataTransferItem.getAsString.
55 </p>
56
57 </body>
58 </html>