| 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_blink_web_unit_test_support.h" | 5 #include "content/test/test_blink_web_unit_test_support.h" |
| 6 | 6 |
| 7 #include "base/feature_list.h" | 7 #include "base/feature_list.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 blink::WebMimeRegistry* TestBlinkWebUnitTestSupport::mimeRegistry() { | 185 blink::WebMimeRegistry* TestBlinkWebUnitTestSupport::mimeRegistry() { |
| 186 return &mime_registry_; | 186 return &mime_registry_; |
| 187 } | 187 } |
| 188 | 188 |
| 189 blink::WebURLLoader* TestBlinkWebUnitTestSupport::createURLLoader() { | 189 blink::WebURLLoader* TestBlinkWebUnitTestSupport::createURLLoader() { |
| 190 blink::WebThread* currentThread = Platform::current()->currentThread(); | 190 blink::WebThread* currentThread = Platform::current()->currentThread(); |
| 191 // This loader should be used only for process-local resources such as | 191 // This loader should be used only for process-local resources such as |
| 192 // data URLs. | 192 // data URLs. |
| 193 blink::WebURLLoader* default_loader = new WebURLLoaderImpl( | 193 blink::WebURLLoader* default_loader = new WebURLLoaderImpl( |
| 194 nullptr, base::WrapUnique(currentThread->getWebTaskRunner()->clone())); | 194 nullptr, base::WrapUnique(currentThread->getWebTaskRunner()->clone()), |
| 195 nullptr); |
| 195 return url_loader_factory_->createURLLoader(default_loader); | 196 return url_loader_factory_->createURLLoader(default_loader); |
| 196 } | 197 } |
| 197 | 198 |
| 198 blink::WebString TestBlinkWebUnitTestSupport::userAgent() { | 199 blink::WebString TestBlinkWebUnitTestSupport::userAgent() { |
| 199 return blink::WebString::fromUTF8("test_runner/0.0.0.0"); | 200 return blink::WebString::fromUTF8("test_runner/0.0.0.0"); |
| 200 } | 201 } |
| 201 | 202 |
| 202 blink::WebString TestBlinkWebUnitTestSupport::queryLocalizedString( | 203 blink::WebString TestBlinkWebUnitTestSupport::queryLocalizedString( |
| 203 blink::WebLocalizedString::Name name) { | 204 blink::WebLocalizedString::Name name) { |
| 204 // Returns placeholder strings to check if they are correctly localized. | 205 // Returns placeholder strings to check if they are correctly localized. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 return BlinkPlatformImpl::currentThread(); | 292 return BlinkPlatformImpl::currentThread(); |
| 292 } | 293 } |
| 293 | 294 |
| 294 void TestBlinkWebUnitTestSupport::getPluginList( | 295 void TestBlinkWebUnitTestSupport::getPluginList( |
| 295 bool refresh, blink::WebPluginListBuilder* builder) { | 296 bool refresh, blink::WebPluginListBuilder* builder) { |
| 296 builder->addPlugin("pdf", "pdf", "pdf-files"); | 297 builder->addPlugin("pdf", "pdf", "pdf-files"); |
| 297 builder->addMediaTypeToLastPlugin("application/pdf", "pdf"); | 298 builder->addMediaTypeToLastPlugin("application/pdf", "pdf"); |
| 298 } | 299 } |
| 299 | 300 |
| 300 } // namespace content | 301 } // namespace content |
| OLD | NEW |