| 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 <stddef.h> | 7 #include <stddef.h> | 
| 8 #include <stdint.h> | 8 #include <stdint.h> | 
| 9 | 9 | 
| 10 #include <limits> | 10 #include <limits> | 
| (...skipping 30 matching lines...) Expand all  Loading... | 
| 41   EXPECT_EQ(validated_options.struct_size, revalidated_options.struct_size); | 41   EXPECT_EQ(validated_options.struct_size, revalidated_options.struct_size); | 
| 42   EXPECT_EQ(validated_options.flags, revalidated_options.flags); | 42   EXPECT_EQ(validated_options.flags, revalidated_options.flags); | 
| 43 } | 43 } | 
| 44 | 44 | 
| 45 class SharedBufferDispatcherTest : public testing::Test { | 45 class SharedBufferDispatcherTest : public testing::Test { | 
| 46  public: | 46  public: | 
| 47   SharedBufferDispatcherTest() {} | 47   SharedBufferDispatcherTest() {} | 
| 48   ~SharedBufferDispatcherTest() override {} | 48   ~SharedBufferDispatcherTest() override {} | 
| 49 | 49 | 
| 50  private: | 50  private: | 
| 51   MOJO_DISALLOW_COPY_AND_ASSIGN(SharedBufferDispatcherTest); | 51   DISALLOW_COPY_AND_ASSIGN(SharedBufferDispatcherTest); | 
| 52 }; | 52 }; | 
| 53 | 53 | 
| 54 // Tests valid inputs to |ValidateCreateOptions()|. | 54 // Tests valid inputs to |ValidateCreateOptions()|. | 
| 55 TEST_F(SharedBufferDispatcherTest, ValidateCreateOptionsValid) { | 55 TEST_F(SharedBufferDispatcherTest, ValidateCreateOptionsValid) { | 
| 56   // Default options. | 56   // Default options. | 
| 57   { | 57   { | 
| 58     MojoCreateSharedBufferOptions validated_options = {}; | 58     MojoCreateSharedBufferOptions validated_options = {}; | 
| 59     EXPECT_EQ(MOJO_RESULT_OK, SharedBufferDispatcher::ValidateCreateOptions( | 59     EXPECT_EQ(MOJO_RESULT_OK, SharedBufferDispatcher::ValidateCreateOptions( | 
| 60                                   nullptr, &validated_options)); | 60                                   nullptr, &validated_options)); | 
| 61     RevalidateCreateOptions(validated_options); | 61     RevalidateCreateOptions(validated_options); | 
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 297   EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, | 297   EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, | 
| 298             dispatcher->MapBuffer(0, 0, MOJO_MAP_BUFFER_FLAG_NONE, &mapping)); | 298             dispatcher->MapBuffer(0, 0, MOJO_MAP_BUFFER_FLAG_NONE, &mapping)); | 
| 299   EXPECT_FALSE(mapping); | 299   EXPECT_FALSE(mapping); | 
| 300 | 300 | 
| 301   EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close()); | 301   EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close()); | 
| 302 } | 302 } | 
| 303 | 303 | 
| 304 }  // namespace | 304 }  // namespace | 
| 305 }  // namespace edk | 305 }  // namespace edk | 
| 306 }  // namespace mojo | 306 }  // namespace mojo | 
| OLD | NEW | 
|---|