Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1186)

Unified Diff: third_party/WebKit/Source/platform/testing/ScopedMockedURL.h

Issue 2680723002: Generalize ScopedRegisteredURL as ScoedMockedURL* (Closed)
Patch Set: remove one more unused class Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/testing/ScopedMockedURL.h
diff --git a/third_party/WebKit/Source/platform/testing/ScopedMockedURL.h b/third_party/WebKit/Source/platform/testing/ScopedMockedURL.h
new file mode 100644
index 0000000000000000000000000000000000000000..f04cbca6eba7c4705a7bda4233e2b83448821ce7
--- /dev/null
+++ b/third_party/WebKit/Source/platform/testing/ScopedMockedURL.h
@@ -0,0 +1,41 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ScopedMockedURL_h
+#define ScopedMockedURL_h
+
+#include "public/platform/WebString.h"
+#include "public/platform/WebURL.h"
+#include "public/platform/WebURLResponse.h"
+
+namespace blink {
+
+namespace testing {
+
+// Convenience classes that register a mocked URL on construction, and
+// unregister it on destruction. This prevent mocked URL from leaking to other
+// tests.
+class ScopedMockedURL {
+ public:
+ explicit ScopedMockedURL(const WebURL&);
+ virtual ~ScopedMockedURL();
+
+ private:
+ WebURL m_url;
+};
+
+class ScopedMockedURLLoad : ScopedMockedURL {
+ public:
+ ScopedMockedURLLoad(
+ const WebURL& fullURL,
+ const WebString& filePath,
+ const WebString& mimeType = WebString::fromUTF8("text/html"));
+ ~ScopedMockedURLLoad() override = default;
+};
+
+} // namespace testing
+
+} // namespace blink
+
+#endif
« no previous file with comments | « third_party/WebKit/Source/platform/BUILD.gn ('k') | third_party/WebKit/Source/platform/testing/ScopedMockedURL.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698