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

Unified Diff: components/mus/ws/window_finder_unittest.cc

Issue 2119963002: Move mus to //services/ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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 | « components/mus/ws/window_finder.cc ('k') | components/mus/ws/window_manager_access_policy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/window_finder_unittest.cc
diff --git a/components/mus/ws/window_finder_unittest.cc b/components/mus/ws/window_finder_unittest.cc
deleted file mode 100644
index f910624ce433ca3a8072eb72633100589a9cbc79..0000000000000000000000000000000000000000
--- a/components/mus/ws/window_finder_unittest.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2015 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/ws/window_finder.h"
-
-#include "components/mus/ws/server_window.h"
-#include "components/mus/ws/server_window_surface_manager.h"
-#include "components/mus/ws/server_window_surface_manager_test_api.h"
-#include "components/mus/ws/test_server_window_delegate.h"
-#include "components/mus/ws/window_finder.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace mus {
-namespace ws {
-
-TEST(WindowFinderTest, FindDeepestVisibleWindow) {
- TestServerWindowDelegate window_delegate;
- ServerWindow root(&window_delegate, WindowId(1, 2));
- window_delegate.set_root_window(&root);
- root.SetVisible(true);
- root.SetBounds(gfx::Rect(0, 0, 100, 100));
-
- ServerWindow child1(&window_delegate, WindowId(1, 3));
- root.Add(&child1);
- EnableHitTest(&child1);
- child1.SetVisible(true);
- child1.SetBounds(gfx::Rect(10, 10, 20, 20));
-
- ServerWindow child2(&window_delegate, WindowId(1, 4));
- root.Add(&child2);
- EnableHitTest(&child2);
- child2.SetVisible(true);
- child2.SetBounds(gfx::Rect(15, 15, 20, 20));
-
- gfx::Point local_point(16, 16);
- EXPECT_EQ(&child2, FindDeepestVisibleWindowForEvents(&root, &local_point));
- EXPECT_EQ(gfx::Point(1, 1), local_point);
-
- local_point.SetPoint(13, 14);
- EXPECT_EQ(&child1, FindDeepestVisibleWindowForEvents(&root, &local_point));
- EXPECT_EQ(gfx::Point(3, 4), local_point);
-
- child2.set_extended_hit_test_region(gfx::Insets(10, 10, 10, 10));
- local_point.SetPoint(13, 14);
- EXPECT_EQ(&child2, FindDeepestVisibleWindowForEvents(&root, &local_point));
- EXPECT_EQ(gfx::Point(-2, -1), local_point);
-}
-
-TEST(WindowFinderTest, FindDeepestVisibleWindowHitTestMask) {
- TestServerWindowDelegate window_delegate;
- ServerWindow root(&window_delegate, WindowId(1, 2));
- window_delegate.set_root_window(&root);
- EnableHitTest(&root);
- root.SetVisible(true);
- root.SetBounds(gfx::Rect(0, 0, 100, 100));
-
- ServerWindow child_with_mask(&window_delegate, WindowId(1, 4));
- root.Add(&child_with_mask);
- EnableHitTest(&child_with_mask);
- child_with_mask.SetVisible(true);
- child_with_mask.SetBounds(gfx::Rect(10, 10, 20, 20));
- child_with_mask.SetHitTestMask(gfx::Rect(2, 2, 16, 16));
-
- // Test a point inside the window but outside the mask.
- gfx::Point point_outside_mask(11, 11);
- EXPECT_EQ(&root,
- FindDeepestVisibleWindowForEvents(&root, &point_outside_mask));
- EXPECT_EQ(gfx::Point(11, 11), point_outside_mask);
-
- // Test a point inside the window and inside the mask.
- gfx::Point point_inside_mask(15, 15);
- EXPECT_EQ(&child_with_mask,
- FindDeepestVisibleWindowForEvents(&root, &point_inside_mask));
- EXPECT_EQ(gfx::Point(5, 5), point_inside_mask);
-}
-
-} // namespace ws
-} // namespace mus
« no previous file with comments | « components/mus/ws/window_finder.cc ('k') | components/mus/ws/window_manager_access_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698