| 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/embedder/test_embedder.h" | 5 #include "mojo/edk/embedder/test_embedder.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "mojo/edk/embedder/embedder.h" | 10 #include "mojo/edk/embedder/embedder.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 } // namespace internal | 38 } // namespace internal |
| 39 } // namespace system | 39 } // namespace system |
| 40 | 40 |
| 41 namespace embedder { | 41 namespace embedder { |
| 42 namespace test { | 42 namespace test { |
| 43 | 43 |
| 44 void InitWithSimplePlatformSupport() { | 44 void InitWithSimplePlatformSupport() { |
| 45 Init(make_scoped_ptr(new SimplePlatformSupport())); | 45 Init(make_scoped_ptr(new SimplePlatformSupport())); |
| 46 } | 46 } |
| 47 | 47 |
| 48 bool IsInitialized() { |
| 49 return internal::g_channel_manager; |
| 50 } |
| 51 |
| 48 bool Shutdown() { | 52 bool Shutdown() { |
| 49 CHECK(internal::g_channel_manager); | 53 CHECK(internal::g_channel_manager); |
| 50 delete internal::g_channel_manager; | 54 delete internal::g_channel_manager; |
| 51 internal::g_channel_manager = nullptr; | 55 internal::g_channel_manager = nullptr; |
| 52 | 56 |
| 53 CHECK(internal::g_core); | 57 CHECK(internal::g_core); |
| 54 bool rv = system::internal::ShutdownCheckNoLeaks(internal::g_core); | 58 bool rv = system::internal::ShutdownCheckNoLeaks(internal::g_core); |
| 55 delete internal::g_core; | 59 delete internal::g_core; |
| 56 internal::g_core = nullptr; | 60 internal::g_core = nullptr; |
| 57 return rv; | 61 return rv; |
| 58 } | 62 } |
| 59 | 63 |
| 60 } // namespace test | 64 } // namespace test |
| 61 } // namespace embedder | 65 } // namespace embedder |
| 62 | 66 |
| 63 } // namespace mojo | 67 } // namespace mojo |
| OLD | NEW |