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

Side by Side Diff: Source/web/tests/DragImageTest.cpp

Issue 204353005: Remove use of SkBitmap::Config (deprecated) from Source/web/tests/. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add EXPECT_TRUE in two places ASSERT_TRUE does not work Created 6 years, 9 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 | « no previous file | Source/web/tests/GraphicsContextTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 static PassRefPtr<TestImage> create(const IntSize& size) 57 static PassRefPtr<TestImage> create(const IntSize& size)
58 { 58 {
59 return adoptRef(new TestImage(size)); 59 return adoptRef(new TestImage(size));
60 } 60 }
61 61
62 explicit TestImage(const IntSize& size) 62 explicit TestImage(const IntSize& size)
63 : Image(0) 63 : Image(0)
64 , m_size(size) 64 , m_size(size)
65 { 65 {
66 m_nativeImage = NativeImageSkia::create(); 66 m_nativeImage = NativeImageSkia::create();
67 m_nativeImage->bitmap().setConfig(SkBitmap::kARGB_8888_Config, 67 EXPECT_TRUE(m_nativeImage->bitmap().allocN32Pixels(size.width(), size.he ight()));
68 size.width(), size.height(), 0);
69 m_nativeImage->bitmap().allocPixels();
70 } 68 }
71 69
72 virtual IntSize size() const OVERRIDE 70 virtual IntSize size() const OVERRIDE
73 { 71 {
74 return m_size; 72 return m_size;
75 } 73 }
76 74
77 virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() OVERRIDE 75 virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() OVERRIDE
78 { 76 {
79 if (m_size.isZero()) 77 if (m_size.isZero())
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 153
156 OwnPtr<DragImage> testImage = 154 OwnPtr<DragImage> testImage =
157 DragImage::create(url, testLabel, fontDescription, deviceScaleFactor); 155 DragImage::create(url, testLabel, fontDescription, deviceScaleFactor);
158 OwnPtr<DragImage> expectedImage = 156 OwnPtr<DragImage> expectedImage =
159 DragImage::create(url, expectedLabel, fontDescription, deviceScaleFactor ); 157 DragImage::create(url, expectedLabel, fontDescription, deviceScaleFactor );
160 158
161 EXPECT_EQ(testImage->size().width(), expectedImage->size().width()); 159 EXPECT_EQ(testImage->size().width(), expectedImage->size().width());
162 } 160 }
163 161
164 } // anonymous namespace 162 } // anonymous namespace
OLDNEW
« no previous file with comments | « no previous file | Source/web/tests/GraphicsContextTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698