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

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

Issue 361643002: setConfig is deprecated, use setInfo or allocPixels instead (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: don't call allocPixels+rowbytes yet (skia bug) Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « ui/base/clipboard/clipboard_android.cc ('k') | ui/base/resource/resource_bundle.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/cursor/cursor_loader_x11.h" 5 #include "ui/base/cursor/cursor_loader_x11.h"
6 6
7 #undef None 7 #undef None
8 #undef Bool 8 #undef Bool
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "third_party/skia/include/core/SkBitmap.h" 12 #include "third_party/skia/include/core/SkBitmap.h"
13 #include "ui/base/cursor/cursor_util.h" 13 #include "ui/base/cursor/cursor_util.h"
14 14
15 namespace ui { 15 namespace ui {
16 16
17 TEST(CursorLoaderX11Test, ScaleAndRotate) { 17 TEST(CursorLoaderX11Test, ScaleAndRotate) {
18 SkBitmap bitmap; 18 SkBitmap bitmap;
19 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 5); 19 bitmap.allocN32Pixels(10, 5);
20 bitmap.allocPixels();
21 bitmap.eraseColor(SK_ColorBLACK); 20 bitmap.eraseColor(SK_ColorBLACK);
22 21
23 gfx::Point hotpoint(3,4); 22 gfx::Point hotpoint(3,4);
24 23
25 ScaleAndRotateCursorBitmapAndHotpoint(1.0f, 24 ScaleAndRotateCursorBitmapAndHotpoint(1.0f,
26 gfx::Display::ROTATE_0, 25 gfx::Display::ROTATE_0,
27 &bitmap, 26 &bitmap,
28 &hotpoint); 27 &hotpoint);
29 EXPECT_EQ(10, bitmap.width()); 28 EXPECT_EQ(10, bitmap.width());
30 EXPECT_EQ(5, bitmap.height()); 29 EXPECT_EQ(5, bitmap.height());
(...skipping 19 matching lines...) Expand all
50 ScaleAndRotateCursorBitmapAndHotpoint(1.0f, 49 ScaleAndRotateCursorBitmapAndHotpoint(1.0f,
51 gfx::Display::ROTATE_270, 50 gfx::Display::ROTATE_270,
52 &bitmap, 51 &bitmap,
53 &hotpoint); 52 &hotpoint);
54 EXPECT_EQ(20, bitmap.width()); 53 EXPECT_EQ(20, bitmap.width());
55 EXPECT_EQ(10, bitmap.height()); 54 EXPECT_EQ(10, bitmap.height());
56 EXPECT_EQ("14,2", hotpoint.ToString()); 55 EXPECT_EQ("14,2", hotpoint.ToString());
57 } 56 }
58 57
59 } // namespace ui 58 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard_android.cc ('k') | ui/base/resource/resource_bundle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698