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

Side by Side Diff: chrome/browser/ui/cocoa/table_row_nsimage_cache_unittest.mm

Issue 363933002: setConfig is deprecated, use setInfo or allocPixels instead. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
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 "chrome/browser/ui/cocoa/table_row_nsimage_cache.h" 5 #include "chrome/browser/ui/cocoa/table_row_nsimage_cache.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "third_party/skia/include/core/SkBitmap.h" 8 #include "third_party/skia/include/core/SkBitmap.h"
9 #include "ui/gfx/image/image_skia.h" 9 #include "ui/gfx/image/image_skia.h"
10 10
(...skipping 13 matching lines...) Expand all
24 virtual gfx::ImageSkia GetIcon(int index) const OVERRIDE { 24 virtual gfx::ImageSkia GetIcon(int index) const OVERRIDE {
25 return gfx::ImageSkia::CreateFrom1xBitmap(rows_[index]); 25 return gfx::ImageSkia::CreateFrom1xBitmap(rows_[index]);
26 } 26 }
27 27
28 private: 28 private:
29 std::vector<SkBitmap> rows_; 29 std::vector<SkBitmap> rows_;
30 }; 30 };
31 31
32 SkBitmap MakeImage(int width, int height) { 32 SkBitmap MakeImage(int width, int height) {
33 SkBitmap image; 33 SkBitmap image;
34 image.setConfig(SkBitmap::kARGB_8888_Config, width, height); 34 EXPECT_TRUE(image.allocN32Pixels(width, height));
35 EXPECT_TRUE(image.allocPixels());
36 image.eraseARGB(255, 255, 0, 0); 35 image.eraseARGB(255, 255, 0, 0);
37 return image; 36 return image;
38 } 37 }
39 38
40 // Define this as a macro so that the original variable names can be used in 39 // Define this as a macro so that the original variable names can be used in
41 // test output. 40 // test output.
42 #define COMPARE_SK_NS_IMG_SIZES(skia, cocoa) \ 41 #define COMPARE_SK_NS_IMG_SIZES(skia, cocoa) \
43 EXPECT_EQ(skia.width(), [cocoa size].width); \ 42 EXPECT_EQ(skia.width(), [cocoa size].width); \
44 EXPECT_EQ(skia.height(), [cocoa size].height); 43 EXPECT_EQ(skia.height(), [cocoa size].height);
45 44
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 cache.OnItemsRemoved(1, 3); 191 cache.OnItemsRemoved(1, 3);
193 192
194 image0 = cache.GetImageForRow(0); 193 image0 = cache.GetImageForRow(0);
195 image1 = cache.GetImageForRow(1); 194 image1 = cache.GetImageForRow(1);
196 195
197 COMPARE_SK_NS_IMG_SIZES(rows->at(0), image0); 196 COMPARE_SK_NS_IMG_SIZES(rows->at(0), image0);
198 COMPARE_SK_NS_IMG_SIZES(rows->at(1), image1); 197 COMPARE_SK_NS_IMG_SIZES(rows->at(1), image1);
199 } 198 }
200 199
201 } // namespace 200 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm ('k') | components/search_provider_logos/logo_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698