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

Unified Diff: components/mus/public/cpp/tests/window_tree_client_impl_private.cc

Issue 1983243002: Creates mus test helper class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: override Created 4 years, 7 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
Index: components/mus/public/cpp/tests/window_tree_client_impl_private.cc
diff --git a/components/mus/public/cpp/tests/window_tree_client_impl_private.cc b/components/mus/public/cpp/tests/window_tree_client_impl_private.cc
new file mode 100644
index 0000000000000000000000000000000000000000..795e3dc0d2020322c46105298d64e2af29c53425
--- /dev/null
+++ b/components/mus/public/cpp/tests/window_tree_client_impl_private.cc
@@ -0,0 +1,36 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/mus/public/cpp/tests/window_tree_client_impl_private.h"
+
+#include "components/mus/public/cpp/lib/window_tree_client_impl.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
+
+namespace mus {
+
+WindowTreeClientImplPrivate::WindowTreeClientImplPrivate(
+ WindowTreeClientImpl* tree_client_impl)
+ : tree_client_impl_(tree_client_impl) {}
+
+WindowTreeClientImplPrivate::~WindowTreeClientImplPrivate() {}
+
+uint32_t WindowTreeClientImplPrivate::event_observer_id() {
+ return tree_client_impl_->event_observer_id_;
+}
+
+void WindowTreeClientImplPrivate::OnEmbed(mojom::WindowTree* window_tree) {
+ mojom::WindowDataPtr root_data(mojom::WindowData::New());
+ root_data->parent_id = 0;
+ root_data->window_id = 1;
+ root_data->bounds = mojo::Rect::From(gfx::Rect());
+ root_data->properties.SetToEmpty();
+ root_data->visible = true;
+ root_data->viewport_metrics = mojom::ViewportMetrics::New();
+ root_data->viewport_metrics->size_in_pixels =
+ mojo::Size::From(gfx::Size(1000, 1000));
+ root_data->viewport_metrics->device_pixel_ratio = 1;
+ tree_client_impl_->OnEmbedImpl(window_tree, 1, std::move(root_data), 0, true);
+}
+
+} // namespace mus

Powered by Google App Engine
This is Rietveld 408576698