| OLD | NEW |
| 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/test_webkit_platform_support.h" | 5 #include "content/test/test_webkit_platform_support.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 NOTREACHED() << | 119 NOTREACHED() << |
| 120 "IndexedDB cannot be tested with in-process harnesses."; | 120 "IndexedDB cannot be tested with in-process harnesses."; |
| 121 return NULL; | 121 return NULL; |
| 122 } | 122 } |
| 123 | 123 |
| 124 blink::WebURLLoader* TestWebKitPlatformSupport::createURLLoader() { | 124 blink::WebURLLoader* TestWebKitPlatformSupport::createURLLoader() { |
| 125 return url_loader_factory_->CreateURLLoader( | 125 return url_loader_factory_->CreateURLLoader( |
| 126 BlinkPlatformImpl::createURLLoader()); | 126 BlinkPlatformImpl::createURLLoader()); |
| 127 } | 127 } |
| 128 | 128 |
| 129 blink::WebString TestWebKitPlatformSupport::userAgent() { |
| 130 return blink::WebString::fromUTF8("DumpRenderTree/0.0.0.0"); |
| 131 } |
| 132 |
| 133 blink::WebString TestWebKitPlatformSupport::userAgent( |
| 134 const blink::WebURL& url) { |
| 135 return userAgent(); |
| 136 } |
| 137 |
| 129 blink::WebData TestWebKitPlatformSupport::loadResource(const char* name) { | 138 blink::WebData TestWebKitPlatformSupport::loadResource(const char* name) { |
| 130 if (!strcmp(name, "deleteButton")) { | 139 if (!strcmp(name, "deleteButton")) { |
| 131 // Create a red 30x30 square. | 140 // Create a red 30x30 square. |
| 132 const char red_square[] = | 141 const char red_square[] = |
| 133 "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52" | 142 "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52" |
| 134 "\x00\x00\x00\x1e\x00\x00\x00\x1e\x04\x03\x00\x00\x00\xc9\x1e\xb3" | 143 "\x00\x00\x00\x1e\x00\x00\x00\x1e\x04\x03\x00\x00\x00\xc9\x1e\xb3" |
| 135 "\x91\x00\x00\x00\x30\x50\x4c\x54\x45\x00\x00\x00\x80\x00\x00\x00" | 144 "\x91\x00\x00\x00\x30\x50\x4c\x54\x45\x00\x00\x00\x80\x00\x00\x00" |
| 136 "\x80\x00\x80\x80\x00\x00\x00\x80\x80\x00\x80\x00\x80\x80\x80\x80" | 145 "\x80\x00\x80\x80\x00\x00\x00\x80\x80\x00\x80\x00\x80\x80\x80\x80" |
| 137 "\x80\xc0\xc0\xc0\xff\x00\x00\x00\xff\x00\xff\xff\x00\x00\x00\xff" | 146 "\x80\xc0\xc0\xc0\xff\x00\x00\x00\xff\x00\xff\xff\x00\x00\x00\xff" |
| 138 "\xff\x00\xff\x00\xff\xff\xff\xff\xff\x7b\x1f\xb1\xc4\x00\x00\x00" | 147 "\xff\x00\xff\x00\xff\xff\xff\xff\xff\x7b\x1f\xb1\xc4\x00\x00\x00" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 const blink::WebString& path) { | 315 const blink::WebString& path) { |
| 307 base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path); | 316 base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path); |
| 308 | 317 |
| 309 std::string buffer; | 318 std::string buffer; |
| 310 base::ReadFileToString(file_path, &buffer); | 319 base::ReadFileToString(file_path, &buffer); |
| 311 | 320 |
| 312 return blink::WebData(buffer.data(), buffer.size()); | 321 return blink::WebData(buffer.data(), buffer.size()); |
| 313 } | 322 } |
| 314 | 323 |
| 315 } // namespace content | 324 } // namespace content |
| OLD | NEW |