OLD | NEW |
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 "content/renderer/render_widget_browsertest.h" | 5 #include "content/renderer/render_widget_browsertest.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/memory/ref_counted_memory.h" | 10 #include "base/memory/ref_counted_memory.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 const FilePath& file_path) { | 130 const FilePath& file_path) { |
131 scoped_refptr<RefCountedBytes> bitmap_data(new RefCountedBytes()); | 131 scoped_refptr<RefCountedBytes> bitmap_data(new RefCountedBytes()); |
132 SkAutoLockPixels lock(bitmap); | 132 SkAutoLockPixels lock(bitmap); |
133 ASSERT_TRUE(gfx::JPEGCodec::Encode( | 133 ASSERT_TRUE(gfx::JPEGCodec::Encode( |
134 reinterpret_cast<unsigned char*>(bitmap.getAddr32(0, 0)), | 134 reinterpret_cast<unsigned char*>(bitmap.getAddr32(0, 0)), |
135 gfx::JPEGCodec::FORMAT_BGRA, | 135 gfx::JPEGCodec::FORMAT_BGRA, |
136 bitmap.width(), | 136 bitmap.width(), |
137 bitmap.height(), | 137 bitmap.height(), |
138 static_cast<int>(bitmap.rowBytes()), | 138 static_cast<int>(bitmap.rowBytes()), |
139 90 /* quality */, | 139 90 /* quality */, |
140 &bitmap_data->data)); | 140 &bitmap_data->data())); |
141 ASSERT_LT(0, file_util::WriteFile( | 141 ASSERT_LT(0, file_util::WriteFile( |
142 file_path, | 142 file_path, |
143 reinterpret_cast<const char*>(bitmap_data->front()), | 143 reinterpret_cast<const char*>(bitmap_data->front()), |
144 bitmap_data->size())); | 144 bitmap_data->size())); |
145 } | 145 } |
146 | 146 |
147 TEST_F(RenderWidgetTest, OnMsgPaintAtSize) { | 147 TEST_F(RenderWidgetTest, OnMsgPaintAtSize) { |
148 TestResizeAndPaint(); | 148 TestResizeAndPaint(); |
149 } | 149 } |
OLD | NEW |