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

Unified Diff: mojo/services/view_manager/view_coordinate_conversions_unittest.cc

Issue 774473003: Move view_manager service implementation to //services (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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
Index: mojo/services/view_manager/view_coordinate_conversions_unittest.cc
diff --git a/mojo/services/view_manager/view_coordinate_conversions_unittest.cc b/mojo/services/view_manager/view_coordinate_conversions_unittest.cc
deleted file mode 100644
index 71710d3c31d80b24a236230cc7e2bc719cdd0ae4..0000000000000000000000000000000000000000
--- a/mojo/services/view_manager/view_coordinate_conversions_unittest.cc
+++ /dev/null
@@ -1,69 +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 "mojo/services/view_manager/server_view.h"
-#include "mojo/services/view_manager/server_view_delegate.h"
-#include "mojo/services/view_manager/view_coordinate_conversions.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "ui/gfx/geometry/rect.h"
-#include "ui/gfx/geometry/vector2d.h"
-
-namespace mojo {
-namespace service {
-namespace {
-
-class MockServerViewDelegate : public ServerViewDelegate {
- public:
- MockServerViewDelegate() {}
- ~MockServerViewDelegate() override {}
-
- private:
- // ServerViewDelegate:
- void OnWillDestroyView(ServerView* view) override {}
- void OnViewDestroyed(const ServerView* view) override {}
- void OnWillChangeViewHierarchy(ServerView* view,
- ServerView* new_parent,
- ServerView* old_parent) override {}
- void OnViewHierarchyChanged(const ServerView* view,
- const ServerView* new_parent,
- const ServerView* old_parent) override {}
- void OnViewBoundsChanged(const ServerView* view,
- const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) override {}
- void OnViewSurfaceIdChanged(const ServerView* view) override {}
- void OnViewReordered(const ServerView* view,
- const ServerView* relative,
- OrderDirection direction) override {}
- void OnWillChangeViewVisibility(ServerView* view) override {}
- void OnViewSharedPropertyChanged(
- const ServerView* view,
- const std::string& name,
- const std::vector<uint8_t>* new_data) override {}
- void OnScheduleViewPaint(const ServerView* view) override {}
-
- DISALLOW_COPY_AND_ASSIGN(MockServerViewDelegate);
-};
-
-} // namespace
-
-using ViewCoordinateConversionsTest = testing::Test;
-
-TEST_F(ViewCoordinateConversionsTest, ConvertRectBetweenViews) {
- MockServerViewDelegate d1, d2, d3;
- ServerView v1(&d1, ViewId()), v2(&d2, ViewId()), v3(&d3, ViewId());
- v1.SetBounds(gfx::Rect(1, 2, 100, 100));
- v2.SetBounds(gfx::Rect(3, 4, 100, 100));
- v3.SetBounds(gfx::Rect(5, 6, 100, 100));
- v1.Add(&v2);
- v2.Add(&v3);
-
- EXPECT_EQ(gfx::Rect(2, 1, 8, 9),
- ConvertRectBetweenViews(&v1, &v3, gfx::Rect(10, 11, 8, 9)));
-
- EXPECT_EQ(gfx::Rect(18, 21, 8, 9),
- ConvertRectBetweenViews(&v3, &v1, gfx::Rect(10, 11, 8, 9)));
-}
-
-} // namespace service
-} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698