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

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

Issue 2194893002: services/ui: Revert CLs that broke Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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
« no previous file with comments | « services/ui/ws/frame_generator.cc ('k') | services/ui/ws/platform_display.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "cc/quads/shared_quad_state.h" 11 #include "cc/quads/shared_quad_state.h"
12 #include "services/ui/gles2/gpu_state.h"
12 #include "services/ui/ws/platform_display_init_params.h" 13 #include "services/ui/ws/platform_display_init_params.h"
13 #include "services/ui/ws/server_window.h" 14 #include "services/ui/ws/server_window.h"
14 #include "services/ui/ws/server_window_surface_manager.h" 15 #include "services/ui/ws/server_window_surface_manager.h"
15 #include "services/ui/ws/test_server_window_delegate.h" 16 #include "services/ui/ws/test_server_window_delegate.h"
16 #include "services/ui/ws/test_utils.h" 17 #include "services/ui/ws/test_utils.h"
17 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
18 19
19 namespace ui { 20 namespace ui {
20 namespace ws { 21 namespace ws {
21 namespace test { 22 namespace test {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 frame_generator_->DrawWindowTree( 67 frame_generator_->DrawWindowTree(
67 pass, frame_generator_delegate_->GetRootWindow(), gfx::Vector2d(), 1.0f); 68 pass, frame_generator_delegate_->GetRootWindow(), gfx::Vector2d(), 1.0f);
68 } 69 }
69 70
70 void FrameGeneratorTest::SetUp() { 71 void FrameGeneratorTest::SetUp() {
71 testing::Test::SetUp(); 72 testing::Test::SetUp();
72 frame_generator_delegate_.reset(new TestFrameGeneratorDelegate( 73 frame_generator_delegate_.reset(new TestFrameGeneratorDelegate(
73 base::WrapUnique(new ServerWindow(&window_delegate_, WindowId())))); 74 base::WrapUnique(new ServerWindow(&window_delegate_, WindowId()))));
74 PlatformDisplayInitParams init_params; 75 PlatformDisplayInitParams init_params;
75 frame_generator_.reset(new FrameGenerator(frame_generator_delegate_.get(), 76 frame_generator_.reset(new FrameGenerator(frame_generator_delegate_.get(),
77 init_params.gpu_state,
76 init_params.surfaces_state)); 78 init_params.surfaces_state));
77 InitWindow(root_window()); 79 InitWindow(root_window());
78 } 80 }
79 81
80 void FrameGeneratorTest::TearDown() { 82 void FrameGeneratorTest::TearDown() {
81 frame_generator_.reset(); 83 frame_generator_.reset();
82 frame_generator_delegate_.reset(); 84 frame_generator_delegate_.reset();
83 } 85 }
84 86
85 // Tests correctness of the SharedQuadStateList generated by 87 // Tests correctness of the SharedQuadStateList generated by
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 EXPECT_EQ(3u, quad_state_list->size()); 122 EXPECT_EQ(3u, quad_state_list->size());
121 auto it = quad_state_list->begin(); 123 auto it = quad_state_list->begin();
122 EXPECT_EQ(child_opacity * root_opacity, (*it)->opacity); 124 EXPECT_EQ(child_opacity * root_opacity, (*it)->opacity);
123 EXPECT_EQ(child_opacity * root_opacity, (*++it)->opacity); 125 EXPECT_EQ(child_opacity * root_opacity, (*++it)->opacity);
124 EXPECT_EQ(root_opacity, (*++it)->opacity); 126 EXPECT_EQ(root_opacity, (*++it)->opacity);
125 } 127 }
126 128
127 } // namespace test 129 } // namespace test
128 } // namespace ws 130 } // namespace ws
129 } // namespace ui 131 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/frame_generator.cc ('k') | services/ui/ws/platform_display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698