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

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

Issue 2617403003: Mus: Remove CompositorFrameSinkType (Closed)
Patch Set: Fix some unit tests Created 3 years, 11 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/server_window.h » ('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/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/test/test_message_loop.h" 10 #include "base/test/test_message_loop.h"
(...skipping 14 matching lines...) Expand all
25 25
26 // Typical id for the display root ServerWindow. 26 // Typical id for the display root ServerWindow.
27 constexpr WindowId kRootDisplayId(0, 2); 27 constexpr WindowId kRootDisplayId(0, 2);
28 const base::UnguessableToken kArbitraryToken = base::UnguessableToken::Create(); 28 const base::UnguessableToken kArbitraryToken = base::UnguessableToken::Create();
29 29
30 // Makes the window visible and creates the default surface for it. 30 // Makes the window visible and creates the default surface for it.
31 void InitWindow(ServerWindow* window) { 31 void InitWindow(ServerWindow* window) {
32 window->SetVisible(true); 32 window->SetVisible(true);
33 ServerWindowCompositorFrameSinkManager* compositor_frame_sink_manager = 33 ServerWindowCompositorFrameSinkManager* compositor_frame_sink_manager =
34 window->GetOrCreateCompositorFrameSinkManager(); 34 window->GetOrCreateCompositorFrameSinkManager();
35 compositor_frame_sink_manager->SetLatestSurfaceInfo( 35 compositor_frame_sink_manager->SetLatestSurfaceInfo(cc::SurfaceInfo(
36 mojom::CompositorFrameSinkType::DEFAULT, 36 cc::SurfaceId(cc::FrameSinkId(WindowIdToTransportId(window->id()), 0),
37 cc::SurfaceInfo( 37 cc::LocalFrameId(1u, kArbitraryToken)),
38 cc::SurfaceId( 38 1.0f, gfx::Size(100, 100)));
39 cc::FrameSinkId(WindowIdToTransportId(window->id()),
40 static_cast<uint32_t>(
41 mojom::CompositorFrameSinkType::DEFAULT)),
42 cc::LocalFrameId(1u, kArbitraryToken)),
43 1.0f, gfx::Size(100, 100)));
44 } 39 }
45 40
46 } // namespace 41 } // namespace
47 42
48 class FrameGeneratorTest : public testing::Test { 43 class FrameGeneratorTest : public testing::Test {
49 public: 44 public:
50 FrameGeneratorTest() 45 FrameGeneratorTest()
51 : root_window_(base::MakeUnique<ServerWindow>(&window_delegate_, 46 : root_window_(base::MakeUnique<ServerWindow>(&window_delegate_,
52 kRootDisplayId)) {} 47 kRootDisplayId)) {}
53 ~FrameGeneratorTest() override {} 48 ~FrameGeneratorTest() override {}
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 107
113 EXPECT_EQ(1u, quad_state_list->size()); 108 EXPECT_EQ(1u, quad_state_list->size());
114 cc::SharedQuadState* root_sqs = quad_state_list->back(); 109 cc::SharedQuadState* root_sqs = quad_state_list->back();
115 // Opacity should always be 1. 110 // Opacity should always be 1.
116 EXPECT_EQ(1.0f, root_sqs->opacity); 111 EXPECT_EQ(1.0f, root_sqs->opacity);
117 } 112 }
118 113
119 } // namespace test 114 } // namespace test
120 } // namespace ws 115 } // namespace ws
121 } // namespace ui 116 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/frame_generator.cc ('k') | services/ui/ws/server_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698