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/contents/blimp_contents_impl.h" |
| 12 #include "blimp/client/core/contents/tab_control_feature.h" |
11 #include "blimp/client/public/blimp_client_context_delegate.h" | 13 #include "blimp/client/public/blimp_client_context_delegate.h" |
12 #include "blimp/client/public/contents/blimp_contents.h" | 14 #include "blimp/client/public/contents/blimp_contents.h" |
13 #include "blimp/client/test/test_blimp_client_context_delegate.h" | 15 #include "blimp/client/test/test_blimp_client_context_delegate.h" |
14 #include "testing/gmock/include/gmock/gmock.h" | 16 #include "testing/gmock/include/gmock/gmock.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
16 | 18 |
17 namespace blimp { | 19 namespace blimp { |
18 namespace client { | 20 namespace client { |
19 namespace { | 21 namespace { |
20 | 22 |
(...skipping 15 matching lines...) Expand all Loading... |
36 | 38 |
37 protected: | 39 protected: |
38 base::Thread io_thread_; | 40 base::Thread io_thread_; |
39 | 41 |
40 private: | 42 private: |
41 base::MessageLoop message_loop_; | 43 base::MessageLoop message_loop_; |
42 | 44 |
43 DISALLOW_COPY_AND_ASSIGN(BlimpClientContextImplTest); | 45 DISALLOW_COPY_AND_ASSIGN(BlimpClientContextImplTest); |
44 }; | 46 }; |
45 | 47 |
46 TEST_F(BlimpClientContextImplTest, CreatedBlimpContentsGetsHelpersAttached) { | 48 TEST_F(BlimpClientContextImplTest, |
| 49 CreatedBlimpContentsGetsHelpersAttachedAndHasTabControlFeature) { |
47 BlimpClientContextImpl blimp_client_context(io_thread_.task_runner(), | 50 BlimpClientContextImpl blimp_client_context(io_thread_.task_runner(), |
48 io_thread_.task_runner()); | 51 io_thread_.task_runner()); |
49 TestBlimpClientContextDelegate delegate; | 52 TestBlimpClientContextDelegate delegate; |
50 blimp_client_context.SetDelegate(&delegate); | 53 blimp_client_context.SetDelegate(&delegate); |
51 | 54 |
52 BlimpContents* attached_blimp_contents = nullptr; | 55 BlimpContents* attached_blimp_contents = nullptr; |
53 | 56 |
54 EXPECT_CALL(delegate, AttachBlimpContentsHelpers(testing::_)) | 57 EXPECT_CALL(delegate, AttachBlimpContentsHelpers(testing::_)) |
55 .WillOnce(testing::SaveArg<0>(&attached_blimp_contents)) | 58 .WillOnce(testing::SaveArg<0>(&attached_blimp_contents)) |
56 .RetiresOnSaturation(); | 59 .RetiresOnSaturation(); |
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 |