Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: mojo/public/cpp/bindings/tests/validation_unittest.cc

Issue 2607063002: Remove mojo::Array. (Closed)
Patch Set: rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 TestMessageReceiver* test_message_receiver_; 258 TestMessageReceiver* test_message_receiver_;
259 ScopedMessagePipeHandle testee_endpoint_; 259 ScopedMessagePipeHandle testee_endpoint_;
260 }; 260 };
261 261
262 class IntegrationTestInterfaceImpl : public IntegrationTestInterface { 262 class IntegrationTestInterfaceImpl : public IntegrationTestInterface {
263 public: 263 public:
264 ~IntegrationTestInterfaceImpl() override {} 264 ~IntegrationTestInterfaceImpl() override {}
265 265
266 void Method0(BasicStructPtr param0, 266 void Method0(BasicStructPtr param0,
267 const Method0Callback& callback) override { 267 const Method0Callback& callback) override {
268 callback.Run(Array<uint8_t>::New(0u)); 268 callback.Run(std::vector<uint8_t>());
269 } 269 }
270 }; 270 };
271 271
272 TEST_F(ValidationTest, InputParser) { 272 TEST_F(ValidationTest, InputParser) {
273 { 273 {
274 // The parser, as well as Append() defined above, assumes that this code is 274 // The parser, as well as Append() defined above, assumes that this code is
275 // running on a little-endian platform. Test whether that is true. 275 // running on a little-endian platform. Test whether that is true.
276 uint16_t x = 1; 276 uint16_t x = 1;
277 ASSERT_EQ(1, *(reinterpret_cast<char*>(&x))); 277 ASSERT_EQ(1, *(reinterpret_cast<char*>(&x)));
278 } 278 }
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 EXPECT_TRUE(IsKnownEnumValue(static_cast<StructWithEnum::EnumWithin>(0))); 489 EXPECT_TRUE(IsKnownEnumValue(static_cast<StructWithEnum::EnumWithin>(0)));
490 EXPECT_TRUE(IsKnownEnumValue(static_cast<StructWithEnum::EnumWithin>(1))); 490 EXPECT_TRUE(IsKnownEnumValue(static_cast<StructWithEnum::EnumWithin>(1)));
491 EXPECT_TRUE(IsKnownEnumValue(static_cast<StructWithEnum::EnumWithin>(2))); 491 EXPECT_TRUE(IsKnownEnumValue(static_cast<StructWithEnum::EnumWithin>(2)));
492 EXPECT_TRUE(IsKnownEnumValue(static_cast<StructWithEnum::EnumWithin>(3))); 492 EXPECT_TRUE(IsKnownEnumValue(static_cast<StructWithEnum::EnumWithin>(3)));
493 EXPECT_FALSE(IsKnownEnumValue(static_cast<StructWithEnum::EnumWithin>(4))); 493 EXPECT_FALSE(IsKnownEnumValue(static_cast<StructWithEnum::EnumWithin>(4)));
494 } 494 }
495 495
496 } // namespace 496 } // namespace
497 } // namespace test 497 } // namespace test
498 } // namespace mojo 498 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698