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

Side by Side Diff: ui/base/cursor/cursor_loader_x11_unittest.cc

Issue 854713003: More old files deletion. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix tryjobs? Created 5 years, 11 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/base/cursor/cursor_loader_x11.cc ('k') | ui/base/cursor/cursor_util.h » ('j') | 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 2013 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/base/cursor/cursor_loader_x11.h"
6
7 #undef None
8 #undef Bool
9
10 #include "base/logging.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "third_party/skia/include/core/SkBitmap.h"
13 #include "ui/base/cursor/cursor_util.h"
14
15 namespace ui {
16
17 TEST(CursorLoaderX11Test, ScaleAndRotate) {
18 SkBitmap bitmap;
19 bitmap.allocN32Pixels(10, 5);
20 bitmap.eraseColor(SK_ColorBLACK);
21
22 gfx::Point hotpoint(3,4);
23
24 ScaleAndRotateCursorBitmapAndHotpoint(1.0f,
25 gfx::Display::ROTATE_0,
26 &bitmap,
27 &hotpoint);
28 EXPECT_EQ(10, bitmap.width());
29 EXPECT_EQ(5, bitmap.height());
30 EXPECT_EQ("3,4", hotpoint.ToString());
31
32 ScaleAndRotateCursorBitmapAndHotpoint(1.0f,
33 gfx::Display::ROTATE_90,
34 &bitmap,
35 &hotpoint);
36
37 EXPECT_EQ(5, bitmap.width());
38 EXPECT_EQ(10, bitmap.height());
39 EXPECT_EQ("1,3", hotpoint.ToString());
40
41 ScaleAndRotateCursorBitmapAndHotpoint(2.0f,
42 gfx::Display::ROTATE_180,
43 &bitmap,
44 &hotpoint);
45 EXPECT_EQ(10, bitmap.width());
46 EXPECT_EQ(20, bitmap.height());
47 EXPECT_EQ("8,14", hotpoint.ToString());
48
49 ScaleAndRotateCursorBitmapAndHotpoint(1.0f,
50 gfx::Display::ROTATE_270,
51 &bitmap,
52 &hotpoint);
53 EXPECT_EQ(20, bitmap.width());
54 EXPECT_EQ(10, bitmap.height());
55 EXPECT_EQ("14,2", hotpoint.ToString());
56 }
57
58 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/cursor/cursor_loader_x11.cc ('k') | ui/base/cursor/cursor_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698