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

Unified Diff: services/ui/ws/frame_generator_unittest.cc

Issue 2445873003: Pass root ServerWindow id to FrameGenerator. (Closed)
Patch Set: Address nits. Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/ws/frame_generator.cc ('k') | services/ui/ws/ids.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/frame_generator_unittest.cc
diff --git a/services/ui/ws/frame_generator_unittest.cc b/services/ui/ws/frame_generator_unittest.cc
index bd72df778dd92e5f07698e2f92e2383d2a4e67b7..b30a6aa6fc721ee8a998e697a03be82ff47cf6dc 100644
--- a/services/ui/ws/frame_generator_unittest.cc
+++ b/services/ui/ws/frame_generator_unittest.cc
@@ -10,6 +10,7 @@
#include "cc/quads/render_pass.h"
#include "cc/quads/shared_quad_state.h"
#include "services/ui/surfaces/display_compositor.h"
+#include "services/ui/ws/ids.h"
#include "services/ui/ws/platform_display_init_params.h"
#include "services/ui/ws/server_window.h"
#include "services/ui/ws/server_window_compositor_frame_sink_manager.h"
@@ -22,6 +23,9 @@ namespace ws {
namespace test {
namespace {
+// Typical id for the display root ServerWindow.
+constexpr WindowId kRootDisplayId(0, 2);
+
// Makes the window visible and creates the default surface for it.
void InitWindow(ServerWindow* window) {
window->SetVisible(true);
@@ -37,7 +41,10 @@ void InitWindow(ServerWindow* window) {
class FrameGeneratorTest : public testing::Test {
public:
- FrameGeneratorTest() : display_compositor_(new DisplayCompositor(nullptr)) {}
+ FrameGeneratorTest()
+ : display_compositor_(new DisplayCompositor(nullptr)),
+ root_window_(base::MakeUnique<ServerWindow>(&window_delegate_,
+ kRootDisplayId)) {}
~FrameGeneratorTest() override {}
// Calls DrawWindowTree() on |frame_generator_|
@@ -58,6 +65,7 @@ class FrameGeneratorTest : public testing::Test {
std::unique_ptr<FrameGenerator> frame_generator_;
std::unique_ptr<TestFrameGeneratorDelegate> frame_generator_delegate_;
TestServerWindowDelegate window_delegate_;
+ std::unique_ptr<ServerWindow> root_window_;
// Needed so that Mojo classes can be initialized for ServerWindow use.
base::TestMessageLoop message_loop_;
@@ -77,7 +85,7 @@ void FrameGeneratorTest::SetUp() {
base::MakeUnique<ServerWindow>(&window_delegate_, WindowId()));
PlatformDisplayInitParams init_params;
frame_generator_ = base::MakeUnique<FrameGenerator>(
- frame_generator_delegate_.get(), display_compositor_);
+ frame_generator_delegate_.get(), root_window_.get(), display_compositor_);
InitWindow(root_window());
}
« no previous file with comments | « services/ui/ws/frame_generator.cc ('k') | services/ui/ws/ids.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698