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

Side by Side Diff: ui/gfx/image/image_unittest.cc

Issue 8769017: GTK: Move CairoCachedSurface from being owned by GtkThemeService to gfx::Image. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase for commit Created 9 years 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/gfx/image/image.cc ('k') | ui/ui.gyp » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 #include "third_party/skia/include/core/SkBitmap.h" 7 #include "third_party/skia/include/core/SkBitmap.h"
8 #include "ui/gfx/image/image.h" 8 #include "ui/gfx/image/image.h"
9 #include "ui/gfx/image/image_unittest_util.h" 9 #include "ui/gfx/image/image_unittest_util.h"
10 10
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 GdkPixbuf* pixbuf; 134 GdkPixbuf* pixbuf;
135 135
136 { 136 {
137 gfx::Image image(gt::CreateBitmap(25, 25)); 137 gfx::Image image(gt::CreateBitmap(25, 25));
138 pixbuf = image.CopyGdkPixbuf(); 138 pixbuf = image.CopyGdkPixbuf();
139 } 139 }
140 140
141 EXPECT_TRUE(pixbuf); 141 EXPECT_TRUE(pixbuf);
142 g_object_unref(pixbuf); 142 g_object_unref(pixbuf);
143 } 143 }
144
145 TEST_F(ImageTest, SkiaToCairoCreatesGdk) {
146 gfx::Image image(gt::CreateBitmap(25, 25));
147 EXPECT_FALSE(image.HasRepresentation(gfx::Image::kImageRepGdk));
148 EXPECT_TRUE(image.ToCairo());
149 EXPECT_TRUE(image.HasRepresentation(gfx::Image::kImageRepGdk));
150 }
144 #endif 151 #endif
145 152
146 #if defined(OS_MACOSX) 153 #if defined(OS_MACOSX)
147 TEST_F(ImageTest, SkiaToCocoaCopy) { 154 TEST_F(ImageTest, SkiaToCocoaCopy) {
148 NSImage* ns_image; 155 NSImage* ns_image;
149 156
150 { 157 {
151 gfx::Image image(gt::CreateBitmap(25, 25)); 158 gfx::Image image(gt::CreateBitmap(25, 25));
152 ns_image = image.CopyNSImage(); 159 ns_image = image.CopyNSImage();
153 } 160 }
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 // Sanity check. 251 // Sanity check.
245 EXPECT_EQ(1u, image.RepresentationCount()); 252 EXPECT_EQ(1u, image.RepresentationCount());
246 EXPECT_EQ(2u, image.GetNumberOfSkBitmaps()); 253 EXPECT_EQ(2u, image.GetNumberOfSkBitmaps());
247 } 254 }
248 255
249 // Integration tests with UI toolkit frameworks require linking against the 256 // Integration tests with UI toolkit frameworks require linking against the
250 // Views library and cannot be here (gfx_unittests doesn't include it). They 257 // Views library and cannot be here (gfx_unittests doesn't include it). They
251 // instead live in /chrome/browser/ui/tests/ui_gfx_image_unittest.cc. 258 // instead live in /chrome/browser/ui/tests/ui_gfx_image_unittest.cc.
252 259
253 } // namespace 260 } // namespace
OLDNEW
« no previous file with comments | « ui/gfx/image/image.cc ('k') | ui/ui.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698