| 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/memory/ref_counted.h" | |
| 10 #include "mojo/edk/embedder/platform_shared_buffer.h" | 9 #include "mojo/edk/embedder/platform_shared_buffer.h" |
| 11 #include "mojo/edk/embedder/simple_platform_support.h" | 10 #include "mojo/edk/embedder/simple_platform_support.h" |
| 12 #include "mojo/edk/system/dispatcher.h" | 11 #include "mojo/edk/system/dispatcher.h" |
| 13 #include "mojo/public/cpp/system/macros.h" | 12 #include "mojo/public/cpp/system/macros.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 14 |
| 15 using mojo::util::RefPtr; |
| 16 |
| 16 namespace mojo { | 17 namespace mojo { |
| 17 namespace system { | 18 namespace system { |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| 20 // NOTE(vtl): There's currently not much to test for in | 21 // NOTE(vtl): There's currently not much to test for in |
| 21 // |SharedBufferDispatcher::ValidateCreateOptions()|, but the tests should be | 22 // |SharedBufferDispatcher::ValidateCreateOptions()|, but the tests should be |
| 22 // expanded if/when options are added, so I've kept the general form of the | 23 // expanded if/when options are added, so I've kept the general form of the |
| 23 // tests from data_pipe_unittest.cc. | 24 // tests from data_pipe_unittest.cc. |
| 24 | 25 |
| 25 const uint32_t kSizeOfCreateOptions = sizeof(MojoCreateSharedBufferOptions); | 26 const uint32_t kSizeOfCreateOptions = sizeof(MojoCreateSharedBufferOptions); |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, | 272 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, |
| 272 dispatcher->MapBuffer(0, 0, MOJO_MAP_BUFFER_FLAG_NONE, &mapping)); | 273 dispatcher->MapBuffer(0, 0, MOJO_MAP_BUFFER_FLAG_NONE, &mapping)); |
| 273 EXPECT_FALSE(mapping); | 274 EXPECT_FALSE(mapping); |
| 274 | 275 |
| 275 EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close()); | 276 EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close()); |
| 276 } | 277 } |
| 277 | 278 |
| 278 } // namespace | 279 } // namespace |
| 279 } // namespace system | 280 } // namespace system |
| 280 } // namespace mojo | 281 } // namespace mojo |
| OLD | NEW |