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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } | 106 } |
107 | 107 |
108 TestWebKitPlatformSupport::~TestWebKitPlatformSupport() { | 108 TestWebKitPlatformSupport::~TestWebKitPlatformSupport() { |
109 url_loader_factory_.reset(); | 109 url_loader_factory_.reset(); |
110 mock_clipboard_.reset(); | 110 mock_clipboard_.reset(); |
111 blink::shutdown(); | 111 blink::shutdown(); |
112 base::StatsTable::set_current(NULL); | 112 base::StatsTable::set_current(NULL); |
113 stats_table_.reset(); | 113 stats_table_.reset(); |
114 } | 114 } |
115 | 115 |
116 blink::WebMimeRegistry* TestWebKitPlatformSupport::mimeRegistry() { | 116 blink::WebBlobRegistry* TestWebKitPlatformSupport::blobRegistry() { |
117 return &mime_registry_; | 117 return &blob_registry_; |
118 } | 118 } |
119 | 119 |
120 blink::WebClipboard* TestWebKitPlatformSupport::clipboard() { | 120 blink::WebClipboard* TestWebKitPlatformSupport::clipboard() { |
121 // Mock out clipboard calls so that tests don't mess | 121 // Mock out clipboard calls so that tests don't mess |
122 // with each other's copies/pastes when running in parallel. | 122 // with each other's copies/pastes when running in parallel. |
123 return mock_clipboard_.get(); | 123 return mock_clipboard_.get(); |
124 } | 124 } |
125 | 125 |
126 blink::WebFileUtilities* TestWebKitPlatformSupport::fileUtilities() { | 126 blink::WebFileUtilities* TestWebKitPlatformSupport::fileUtilities() { |
127 return &file_utilities_; | 127 return &file_utilities_; |
128 } | 128 } |
129 | 129 |
130 blink::WebIDBFactory* TestWebKitPlatformSupport::idbFactory() { | 130 blink::WebIDBFactory* TestWebKitPlatformSupport::idbFactory() { |
131 NOTREACHED() << | 131 NOTREACHED() << |
132 "IndexedDB cannot be tested with in-process harnesses."; | 132 "IndexedDB cannot be tested with in-process harnesses."; |
133 return NULL; | 133 return NULL; |
134 } | 134 } |
135 | 135 |
| 136 blink::WebMimeRegistry* TestWebKitPlatformSupport::mimeRegistry() { |
| 137 return &mime_registry_; |
| 138 } |
| 139 |
136 blink::WebURLLoader* TestWebKitPlatformSupport::createURLLoader() { | 140 blink::WebURLLoader* TestWebKitPlatformSupport::createURLLoader() { |
137 return url_loader_factory_->CreateURLLoader( | 141 return url_loader_factory_->CreateURLLoader( |
138 BlinkPlatformImpl::createURLLoader()); | 142 BlinkPlatformImpl::createURLLoader()); |
139 } | 143 } |
140 | 144 |
141 blink::WebString TestWebKitPlatformSupport::userAgent() { | 145 blink::WebString TestWebKitPlatformSupport::userAgent() { |
142 return blink::WebString::fromUTF8("DumpRenderTree/0.0.0.0"); | 146 return blink::WebString::fromUTF8("DumpRenderTree/0.0.0.0"); |
143 } | 147 } |
144 | 148 |
145 blink::WebData TestWebKitPlatformSupport::loadResource(const char* name) { | 149 blink::WebData TestWebKitPlatformSupport::loadResource(const char* name) { |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 const blink::WebString& path) { | 294 const blink::WebString& path) { |
291 base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path); | 295 base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path); |
292 | 296 |
293 std::string buffer; | 297 std::string buffer; |
294 base::ReadFileToString(file_path, &buffer); | 298 base::ReadFileToString(file_path, &buffer); |
295 | 299 |
296 return blink::WebData(buffer.data(), buffer.size()); | 300 return blink::WebData(buffer.data(), buffer.size()); |
297 } | 301 } |
298 | 302 |
299 } // namespace content | 303 } // namespace content |
OLD | NEW |