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

Side by Side Diff: ui/wm/core/coordinate_conversion_unittest.cc

Issue 2660873002: Move two utility functions from ash/screen_util.h to ui/wm/core/coordinate_conversion.h (Closed)
Patch Set: rebase Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « ui/wm/core/coordinate_conversion.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/wm/core/coordinate_conversion.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "ui/aura/client/screen_position_client.h"
9 #include "ui/aura/test/aura_test_base.h"
10 #include "ui/aura/test/test_windows.h"
11 #include "ui/wm/core/default_screen_position_client.h"
12
13 namespace wm {
14
15 typedef aura::test::AuraTestBase CoordinateConversionTest;
16
17 TEST_F(CoordinateConversionTest, ConvertRect) {
18 DefaultScreenPositionClient screen_position_client;
19 aura::client::SetScreenPositionClient(root_window(), &screen_position_client);
20 aura::Window* w = aura::test::CreateTestWindowWithBounds(
21 gfx::Rect(10, 20, 100, 200), root_window());
22
23 gfx::Rect r1(10, 20, 100, 120);
24 ConvertRectFromScreen(w, &r1);
25 EXPECT_EQ("0,0 100x120", r1.ToString());
26
27 gfx::Rect r2(0, 0, 100, 200);
28 ConvertRectFromScreen(w, &r2);
29 EXPECT_EQ("-10,-20 100x200", r2.ToString());
30
31 gfx::Rect r3(30, 30, 100, 200);
32 ConvertRectToScreen(w, &r3);
33 EXPECT_EQ("40,50 100x200", r3.ToString());
34
35 gfx::Rect r4(-10, -20, 100, 200);
36 ConvertRectToScreen(w, &r4);
37 EXPECT_EQ("0,0 100x200", r4.ToString());
38
39 aura::client::SetScreenPositionClient(root_window(), nullptr);
40 }
41
42 } // namespace wm
OLDNEW
« no previous file with comments | « ui/wm/core/coordinate_conversion.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698