| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../http/tests/inspector/inspector-test.js"></script> |
| 4 <script> | 4 <script> |
| 5 | 5 |
| 6 function test() | 6 function test() |
| 7 { | 7 { |
| 8 var messages = [ | 8 var messages = [ |
| 9 'some wrong string', | 9 'some wrong string', |
| 10 '{}', | 10 '{}', |
| 11 '{"id":"not a number"}', | 11 '{"id":"not a number"}', |
| 12 '{"id":1,"method":1}', | 12 '{"id":1,"method":1}', |
| 13 '{"id":2,"method":"resourceContent"}', | 13 '{"id":2,"method":"resourceContent"}', |
| 14 '{"id":3,"method":"DOM.test"}', | 14 '{"id":3,"method":"DOM.test"}', |
| 15 '{"id":4,"method":"Page.getResourceContent"}', | 15 '{"id":4,"method":"DOM.requestChildNodes"}', |
| 16 '{"id":5,"method":"Page.getResourceContent","params":[]}', | 16 '{"id":5,"method":"DOM.requestChildNodes","params":[]}', |
| 17 '{"id":6,"method":"Page.getResourceContent","params":{}}', | 17 '{"id":6,"method":"DOM.requestChildNodes","params":{}}', |
| 18 '{"id":7,"method":"Page.getResourceContent","params":{"frameId":"not a n
umber"}}', | 18 '{"id":7,"method":"DOM.requestChildNodes","params":{"nodeId":"not a numb
er"}}', |
| 19 '{"id":8,"method":"Page.test"}', | 19 '{"id":8,"method":"DOM.test"}', |
| 20 '{"id":9,"method":"Page.test" }', | 20 '{"id":9,"method":"DOM.test" }', |
| 21 '{"id":10,"method": "Page.test" }', | 21 '{"id":10,"method": "DOM.test" }', |
| 22 '{"id":11,"method" : "Page.test" }', | 22 '{"id":11,"method" : "DOM.test" }', |
| 23 '{"id":12, "method" : "Page.test" }', | 23 '{"id":12, "method" : "DOM.test" }', |
| 24 '{"id": 13, "method" : "Page.test" }', | 24 '{"id": 13, "method" : "DOM.test" }', |
| 25 '{"id" : 14, "method" : "Page.test" }', | 25 '{"id" : 14, "method" : "DOM.test" }', |
| 26 '{ "id" : 15, "method" : "Page.test" }', | 26 '{ "id" : 15, "method" : "DOM.test" }', |
| 27 '{ "id"\n :\r 16,\t "method" : "Page.test" }', | 27 '{ "id"\n :\r 16,\t "method" : "DOM.test" }', |
| 28 ]; | 28 ]; |
| 29 | 29 |
| 30 var numberOfReports = 0; | 30 var numberOfReports = 0; |
| 31 | 31 |
| 32 InspectorBackendClass.reportProtocolError = function(error, message) | 32 InspectorBackendClass.reportProtocolError = function(error, message) |
| 33 { | 33 { |
| 34 if (numberOfReports < messages.length) { | 34 if (numberOfReports < messages.length) { |
| 35 InspectorTest.addObject(message); | 35 InspectorTest.addObject(message); |
| 36 InspectorTest.addResult("-------------------------------------------
------------"); | 36 InspectorTest.addResult("-------------------------------------------
------------"); |
| 37 } | 37 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 51 </script> | 51 </script> |
| 52 </head> | 52 </head> |
| 53 | 53 |
| 54 <body onload="runTest()"> | 54 <body onload="runTest()"> |
| 55 <p> | 55 <p> |
| 56 Tests that InspectorBackendDispatcher is catching incorrect messages. | 56 Tests that InspectorBackendDispatcher is catching incorrect messages. |
| 57 </p> | 57 </p> |
| 58 | 58 |
| 59 </body> | 59 </body> |
| 60 </html> | 60 </html> |
| OLD | NEW |