| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "blimp/client/core/blimp_client_context_impl.h" | 5 #include "blimp/client/core/blimp_client_context_impl.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| 11 #include "blimp/client/core/compositor/compositor_deps_provider.h" |
| 11 #include "blimp/client/public/blimp_client_context_delegate.h" | 12 #include "blimp/client/public/blimp_client_context_delegate.h" |
| 12 #include "blimp/client/public/contents/blimp_contents.h" | 13 #include "blimp/client/public/contents/blimp_contents.h" |
| 13 #include "blimp/client/test/test_blimp_client_context_delegate.h" | 14 #include "blimp/client/test/test_blimp_client_context_delegate.h" |
| 14 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 17 |
| 17 namespace blimp { | 18 namespace blimp { |
| 18 namespace client { | 19 namespace client { |
| 19 namespace { | 20 namespace { |
| 20 | 21 |
| 21 class BlimpClientContextImplTest : public testing::Test { | 22 class BlimpClientContextImplTest : public testing::Test { |
| 22 public: | 23 public: |
| 23 BlimpClientContextImplTest() : io_thread_("BlimpTestIO") {} | 24 BlimpClientContextImplTest() : io_thread_("BlimpTestIO") {} |
| 24 ~BlimpClientContextImplTest() override {} | 25 ~BlimpClientContextImplTest() override {} |
| 25 | 26 |
| 26 void SetUp() override { | 27 void SetUp() override { |
| 27 base::Thread::Options options; | 28 base::Thread::Options options; |
| 28 options.message_loop_type = base::MessageLoop::TYPE_IO; | 29 options.message_loop_type = base::MessageLoop::TYPE_IO; |
| 29 io_thread_.StartWithOptions(options); | 30 io_thread_.StartWithOptions(options); |
| 31 CompositorDepsProvider::Initialize(true); |
| 30 } | 32 } |
| 31 | 33 |
| 32 void TearDown() override { | 34 void TearDown() override { |
| 33 io_thread_.Stop(); | 35 io_thread_.Stop(); |
| 34 base::RunLoop().RunUntilIdle(); | 36 base::RunLoop().RunUntilIdle(); |
| 37 CompositorDepsProvider::Terminate(); |
| 35 } | 38 } |
| 36 | 39 |
| 37 protected: | 40 protected: |
| 38 base::Thread io_thread_; | 41 base::Thread io_thread_; |
| 39 | 42 |
| 40 private: | 43 private: |
| 41 base::MessageLoop message_loop_; | 44 base::MessageLoop message_loop_; |
| 42 | 45 |
| 43 DISALLOW_COPY_AND_ASSIGN(BlimpClientContextImplTest); | 46 DISALLOW_COPY_AND_ASSIGN(BlimpClientContextImplTest); |
| 44 }; | 47 }; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 57 | 60 |
| 58 std::unique_ptr<BlimpContents> blimp_contents = | 61 std::unique_ptr<BlimpContents> blimp_contents = |
| 59 blimp_client_context.CreateBlimpContents(); | 62 blimp_client_context.CreateBlimpContents(); |
| 60 DCHECK(blimp_contents); | 63 DCHECK(blimp_contents); |
| 61 DCHECK_EQ(blimp_contents.get(), attached_blimp_contents); | 64 DCHECK_EQ(blimp_contents.get(), attached_blimp_contents); |
| 62 } | 65 } |
| 63 | 66 |
| 64 } // namespace | 67 } // namespace |
| 65 } // namespace client | 68 } // namespace client |
| 66 } // namespace blimp | 69 } // namespace blimp |
| OLD | NEW |