bd8446968d883c9df7f5812025dfa37cd6e98851
[WebKit-https.git] / LayoutTests / inspector / report-API-errors.html
1 <html>
2 <head>
3 <script src="../http/tests/inspector/inspector-test.js"></script>
4 <script>
5
6 function test()
7 {
8
9     console.error = function()
10     {
11         InspectorTest.addResult(String.sprintf.apply(this, arguments));
12     }
13
14     ConsoleAgent.setMonitoringXHREnabled(1);
15     ConsoleAgent.setMonitoringXHREnabled();
16     ConsoleAgent.setMonitoringXHREnabled(false, "not a function");
17     ConsoleAgent.setMonitoringXHREnabled(false, undefined);
18     RuntimeAgent.evaluate("true", "test");
19     RuntimeAgent.evaluate("true", "test", function(){});
20     RuntimeAgent.evaluate("true", "test", undefined, function(){});
21     InspectorBackend.dispatch('{"type": "event", "domain": "wrongDomain", "event": "something-strange", "data": {}}');
22     InspectorBackend.dispatch('{"type": "event", "domain": "Inspector", "event": "something-strange", "data": {}}');
23
24     InspectorTest.completeTest();
25 }
26
27 </script>
28 </head>
29
30 <body onload="runTest()">
31 <p>
32 Tests that InspectorBackendStub is catching incorrect arguments.
33 </p>
34
35 </body>
36 </html>