3 <script src=
"../http/tests/inspector/inspector-test.js"></script>
11 '{"id":"not a number"}',
12 '{"id":1,"method":1}',
13 '{"id":2,"method":"resourceContent"}',
14 '{"id":3,"method":"DOM.test"}',
15 '{"id":4,"method":"Page.getResourceContent"}',
16 '{"id":5,"method":"Page.getResourceContent","params":[]}',
17 '{"id":6,"method":"Page.getResourceContent","params":{}}',
18 '{"id":7,"method":"Page.getResourceContent","params":{"frameId":"not a number"}}',
19 '{"id":8,"method":"Page.test"}',
20 '{"id":9,"method":"Page.test" }',
21 '{"id":10,"method": "Page.test" }',
22 '{"id":11,"method" : "Page.test" }',
23 '{"id":12, "method" : "Page.test" }',
24 '{"id": 13, "method" : "Page.test" }',
25 '{"id" : 14, "method" : "Page.test" }',
26 '{ "id" : 15, "method" : "Page.test" }',
27 '{ "id"\n :\r 16,\t "method" : "Page.test" }',
30 var numberOfReports
= 0;
32 InspectorBackendClass
.reportProtocolError = function(error
, message
)
34 if (numberOfReports
< messages
.length
) {
35 InspectorTest
.addObject(message
);
36 InspectorTest
.addResult("-------------------------------------------------------");
39 if (++numberOfReports
=== messages
.length
)
40 InspectorTest
.completeTest();
44 for (var i
= 0; i
< messages
.length
; ++i
)
45 InspectorFrontendHost
.sendMessageToBackend(messages
[i
]);
48 InspectorTest
.DebuggerAgent
.disable(fire
);
54 <body onload=
"runTest()">
56 Tests that InspectorBackendDispatcher is catching incorrect messages.