| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "webkit/tools/test_shell/test_shell.h" | 5 #include "webkit/tools/test_shell/test_shell.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/debug_on_start.h" | 8 #include "base/debug_on_start.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 162 } |
| 163 | 163 |
| 164 // All fatal log messages (e.g. DCHECK failures) imply unit test failures | 164 // All fatal log messages (e.g. DCHECK failures) imply unit test failures |
| 165 static void UnitTestAssertHandler(const std::string& str) { | 165 static void UnitTestAssertHandler(const std::string& str) { |
| 166 FAIL() << str; | 166 FAIL() << str; |
| 167 } | 167 } |
| 168 | 168 |
| 169 // static | 169 // static |
| 170 std::string TestShell::DumpImage(WebFrame* web_frame, | 170 std::string TestShell::DumpImage(WebFrame* web_frame, |
| 171 const std::wstring& file_name) { | 171 const std::wstring& file_name) { |
| 172 scoped_ptr<gfx::BitmapPlatformDevice> device; | 172 scoped_ptr<skia::BitmapPlatformDevice> device; |
| 173 if (!web_frame->CaptureImage(&device, true)) | 173 if (!web_frame->CaptureImage(&device, true)) |
| 174 return std::string(); | 174 return std::string(); |
| 175 | 175 |
| 176 const SkBitmap& src_bmp = device->accessBitmap(false); | 176 const SkBitmap& src_bmp = device->accessBitmap(false); |
| 177 | 177 |
| 178 // Encode image. | 178 // Encode image. |
| 179 std::vector<unsigned char> png; | 179 std::vector<unsigned char> png; |
| 180 SkAutoLockPixels src_bmp_lock(src_bmp); | 180 SkAutoLockPixels src_bmp_lock(src_bmp); |
| 181 PNGEncoder::ColorFormat color_format = | 181 PNGEncoder::ColorFormat color_format = |
| 182 #if defined(OS_WIN) || defined(OS_LINUX) | 182 #if defined(OS_WIN) || defined(OS_LINUX) |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 | 568 |
| 569 uint64 VisitedLinkHash(const char* canonical_url, size_t length) { | 569 uint64 VisitedLinkHash(const char* canonical_url, size_t length) { |
| 570 return 0; | 570 return 0; |
| 571 } | 571 } |
| 572 | 572 |
| 573 bool IsLinkVisited(uint64 link_hash) { | 573 bool IsLinkVisited(uint64 link_hash) { |
| 574 return false; | 574 return false; |
| 575 } | 575 } |
| 576 | 576 |
| 577 } // namespace webkit_glue | 577 } // namespace webkit_glue |
| OLD | NEW |