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

Unified Diff: ui/aura/mus/window_tree_host_mus_unittest.cc

Issue 2507963002: Implement hit tests/client area. (Closed)
Patch Set: add it back 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/mus/window_tree_host_mus_delegate.h ('k') | ui/aura/test/mus/test_window_tree.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/window_tree_host_mus_unittest.cc
diff --git a/ui/aura/mus/window_tree_host_mus_unittest.cc b/ui/aura/mus/window_tree_host_mus_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fd2e93b2d7561ee6366ca00a67df20d6c63111a8
--- /dev/null
+++ b/ui/aura/mus/window_tree_host_mus_unittest.cc
@@ -0,0 +1,37 @@
+// 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 "ui/aura/mus/window_tree_host_mus.h"
+
+#include "ui/aura/test/aura_mus_test_base.h"
+#include "ui/aura/test/mus/test_window_tree.h"
+
+namespace aura {
+
+using WindowTreeHostMusTest = aura::test::AuraMusClientTestBase;
+
+TEST_F(WindowTreeHostMusTest, UpdateClientArea) {
+ std::unique_ptr<WindowTreeHostMus> window_tree_host_mus =
+ base::MakeUnique<WindowTreeHostMus>(window_tree_client_impl());
+
+ gfx::Insets new_insets(10, 11, 12, 13);
+ window_tree_host_mus->SetClientArea(new_insets);
+ EXPECT_EQ(new_insets, window_tree()->last_client_area());
+}
+
+TEST_F(WindowTreeHostMusTest, SetHitTestMask) {
+ std::unique_ptr<WindowTreeHostMus> window_tree_host_mus =
+ base::MakeUnique<WindowTreeHostMus>(window_tree_client_impl());
+
+ EXPECT_FALSE(window_tree()->last_hit_test_mask().has_value());
+ gfx::Rect mask(10, 10, 10, 10);
+ window_tree_host_mus->SetHitTestMask(mask);
+ ASSERT_TRUE(window_tree()->last_hit_test_mask().has_value());
+ EXPECT_EQ(mask, window_tree()->last_hit_test_mask());
+
+ window_tree_host_mus->SetHitTestMask(base::nullopt);
+ ASSERT_FALSE(window_tree()->last_hit_test_mask().has_value());
+}
+
+} // namespace aura
« no previous file with comments | « ui/aura/mus/window_tree_host_mus_delegate.h ('k') | ui/aura/test/mus/test_window_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698