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

Side by Side Diff: services/ui/ws/frame_generator_unittest.cc

Issue 2453013002: Mus: Remove dependency on ServerWindowCompositorFrameSink from FrameGenerator (Closed)
Patch Set: Addressed comments Created 4 years, 1 month 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 "services/ui/ws/frame_generator.h" 5 #include "services/ui/ws/frame_generator.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/test/test_message_loop.h" 9 #include "base/test/test_message_loop.h"
10 #include "cc/quads/render_pass.h" 10 #include "cc/quads/render_pass.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 TestServerWindowDelegate window_delegate_; 67 TestServerWindowDelegate window_delegate_;
68 std::unique_ptr<ServerWindow> root_window_; 68 std::unique_ptr<ServerWindow> root_window_;
69 69
70 // Needed so that Mojo classes can be initialized for ServerWindow use. 70 // Needed so that Mojo classes can be initialized for ServerWindow use.
71 base::TestMessageLoop message_loop_; 71 base::TestMessageLoop message_loop_;
72 72
73 DISALLOW_COPY_AND_ASSIGN(FrameGeneratorTest); 73 DISALLOW_COPY_AND_ASSIGN(FrameGeneratorTest);
74 }; 74 };
75 75
76 void FrameGeneratorTest::DrawWindowTree(cc::RenderPass* pass) { 76 void FrameGeneratorTest::DrawWindowTree(cc::RenderPass* pass) {
77 frame_generator_->DrawWindowTree(pass, 77 frame_generator_->DrawWindowTree(
78 frame_generator_delegate_->GetRootWindow(), 78 pass, frame_generator_delegate_->GetRootWindow(), gfx::Vector2d(), 1.0f);
79 gfx::Vector2d(), 1.0f, nullptr);
80 } 79 }
81 80
82 void FrameGeneratorTest::SetUp() { 81 void FrameGeneratorTest::SetUp() {
83 testing::Test::SetUp(); 82 testing::Test::SetUp();
84 frame_generator_delegate_ = base::MakeUnique<TestFrameGeneratorDelegate>( 83 frame_generator_delegate_ = base::MakeUnique<TestFrameGeneratorDelegate>(
85 base::MakeUnique<ServerWindow>(&window_delegate_, WindowId())); 84 base::MakeUnique<ServerWindow>(&window_delegate_, WindowId()));
86 PlatformDisplayInitParams init_params; 85 PlatformDisplayInitParams init_params;
87 frame_generator_ = base::MakeUnique<FrameGenerator>( 86 frame_generator_ = base::MakeUnique<FrameGenerator>(
88 frame_generator_delegate_.get(), root_window_.get(), display_compositor_); 87 frame_generator_delegate_.get(), root_window_.get(), display_compositor_);
89 InitWindow(root_window()); 88 InitWindow(root_window());
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 EXPECT_EQ(3u, quad_state_list->size()); 133 EXPECT_EQ(3u, quad_state_list->size());
135 auto it = quad_state_list->begin(); 134 auto it = quad_state_list->begin();
136 EXPECT_EQ(child_opacity * root_opacity, (*it)->opacity); 135 EXPECT_EQ(child_opacity * root_opacity, (*it)->opacity);
137 EXPECT_EQ(child_opacity * root_opacity, (*++it)->opacity); 136 EXPECT_EQ(child_opacity * root_opacity, (*++it)->opacity);
138 EXPECT_EQ(root_opacity, (*++it)->opacity); 137 EXPECT_EQ(root_opacity, (*++it)->opacity);
139 } 138 }
140 139
141 } // namespace test 140 } // namespace test
142 } // namespace ws 141 } // namespace ws
143 } // namespace ui 142 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698