| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 message->mutable_handles()->resize(num_handles); | 158 message->mutable_handles()->resize(num_handles); |
| 159 | 159 |
| 160 return true; | 160 return true; |
| 161 } | 161 } |
| 162 | 162 |
| 163 void RunValidationTests(const std::string& prefix, | 163 void RunValidationTests(const std::string& prefix, |
| 164 MessageReceiver* test_message_receiver) { | 164 MessageReceiver* test_message_receiver) { |
| 165 std::vector<std::string> names = | 165 std::vector<std::string> names = |
| 166 EnumerateSourceRootRelativeDirectory(GetPath("", "")); | 166 EnumerateSourceRootRelativeDirectory(GetPath("", "")); |
| 167 std::vector<std::string> tests = GetMatchingTests(names, prefix); | 167 std::vector<std::string> tests = GetMatchingTests(names, prefix); |
| 168 ASSERT_FALSE(tests.empty()); |
| 168 | 169 |
| 169 for (size_t i = 0; i < tests.size(); ++i) { | 170 for (size_t i = 0; i < tests.size(); ++i) { |
| 170 Message message; | 171 Message message; |
| 171 std::string expected; | 172 std::string expected; |
| 172 ASSERT_TRUE(ReadTestCase(tests[i], &message, &expected)); | 173 ASSERT_TRUE(ReadTestCase(tests[i], &message, &expected)); |
| 173 | 174 |
| 174 std::string result; | 175 std::string result; |
| 175 base::RunLoop run_loop; | 176 base::RunLoop run_loop; |
| 176 mojo::internal::ValidationErrorObserverForTesting observer( | 177 mojo::internal::ValidationErrorObserverForTesting observer( |
| 177 run_loop.QuitClosure()); | 178 run_loop.QuitClosure()); |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 EXPECT_TRUE(IsKnownEnumValue(static_cast<StructWithEnum::EnumWithin>(0))); | 490 EXPECT_TRUE(IsKnownEnumValue(static_cast<StructWithEnum::EnumWithin>(0))); |
| 490 EXPECT_TRUE(IsKnownEnumValue(static_cast<StructWithEnum::EnumWithin>(1))); | 491 EXPECT_TRUE(IsKnownEnumValue(static_cast<StructWithEnum::EnumWithin>(1))); |
| 491 EXPECT_TRUE(IsKnownEnumValue(static_cast<StructWithEnum::EnumWithin>(2))); | 492 EXPECT_TRUE(IsKnownEnumValue(static_cast<StructWithEnum::EnumWithin>(2))); |
| 492 EXPECT_TRUE(IsKnownEnumValue(static_cast<StructWithEnum::EnumWithin>(3))); | 493 EXPECT_TRUE(IsKnownEnumValue(static_cast<StructWithEnum::EnumWithin>(3))); |
| 493 EXPECT_FALSE(IsKnownEnumValue(static_cast<StructWithEnum::EnumWithin>(4))); | 494 EXPECT_FALSE(IsKnownEnumValue(static_cast<StructWithEnum::EnumWithin>(4))); |
| 494 } | 495 } |
| 495 | 496 |
| 496 } // namespace | 497 } // namespace |
| 497 } // namespace test | 498 } // namespace test |
| 498 } // namespace mojo | 499 } // namespace mojo |
| OLD | NEW |