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

Unified Diff: services/window_manager/view_target_unittest.cc

Issue 1530333005: Delete the ViewManager and WindowManager services. (Closed) Base URL: git@github.com:domokit/mojo.git@cl-2c
Patch Set: rebase Created 5 years 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/window_manager/view_target.cc ('k') | services/window_manager/view_targeter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/window_manager/view_target_unittest.cc
diff --git a/services/window_manager/view_target_unittest.cc b/services/window_manager/view_target_unittest.cc
deleted file mode 100644
index 95247599924f991ddbc254960abb6650dd89c9c1..0000000000000000000000000000000000000000
--- a/services/window_manager/view_target_unittest.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2014 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 "services/window_manager/view_target.h"
-
-#include <set>
-
-#include "mojo/services/view_manager/cpp/view.h"
-#include "services/window_manager/window_manager_test_util.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "ui/gfx/geometry/rect.h"
-
-namespace window_manager {
-
-using ViewTargetTest = testing::Test;
-
-// V1
-// +-- V2
-// +-- V3
-TEST_F(ViewTargetTest, GetRoot) {
- TestView v1(1, gfx::Rect(20, 20, 400, 400));
- TestView v2(2, gfx::Rect(10, 10, 350, 350));
- TestView v3(3, gfx::Rect(10, 10, 100, 100));
- v1.AddChild(&v2);
- v2.AddChild(&v3);
-
- EXPECT_EQ(ViewTarget::TargetFromView(&v1),
- ViewTarget::TargetFromView(&v1)->GetRoot());
- EXPECT_EQ(ViewTarget::TargetFromView(&v1),
- ViewTarget::TargetFromView(&v2)->GetRoot());
- EXPECT_EQ(ViewTarget::TargetFromView(&v1),
- ViewTarget::TargetFromView(&v3)->GetRoot());
-}
-
-// V1
-// +-- V2
-TEST_F(ViewTargetTest, ConvertPointToTarget_Simple) {
- TestView v1(1, gfx::Rect(20, 20, 400, 400));
- TestView v2(2, gfx::Rect(10, 10, 350, 350));
- v1.AddChild(&v2);
-
- ViewTarget* t1 = v1.target();
- ViewTarget* t2 = v2.target();
-
- gfx::Point point1_in_t2_coords(5, 5);
- ViewTarget::ConvertPointToTarget(t2, t1, &point1_in_t2_coords);
- gfx::Point point1_in_t1_coords(15, 15);
- EXPECT_EQ(point1_in_t1_coords, point1_in_t2_coords);
-
- gfx::Point point2_in_t1_coords(5, 5);
- ViewTarget::ConvertPointToTarget(t1, t2, &point2_in_t1_coords);
- gfx::Point point2_in_t2_coords(-5, -5);
- EXPECT_EQ(point2_in_t2_coords, point2_in_t1_coords);
-}
-
-// V1
-// +-- V2
-// +-- V3
-TEST_F(ViewTargetTest, ConvertPointToTarget_Medium) {
- TestView v1(1, gfx::Rect(20, 20, 400, 400));
- TestView v2(2, gfx::Rect(10, 10, 350, 350));
- TestView v3(3, gfx::Rect(10, 10, 100, 100));
- v1.AddChild(&v2);
- v2.AddChild(&v3);
-
- ViewTarget* t1 = v1.target();
- ViewTarget* t3 = v3.target();
-
- gfx::Point point1_in_t3_coords(5, 5);
- ViewTarget::ConvertPointToTarget(t3, t1, &point1_in_t3_coords);
- gfx::Point point1_in_t1_coords(25, 25);
- EXPECT_EQ(point1_in_t1_coords, point1_in_t3_coords);
-
- gfx::Point point2_in_t1_coords(5, 5);
- ViewTarget::ConvertPointToTarget(t1, t3, &point2_in_t1_coords);
- gfx::Point point2_in_t3_coords(-15, -15);
- EXPECT_EQ(point2_in_t3_coords, point2_in_t1_coords);
-}
-
-} // namespace window_manager
« no previous file with comments | « services/window_manager/view_target.cc ('k') | services/window_manager/view_targeter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698