Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Side by Side Diff: blimp/client/core/blimp_client_context_impl_unittest.cc

Issue 2297933002: blimp: Set up the CompositorDependencies for blimp in Chrome. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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" 11 #include "blimp/client/core/contents/blimp_contents_impl.h"
12 #include "blimp/client/core/contents/tab_control_feature.h" 12 #include "blimp/client/core/contents/tab_control_feature.h"
13 #include "blimp/client/public/blimp_client_context_delegate.h" 13 #include "blimp/client/public/blimp_client_context_delegate.h"
14 #include "blimp/client/public/contents/blimp_contents.h" 14 #include "blimp/client/public/contents/blimp_contents.h"
15 #include "blimp/client/support/compositor/compositor_dependencies_impl.h"
15 #include "blimp/client/test/test_blimp_client_context_delegate.h" 16 #include "blimp/client/test/test_blimp_client_context_delegate.h"
16 #include "testing/gmock/include/gmock/gmock.h" 17 #include "testing/gmock/include/gmock/gmock.h"
17 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
18 19
19 namespace blimp { 20 namespace blimp {
20 namespace client { 21 namespace client {
21 namespace { 22 namespace {
22 23
23 class BlimpClientContextImplTest : public testing::Test { 24 class BlimpClientContextImplTest : public testing::Test {
24 public: 25 public:
(...skipping 15 matching lines...) Expand all
40 base::Thread io_thread_; 41 base::Thread io_thread_;
41 42
42 private: 43 private:
43 base::MessageLoop message_loop_; 44 base::MessageLoop message_loop_;
44 45
45 DISALLOW_COPY_AND_ASSIGN(BlimpClientContextImplTest); 46 DISALLOW_COPY_AND_ASSIGN(BlimpClientContextImplTest);
46 }; 47 };
47 48
48 TEST_F(BlimpClientContextImplTest, 49 TEST_F(BlimpClientContextImplTest,
49 CreatedBlimpContentsGetsHelpersAttachedAndHasTabControlFeature) { 50 CreatedBlimpContentsGetsHelpersAttachedAndHasTabControlFeature) {
50 BlimpClientContextImpl blimp_client_context(io_thread_.task_runner(), 51 BlimpClientContextImpl blimp_client_context(
51 io_thread_.task_runner()); 52 io_thread_.task_runner(), io_thread_.task_runner(),
53 base::MakeUnique<CompositorDependenciesImpl>());
David Trainor- moved to gerrit 2016/08/31 00:28:58 I moved MockCompositorDependencies out to blimp/cl
Khushal 2016/08/31 21:22:50 Rebase took care of it.
52 TestBlimpClientContextDelegate delegate; 54 TestBlimpClientContextDelegate delegate;
53 blimp_client_context.SetDelegate(&delegate); 55 blimp_client_context.SetDelegate(&delegate);
54 56
55 BlimpContents* attached_blimp_contents = nullptr; 57 BlimpContents* attached_blimp_contents = nullptr;
56 58
57 EXPECT_CALL(delegate, AttachBlimpContentsHelpers(testing::_)) 59 EXPECT_CALL(delegate, AttachBlimpContentsHelpers(testing::_))
58 .WillOnce(testing::SaveArg<0>(&attached_blimp_contents)) 60 .WillOnce(testing::SaveArg<0>(&attached_blimp_contents))
59 .RetiresOnSaturation(); 61 .RetiresOnSaturation();
60 62
61 std::unique_ptr<BlimpContents> blimp_contents = 63 std::unique_ptr<BlimpContents> blimp_contents =
62 blimp_client_context.CreateBlimpContents(); 64 blimp_client_context.CreateBlimpContents();
63 DCHECK(blimp_contents); 65 DCHECK(blimp_contents);
64 DCHECK_EQ(blimp_contents.get(), attached_blimp_contents); 66 DCHECK_EQ(blimp_contents.get(), attached_blimp_contents);
65 } 67 }
66 68
67 } // namespace 69 } // namespace
68 } // namespace client 70 } // namespace client
69 } // namespace blimp 71 } // namespace blimp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698