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

Side by Side Diff: ui/views/controls/button/image_button_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/ozone/platform/dri/dri_surface.cc ('k') | ui/views/controls/button/label_button_unittest.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "ui/base/layout.h" 6 #include "ui/base/layout.h"
7 #include "ui/views/border.h" 7 #include "ui/views/border.h"
8 #include "ui/views/controls/button/image_button.h" 8 #include "ui/views/controls/button/image_button.h"
9 #include "ui/views/test/views_test_base.h" 9 #include "ui/views/test/views_test_base.h"
10 10
11 namespace { 11 namespace {
12 12
13 gfx::ImageSkia CreateTestImage(int width, int height) { 13 gfx::ImageSkia CreateTestImage(int width, int height) {
14 SkBitmap bitmap; 14 SkBitmap bitmap;
15 bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height); 15 bitmap.allocN32Pixels(width, height);
16 bitmap.allocPixels();
17 return gfx::ImageSkia::CreateFrom1xBitmap(bitmap); 16 return gfx::ImageSkia::CreateFrom1xBitmap(bitmap);
18 } 17 }
19 18
20 } // namespace 19 } // namespace
21 20
22 namespace views { 21 namespace views {
23 22
24 typedef ViewsTestBase ImageButtonTest; 23 typedef ViewsTestBase ImageButtonTest;
25 24
26 TEST_F(ImageButtonTest, Basics) { 25 TEST_F(ImageButtonTest, Basics) {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 ImageButton::ALIGN_BOTTOM); 138 ImageButton::ALIGN_BOTTOM);
140 button.SetDrawImageMirrored(true); 139 button.SetDrawImageMirrored(true);
141 140
142 // Because the coordinates are flipped, we should expect this to draw as if 141 // Because the coordinates are flipped, we should expect this to draw as if
143 // it were ALIGN_LEFT. 142 // it were ALIGN_LEFT.
144 EXPECT_EQ(gfx::Point(0, 0).ToString(), 143 EXPECT_EQ(gfx::Point(0, 0).ToString(),
145 button.ComputeImagePaintPosition(image).ToString()); 144 button.ComputeImagePaintPosition(image).ToString());
146 } 145 }
147 146
148 } // namespace views 147 } // namespace views
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/dri_surface.cc ('k') | ui/views/controls/button/label_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698