| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <mojo/bindings/message.h> | 5 #include <mojo/bindings/message.h> |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "gtest/gtest.h" |
| 12 #include "mojo/public/cpp/bindings/tests/validation_test_input_parser.h" | 13 #include "mojo/public/cpp/bindings/tests/validation_test_input_parser.h" |
| 13 #include "mojo/public/cpp/system/macros.h" | 14 #include "mojo/public/cpp/system/macros.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 TEST(MessageValidationTest, InvalidMessageHeader) { | 18 TEST(MessageValidationTest, InvalidMessageHeader) { |
| 19 struct TestCase { | 19 struct TestCase { |
| 20 const char* test_case; | 20 const char* test_case; |
| 21 uint32_t size; | 21 uint32_t size; |
| 22 const char* name; | 22 const char* name; |
| 23 MojomValidationResult validation_result; | 23 MojomValidationResult validation_result; |
| 24 }; | 24 }; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 ASSERT_TRUE(mojo::test::ParseValidationTestInput( | 118 ASSERT_TRUE(mojo::test::ParseValidationTestInput( |
| 119 cases[i].test_case, &data, &num_handles, &parser_error_message)) | 119 cases[i].test_case, &data, &num_handles, &parser_error_message)) |
| 120 << parser_error_message << " case " << i; | 120 << parser_error_message << " case " << i; |
| 121 EXPECT_EQ(MOJOM_VALIDATION_ERROR_NONE, | 121 EXPECT_EQ(MOJOM_VALIDATION_ERROR_NONE, |
| 122 MojomMessage_ValidateHeader(data.data(), cases[i].size)) | 122 MojomMessage_ValidateHeader(data.data(), cases[i].size)) |
| 123 << " case " << i; | 123 << " case " << i; |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| 127 } // namespace | 127 } // namespace |
| OLD | NEW |