| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef MOJO_EDK_SYSTEM_CORE_TEST_BASE_H_ | 5 #ifndef MOJO_EDK_SYSTEM_CORE_TEST_BASE_H_ |
| 6 #define MOJO_EDK_SYSTEM_CORE_TEST_BASE_H_ | 6 #define MOJO_EDK_SYSTEM_CORE_TEST_BASE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "mojo/edk/util/mutex.h" | 10 #include "mojo/edk/util/mutex.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 class Awakable; | 25 class Awakable; |
| 26 | 26 |
| 27 namespace test { | 27 namespace test { |
| 28 | 28 |
| 29 class CoreTestBase_MockHandleInfo; | 29 class CoreTestBase_MockHandleInfo; |
| 30 | 30 |
| 31 class CoreTestBase : public testing::Test { | 31 class CoreTestBase : public testing::Test { |
| 32 public: | 32 public: |
| 33 using MockHandleInfo = CoreTestBase_MockHandleInfo; | 33 using MockHandleInfo = CoreTestBase_MockHandleInfo; |
| 34 | 34 |
| 35 static constexpr MojoHandleRights kDefaultMockHandleRights = |
| 36 MOJO_HANDLE_RIGHT_DUPLICATE | MOJO_HANDLE_RIGHT_TRANSFER | |
| 37 MOJO_HANDLE_RIGHT_READ | MOJO_HANDLE_RIGHT_WRITE | |
| 38 MOJO_HANDLE_RIGHT_GET_OPTIONS | MOJO_HANDLE_RIGHT_SET_OPTIONS | |
| 39 MOJO_HANDLE_RIGHT_MAP_READABLE | MOJO_HANDLE_RIGHT_MAP_WRITABLE | |
| 40 MOJO_HANDLE_RIGHT_MAP_EXECUTABLE; |
| 41 |
| 35 CoreTestBase(); | 42 CoreTestBase(); |
| 36 ~CoreTestBase() override; | 43 ~CoreTestBase() override; |
| 37 | 44 |
| 38 void SetUp() override; | 45 void SetUp() override; |
| 39 void TearDown() override; | 46 void TearDown() override; |
| 40 | 47 |
| 41 protected: | 48 protected: |
| 42 // |info| must remain alive until the returned handle is closed. | 49 // |info| must remain alive until the returned handle is closed. |
| 43 MojoHandle CreateMockHandle(MockHandleInfo* info); | 50 MojoHandle CreateMockHandle(MockHandleInfo* info); |
| 44 | 51 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 std::vector<Awakable*> added_awakables_ MOJO_GUARDED_BY(mutex_); | 131 std::vector<Awakable*> added_awakables_ MOJO_GUARDED_BY(mutex_); |
| 125 | 132 |
| 126 MOJO_DISALLOW_COPY_AND_ASSIGN(CoreTestBase_MockHandleInfo); | 133 MOJO_DISALLOW_COPY_AND_ASSIGN(CoreTestBase_MockHandleInfo); |
| 127 }; | 134 }; |
| 128 | 135 |
| 129 } // namespace test | 136 } // namespace test |
| 130 } // namespace system | 137 } // namespace system |
| 131 } // namespace mojo | 138 } // namespace mojo |
| 132 | 139 |
| 133 #endif // MOJO_EDK_SYSTEM_CORE_TEST_BASE_H_ | 140 #endif // MOJO_EDK_SYSTEM_CORE_TEST_BASE_H_ |
| OLD | NEW |