| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "platform/testing/ScopedMockedURL.h" |
| 6 |
| 7 #include "platform/testing/URLTestHelpers.h" |
| 8 #include "public/platform/Platform.h" |
| 9 #include "public/platform/WebURLLoaderMockFactory.h" |
| 10 |
| 11 namespace blink { |
| 12 namespace testing { |
| 13 |
| 14 ScopedMockedURL::ScopedMockedURL(const WebURL& url) : m_url(url) {} |
| 15 |
| 16 ScopedMockedURL::~ScopedMockedURL() { |
| 17 Platform::current()->getURLLoaderMockFactory()->unregisterURL(m_url); |
| 18 } |
| 19 |
| 20 ScopedMockedURLLoad::ScopedMockedURLLoad(const WebURL& fullURL, |
| 21 const WebString& filePath, |
| 22 const WebString& mimeType) |
| 23 : ScopedMockedURL(fullURL) { |
| 24 URLTestHelpers::registerMockedURLLoad(fullURL, filePath, mimeType); |
| 25 } |
| 26 |
| 27 } // namespace testing |
| 28 } // namespace blink |
| OLD | NEW |