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 | |
dcheng
2014/08/01 06:35:31
Extra newline.
pwnall-personal
2014/08/01 20:37:47
Done.
Thank you!
| |
140 | |
136 blink::WebURLLoader* TestWebKitPlatformSupport::createURLLoader() { | 141 blink::WebURLLoader* TestWebKitPlatformSupport::createURLLoader() { |
137 return url_loader_factory_->CreateURLLoader( | 142 return url_loader_factory_->CreateURLLoader( |
138 BlinkPlatformImpl::createURLLoader()); | 143 BlinkPlatformImpl::createURLLoader()); |
139 } | 144 } |
140 | 145 |
141 blink::WebString TestWebKitPlatformSupport::userAgent() { | 146 blink::WebString TestWebKitPlatformSupport::userAgent() { |
142 return blink::WebString::fromUTF8("DumpRenderTree/0.0.0.0"); | 147 return blink::WebString::fromUTF8("DumpRenderTree/0.0.0.0"); |
143 } | 148 } |
144 | 149 |
145 blink::WebData TestWebKitPlatformSupport::loadResource(const char* name) { | 150 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) { | 295 const blink::WebString& path) { |
291 base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path); | 296 base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path); |
292 | 297 |
293 std::string buffer; | 298 std::string buffer; |
294 base::ReadFileToString(file_path, &buffer); | 299 base::ReadFileToString(file_path, &buffer); |
295 | 300 |
296 return blink::WebData(buffer.data(), buffer.size()); | 301 return blink::WebData(buffer.data(), buffer.size()); |
297 } | 302 } |
298 | 303 |
299 } // namespace content | 304 } // namespace content |
OLD | NEW |