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 "mojo/edk/system/shared_buffer_dispatcher.h" | 5 #include "mojo/edk/system/shared_buffer_dispatcher.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 EXPECT_EQ(MOJO_RESULT_OK, | 36 EXPECT_EQ(MOJO_RESULT_OK, |
37 SharedBufferDispatcher::ValidateCreateOptions( | 37 SharedBufferDispatcher::ValidateCreateOptions( |
38 MakeUserPointer(&validated_options), &revalidated_options)); | 38 MakeUserPointer(&validated_options), &revalidated_options)); |
39 EXPECT_EQ(validated_options.struct_size, revalidated_options.struct_size); | 39 EXPECT_EQ(validated_options.struct_size, revalidated_options.struct_size); |
40 EXPECT_EQ(validated_options.flags, revalidated_options.flags); | 40 EXPECT_EQ(validated_options.flags, revalidated_options.flags); |
41 } | 41 } |
42 | 42 |
43 class SharedBufferDispatcherTest : public testing::Test { | 43 class SharedBufferDispatcherTest : public testing::Test { |
44 public: | 44 public: |
45 SharedBufferDispatcherTest() {} | 45 SharedBufferDispatcherTest() {} |
46 virtual ~SharedBufferDispatcherTest() {} | 46 ~SharedBufferDispatcherTest() override {} |
47 | 47 |
48 embedder::PlatformSupport* platform_support() { return &platform_support_; } | 48 embedder::PlatformSupport* platform_support() { return &platform_support_; } |
49 | 49 |
50 private: | 50 private: |
51 embedder::SimplePlatformSupport platform_support_; | 51 embedder::SimplePlatformSupport platform_support_; |
52 | 52 |
53 DISALLOW_COPY_AND_ASSIGN(SharedBufferDispatcherTest); | 53 DISALLOW_COPY_AND_ASSIGN(SharedBufferDispatcherTest); |
54 }; | 54 }; |
55 | 55 |
56 // Tests valid inputs to |ValidateCreateOptions()|. | 56 // Tests valid inputs to |ValidateCreateOptions()|. |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, | 290 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, |
291 dispatcher->MapBuffer(0, 0, MOJO_MAP_BUFFER_FLAG_NONE, &mapping)); | 291 dispatcher->MapBuffer(0, 0, MOJO_MAP_BUFFER_FLAG_NONE, &mapping)); |
292 EXPECT_FALSE(mapping); | 292 EXPECT_FALSE(mapping); |
293 | 293 |
294 EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close()); | 294 EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close()); |
295 } | 295 } |
296 | 296 |
297 } // namespace | 297 } // namespace |
298 } // namespace system | 298 } // namespace system |
299 } // namespace mojo | 299 } // namespace mojo |
OLD | NEW |