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 // Serialization warnings are only recorded in debug build. | 5 // Serialization warnings are only recorded in debug build. |
6 #ifndef NDEBUG | 6 #ifndef NDEBUG |
7 | 7 |
8 #include "mojo/public/cpp/bindings/array.h" | 8 #include "mojo/public/cpp/bindings/array.h" |
9 #include "mojo/public/cpp/bindings/lib/array_internal.h" | 9 #include "mojo/public/cpp/bindings/lib/array_internal.h" |
10 #include "mojo/public/cpp/bindings/lib/array_serialization.h" | 10 #include "mojo/public/cpp/bindings/lib/array_serialization.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 auto array = Array<Array<ScopedHandle>>::New(2); | 27 auto array = Array<Array<ScopedHandle>>::New(2); |
28 for (size_t i = 0; i < array.size(); ++i) { | 28 for (size_t i = 0; i < array.size(); ++i) { |
29 auto nested_array = Array<ScopedHandle>::New(3); | 29 auto nested_array = Array<ScopedHandle>::New(3); |
30 for (size_t j = 0; j < nested_array.size(); ++j) { | 30 for (size_t j = 0; j < nested_array.size(); ++j) { |
31 MessagePipe pipe; | 31 MessagePipe pipe; |
32 nested_array[j] = ScopedHandle::From(pipe.handle1.Pass()); | 32 nested_array[j] = ScopedHandle::From(pipe.handle1.Pass()); |
33 } | 33 } |
34 array[i] = nested_array.Pass(); | 34 array[i] = nested_array.Pass(); |
35 } | 35 } |
36 | 36 |
37 return array.Pass(); | 37 return array; |
38 } | 38 } |
39 | 39 |
40 class SerializationWarningTest : public testing::Test { | 40 class SerializationWarningTest : public testing::Test { |
41 public: | 41 public: |
42 ~SerializationWarningTest() override {} | 42 ~SerializationWarningTest() override {} |
43 | 43 |
44 protected: | 44 protected: |
45 template <typename T> | 45 template <typename T> |
46 void TestWarning(StructPtr<T> obj, | 46 void TestWarning(StructPtr<T> obj, |
47 mojo::internal::ValidationError expected_warning) { | 47 mojo::internal::ValidationError expected_warning) { |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 TestArrayWarning(test_array.Pass(), | 212 TestArrayWarning(test_array.Pass(), |
213 mojo::internal::ValidationError::UNEXPECTED_ARRAY_HEADER, | 213 mojo::internal::ValidationError::UNEXPECTED_ARRAY_HEADER, |
214 &validate_params_2); | 214 &validate_params_2); |
215 } | 215 } |
216 | 216 |
217 } // namespace | 217 } // namespace |
218 } // namespace test | 218 } // namespace test |
219 } // namespace mojo | 219 } // namespace mojo |
220 | 220 |
221 #endif | 221 #endif |
OLD | NEW |