3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../../http/tests/inspector/debugger-test.js"></script>
8 function testFunction()
10 debugger; // <- will turn on async call stacks here.
16 p1
= Promise
.reject(new Error("EXPECTED"));
31 setTimeout(func3
.bind(null, resolve
, reject
), 50);
34 function func3(resolve
, reject
)
36 p3
= p1
.catch(function() {});
44 debugger; // <- will stop the test here.
49 var maxAsyncCallStackDepth
= 4;
52 InspectorTest
.addSniffer(WebInspector
.TabbedPane
.prototype, "changeTabView", onChangeTabView
, true);
53 WebInspector
.inspectorView
.showViewInDrawer("promises", true);
55 function onChangeTabView(id
, view
)
57 if (!promisePane
&& id
=== "promises") {
59 InspectorTest
.assertTrue(promisePane
instanceof WebInspector
.PromisePane
);
60 InspectorTest
.startDebuggerTest(step1
, true);
64 function dumpPromiseDataGrid(callback
)
66 promisePane
._dataGrid
._update();
67 var result
= InspectorTest
.dumpDataGridIntoString(promisePane
._dataGrid
);
68 result
= result
.replace(/\|\s+\d+\s+\w*\s*\|/g, "| <number> ms |");
69 InspectorTest
.addResult(result
);
76 InspectorTest
.runTestFunctionAndWaitUntilPaused(step2
);
81 InspectorTest
.DebuggerAgent
.setAsyncCallStackDepth(maxAsyncCallStackDepth
, step3
);
86 InspectorTest
.addResult("Is drawer visible: " + WebInspector
.inspectorView
.drawerVisible());
87 InspectorTest
.addResult("Selected view in drawer: " + WebInspector
.inspectorView
.selectedViewInDrawer());
88 InspectorTest
.resumeExecution(InspectorTest
.waitUntilPaused
.bind(InspectorTest
, dumpPromiseDataGrid
.bind(null, step4
)));
95 "promise-pane.html:38",
100 var text
= searchValues
.shift();
102 InspectorTest
.completeDebuggerTest();
105 InspectorTest
.addResult("\nSetting search value: " + text
);
106 promisePane
._textFilterUI
.setValue(text
);
107 promisePane
._refresh();
108 dumpPromiseDataGrid(step4
);
115 <body onload=
"runTest()">
117 Tests promise pane view.