blob: 6c3c5f7333f24c4a38922080592093124786e086 [file] [log] [blame]
Testing the inspector backend's error handling when sending invalid messages.
== Running test suite: Protocol.MalformedMessageErrors
-- Running test case: UnparseableStringMessage
Sending message: not-a-json-object
PASS: the backend should send a protocol error when receiving for an invalid message.
PASS: the reported error should be "ParseError" (-32700)
Actual error code: -32700
Actual error message: Message must be in JSON format
-- Running test case: JSONObjectWithSyntaxError
Sending message: {name: 123,}
PASS: the backend should send a protocol error when receiving for an invalid message.
PASS: the reported error should be "ParseError" (-32700)
Actual error code: -32700
Actual error message: Message must be in JSON format
-- Running test case: EmptyJSONObject
Sending message: {}
PASS: the backend should send a protocol error when receiving for an invalid message.
PASS: the reported error should be "InvalidRequest" (-32600)
Actual error code: -32600
Actual error message: 'id' property was not found
-- Running test case: MissingIdField
Sending message: {"lucky":123}
PASS: the backend should send a protocol error when receiving for an invalid message.
PASS: the reported error should be "InvalidRequest" (-32600)
Actual error code: -32600
Actual error message: 'id' property was not found
-- Running test case: IdFieldWithArrayType
Sending message: {"id":[]}
PASS: the backend should send a protocol error when receiving for an invalid message.
PASS: the reported error should be "InvalidRequest" (-32600)
Actual error code: -32600
Actual error message: The type of 'id' property must be integer
-- Running test case: IdFieldWithStringType
Sending message: {"id":"123"}
PASS: the backend should send a protocol error when receiving for an invalid message.
PASS: the reported error should be "InvalidRequest" (-32600)
Actual error code: -32600
Actual error message: The type of 'id' property must be integer
-- Running test case: MissingMethodField
Sending message: {"id":123}
PASS: the backend should send a protocol error when receiving for an invalid message.
PASS: the reported error should be "InvalidRequest" (-32600)
Actual error code: -32600
Actual error message: 'method' property wasn't found
-- Running test case: MethodFieldWithArrayType
Sending message: {"id":123,"method":[]}
PASS: the backend should send a protocol error when receiving for an invalid message.
PASS: the reported error should be "InvalidRequest" (-32600)
Actual error code: -32600
Actual error message: The type of 'method' property must be string
-- Running test case: MethodFieldWithNumberType
Sending message: {"id":123,"method":123}
PASS: the backend should send a protocol error when receiving for an invalid message.
PASS: the reported error should be "InvalidRequest" (-32600)
Actual error code: -32600
Actual error message: The type of 'method' property must be string
-- Running test case: MethodFieldWithBadFormatting
Sending message: {"id":123,"method":"ThisIsDefinitelyNotADomainAndMethod"}
PASS: the backend should send a protocol error when receiving for an invalid message.
PASS: the reported error should be "InvalidRequest" (-32600)
Actual error code: -32600
Actual error message: The 'method' property was formatted incorrectly. It should be 'Domain.method'
-- Running test case: MethodFieldWithBadFormatting2
Sending message: {"id":123,"method":"ThisIsDefinitelyNotADomainAndMethod."}
PASS: the backend should send a protocol error when receiving for an invalid message.
PASS: the reported error should be "InvalidRequest" (-32600)
Actual error code: -32600
Actual error message: The 'method' property was formatted incorrectly. It should be 'Domain.method'
-- Running test case: MethodFieldWithBadFormatting3
Sending message: {"id":123,"method":".ThisIsDefinitelyNotADomainAndMethod"}
PASS: the backend should send a protocol error when receiving for an invalid message.
PASS: the reported error should be "InvalidRequest" (-32600)
Actual error code: -32600
Actual error message: The 'method' property was formatted incorrectly. It should be 'Domain.method'
-- Running test case: MethodFieldWithBadFormatting4
Sending message: {"id":123,"method":"."}
PASS: the backend should send a protocol error when receiving for an invalid message.
PASS: the reported error should be "InvalidRequest" (-32600)
Actual error code: -32600
Actual error message: The 'method' property was formatted incorrectly. It should be 'Domain.method'
-- Running test case: MethodFieldWithBadFormatting5
Sending message: {"id":123,"method":".FooBar."}
PASS: the backend should send a protocol error when receiving for an invalid message.
PASS: the reported error should be "InvalidRequest" (-32600)
Actual error code: -32600
Actual error message: The 'method' property was formatted incorrectly. It should be 'Domain.method'
-- Running test case: MethodFieldWithBadFormatting6
Sending message: {"id":123,"method":"Foo.Bar.Baz"}
PASS: the backend should send a protocol error when receiving for an invalid message.
PASS: the reported error should be "InvalidRequest" (-32600)
Actual error code: -32600
Actual error message: The 'method' property was formatted incorrectly. It should be 'Domain.method'
-- Running test case: MethodFieldWithFakeDomain
Sending message: {"id":123,"method":"DummyDomain.DummyMethod"}
PASS: the backend should send a protocol error when receiving for an invalid message.
PASS: the reported error should be "MethodNotFound" (-32601)
Actual error code: -32601
Actual error message: 'DummyDomain' domain was not found
-- Running test case: MethodFieldWithFakeMethod
Sending message: {"id":123,"method":"Inspector.DummyMethod"}
PASS: the backend should send a protocol error when receiving for an invalid message.
PASS: the reported error should be "MethodNotFound" (-32601)
Actual error code: -32601
Actual error message: 'Inspector.DummyMethod' was not found