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

Unified Diff: Source/modules/navigatorcontentutils/testing/NavigatorContentUtilsClientMock.h

Issue 293403002: Introduce mock test system for navigator content utils (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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: Source/modules/navigatorcontentutils/testing/NavigatorContentUtilsClientMock.h
diff --git a/Source/modules/navigatorcontentutils/testing/NavigatorContentUtilsClientMock.h b/Source/modules/navigatorcontentutils/testing/NavigatorContentUtilsClientMock.h
new file mode 100644
index 0000000000000000000000000000000000000000..49b67128cf41e81c250b6a637bf50f53baacd46d
--- /dev/null
+++ b/Source/modules/navigatorcontentutils/testing/NavigatorContentUtilsClientMock.h
@@ -0,0 +1,41 @@
+// Copyright 2014 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 NavigatorContentUtilsClientMock_h
+#define NavigatorContentUtilsClientMock_h
+
+#include "modules/navigatorcontentutils/NavigatorContentUtilsClient.h"
+#include "platform/weborigin/KURL.h"
+#include "wtf/HashSet.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/text/WTFString.h"
+
+namespace WebCore {
+
+// Provides a mock object for the navigatorcontentutils client.
+class NavigatorContentUtilsClientMock : public NavigatorContentUtilsClient {
+public:
+ NavigatorContentUtilsClientMock() { }
+ virtual ~NavigatorContentUtilsClientMock() { }
+
+ virtual void registerProtocolHandler(const String& scheme, const KURL& baseURL, const KURL&, const String& title);
+
+ virtual CustomHandlersState isProtocolHandlerRegistered(const String& scheme, const KURL& baseURL, const KURL&);
+ virtual void unregisterProtocolHandler(const String& scheme, const KURL& baseURL, const KURL&);
+
+private:
+ typedef struct {
+ String scheme;
+ WebCore::KURL baseURL;
+ WebCore::KURL url;
+ String title;
+ } ProtocolInfo;
+
+ typedef HashMap<String, ProtocolInfo> RegisteredProtocolMap;
+ RegisteredProtocolMap m_protocolMap;
+};
+
+}
+
+#endif // NavigatorContentUtilsClientMock_h

Powered by Google App Engine
This is Rietveld 408576698