2010-12-01 Ilya Tikhonovsky <loislo@chromium.org>
[WebKit-https.git] / LayoutTests / inspector / report-API-errors.html
1 <html>
2 <head>
3 <script src="../http/tests/inspector/inspector-test2.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     InspectorBackend.setMonitoringXHREnabled(1);
15     InspectorBackend.setMonitoringXHREnabled();
16     InspectorBackend.setMonitoringXHREnabled(true, "not a function");
17     InspectorBackend.setMonitoringXHREnabled(true, undefined);
18     InspectorBackend.setMonitoringXHREnabled(false, undefined);
19     InspectorBackend.dispatch('{"type": "event", "domain": "wrongDomain", "event": "something-strange", "data": {}}');
20     InspectorBackend.dispatch('{"type": "event", "domain": "Inspector", "event": "something-strange", "data": {}}');
21
22     InspectorTest.completeTest();
23 }
24
25 </script>
26 </head>
27
28 <body onload="runTest()">
29 <p>
30 Tests that InspectorBackendStub is catching incorrect arguments.
31 </p>
32
33 </body>
34 </html>