| 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/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/feature_list.h" | 8 #include "base/feature_list.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 } | 261 } |
| 262 | 262 |
| 263 blink::WebString TestBlinkWebUnitTestSupport::DefaultLocale() { | 263 blink::WebString TestBlinkWebUnitTestSupport::DefaultLocale() { |
| 264 return blink::WebString::FromASCII("en-US"); | 264 return blink::WebString::FromASCII("en-US"); |
| 265 } | 265 } |
| 266 | 266 |
| 267 blink::WebCompositorSupport* TestBlinkWebUnitTestSupport::CompositorSupport() { | 267 blink::WebCompositorSupport* TestBlinkWebUnitTestSupport::CompositorSupport() { |
| 268 return &compositor_support_; | 268 return &compositor_support_; |
| 269 } | 269 } |
| 270 | 270 |
| 271 std::unique_ptr<blink::WebGestureCurve> | 271 blink::WebGestureCurve* TestBlinkWebUnitTestSupport::CreateFlingAnimationCurve( |
| 272 TestBlinkWebUnitTestSupport::CreateFlingAnimationCurve( | |
| 273 blink::WebGestureDevice device_source, | 272 blink::WebGestureDevice device_source, |
| 274 const blink::WebFloatPoint& velocity, | 273 const blink::WebFloatPoint& velocity, |
| 275 const blink::WebSize& cumulative_scroll) { | 274 const blink::WebSize& cumulative_scroll) { |
| 276 return base::MakeUnique<WebGestureCurveMock>(velocity, cumulative_scroll); | 275 // Caller will retain and release. |
| 276 return new WebGestureCurveMock(velocity, cumulative_scroll); |
| 277 } | 277 } |
| 278 | 278 |
| 279 blink::WebURLLoaderMockFactory* | 279 blink::WebURLLoaderMockFactory* |
| 280 TestBlinkWebUnitTestSupport::GetURLLoaderMockFactory() { | 280 TestBlinkWebUnitTestSupport::GetURLLoaderMockFactory() { |
| 281 return url_loader_factory_.get(); | 281 return url_loader_factory_.get(); |
| 282 } | 282 } |
| 283 | 283 |
| 284 blink::WebThread* TestBlinkWebUnitTestSupport::CurrentThread() { | 284 blink::WebThread* TestBlinkWebUnitTestSupport::CurrentThread() { |
| 285 if (web_thread_ && web_thread_->IsCurrentThread()) | 285 if (web_thread_ && web_thread_->IsCurrentThread()) |
| 286 return web_thread_.get(); | 286 return web_thread_.get(); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 pem_private_key.Utf8(), pem_certificate.Utf8())); | 322 pem_private_key.Utf8(), pem_certificate.Utf8())); |
| 323 if (!certificate) | 323 if (!certificate) |
| 324 return nullptr; | 324 return nullptr; |
| 325 return base::MakeUnique<RTCCertificate>(certificate); | 325 return base::MakeUnique<RTCCertificate>(certificate); |
| 326 } | 326 } |
| 327 }; | 327 }; |
| 328 | 328 |
| 329 } // namespace | 329 } // namespace |
| 330 #endif // BUILDFLAG(ENABLE_WEBRTC) | 330 #endif // BUILDFLAG(ENABLE_WEBRTC) |
| 331 | 331 |
| 332 std::unique_ptr<blink::WebRTCCertificateGenerator> | 332 blink::WebRTCCertificateGenerator* |
| 333 TestBlinkWebUnitTestSupport::CreateRTCCertificateGenerator() { | 333 TestBlinkWebUnitTestSupport::CreateRTCCertificateGenerator() { |
| 334 #if BUILDFLAG(ENABLE_WEBRTC) | 334 #if BUILDFLAG(ENABLE_WEBRTC) |
| 335 return base::MakeUnique<TestWebRTCCertificateGenerator>(); | 335 return new TestWebRTCCertificateGenerator(); |
| 336 #else | 336 #else |
| 337 return nullptr; | 337 return nullptr; |
| 338 #endif | 338 #endif |
| 339 } | 339 } |
| 340 | 340 |
| 341 } // namespace content | 341 } // namespace content |
| OLD | NEW |