| 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 #ifndef ScopedMockedURL_h |
| 6 #define ScopedMockedURL_h |
| 7 |
| 8 #include "public/platform/WebString.h" |
| 9 #include "public/platform/WebURL.h" |
| 10 #include "public/platform/WebURLResponse.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 namespace testing { |
| 15 |
| 16 // Convenience classes that register a mocked URL on construction, and |
| 17 // unregister it on destruction. This prevent mocked URL from leaking to other |
| 18 // tests. |
| 19 class ScopedMockedURL { |
| 20 public: |
| 21 explicit ScopedMockedURL(const WebURL&); |
| 22 virtual ~ScopedMockedURL(); |
| 23 |
| 24 private: |
| 25 WebURL m_url; |
| 26 }; |
| 27 |
| 28 class ScopedMockedURLLoad : ScopedMockedURL { |
| 29 public: |
| 30 ScopedMockedURLLoad( |
| 31 const WebURL& fullURL, |
| 32 const WebString& filePath, |
| 33 const WebString& mimeType = WebString::fromUTF8("text/html")); |
| 34 ~ScopedMockedURLLoad() override = default; |
| 35 }; |
| 36 |
| 37 } // namespace testing |
| 38 |
| 39 } // namespace blink |
| 40 |
| 41 #endif |
| OLD | NEW |