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

Side by Side Diff: content/test/mock_webclipboard_impl.cc

Issue 221993002: Split content_shell dependencies for layout tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move WebKit test files to proper place Created 6 years, 8 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 | « content/shell/browser/shell_browser_main.cc ('k') | content/test/weburl_loader_mock_factory.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/test/mock_webclipboard_impl.h" 5 #include "content/test/mock_webclipboard_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // for endianess reasons, it will be BGRA8888 on Windows. 95 // for endianess reasons, it will be BGRA8888 on Windows.
96 const SkBitmap& bitmap = m_image.getSkBitmap(); 96 const SkBitmap& bitmap = m_image.getSkBitmap();
97 SkAutoLockPixels lock(bitmap); 97 SkAutoLockPixels lock(bitmap);
98 gfx::PNGCodec::Encode(static_cast<unsigned char*>(bitmap.getPixels()), 98 gfx::PNGCodec::Encode(static_cast<unsigned char*>(bitmap.getPixels()),
99 #if defined(OS_ANDROID) 99 #if defined(OS_ANDROID)
100 gfx::PNGCodec::FORMAT_RGBA, 100 gfx::PNGCodec::FORMAT_RGBA,
101 #else 101 #else
102 gfx::PNGCodec::FORMAT_BGRA, 102 gfx::PNGCodec::FORMAT_BGRA,
103 #endif 103 #endif
104 gfx::Size(bitmap.width(), bitmap.height()), 104 gfx::Size(bitmap.width(), bitmap.height()),
105 bitmap.rowBytes(), 105 static_cast<int>(bitmap.rowBytes()),
106 false /* discard_transparency */, 106 false /* discard_transparency */,
107 std::vector<gfx::PNGCodec::Comment>(), 107 std::vector<gfx::PNGCodec::Comment>(),
108 &encoded_image); 108 &encoded_image);
109 data.assign(reinterpret_cast<char*>(vector_as_array(&encoded_image)), 109 data.assign(reinterpret_cast<char*>(vector_as_array(&encoded_image)),
110 encoded_image.size()); 110 encoded_image.size());
111 return data; 111 return data;
112 } 112 }
113 113
114 blink::WebString MockWebClipboardImpl::readCustomData( 114 blink::WebString MockWebClipboardImpl::readCustomData(
115 blink::WebClipboard::Buffer buffer, 115 blink::WebClipboard::Buffer buffer,
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 void MockWebClipboardImpl::clear() { 187 void MockWebClipboardImpl::clear() {
188 m_plainText = base::NullableString16(); 188 m_plainText = base::NullableString16();
189 m_htmlText = base::NullableString16(); 189 m_htmlText = base::NullableString16();
190 m_image.reset(); 190 m_image.reset();
191 m_customData.clear(); 191 m_customData.clear();
192 m_writeSmartPaste = false; 192 m_writeSmartPaste = false;
193 } 193 }
194 194
195 } // namespace content 195 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/browser/shell_browser_main.cc ('k') | content/test/weburl_loader_mock_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698