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

Side by Side Diff: content/renderer/render_widget_browsertest.cc

Issue 7397021: Re-land r93365 - add RefCountedString (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 9 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 | « chrome/browser/ui/webui/workers_ui.cc ('k') | no next file » | 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 "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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/workers_ui.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698