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

Side by Side Diff: Source/modules/navigatorcontentutils/testing/NavigatorContentUtilsClientMock.cpp

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, 6 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 unified diff | Download patch
« no previous file with comments | « Source/modules/navigatorcontentutils/testing/NavigatorContentUtilsClientMock.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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 "config.h"
6 #include "NavigatorContentUtilsClientMock.h"
7
8 #include "modules/navigatorcontentutils/NavigatorContentUtilsClient.h"
9 #include "wtf/PassOwnPtr.h"
10 #include "wtf/text/StringHash.h"
11
12 namespace WebCore {
13
14 void NavigatorContentUtilsClientMock::registerProtocolHandler(const String& sche me, const WebCore::KURL& baseURL,
15 const WebCore::KURL& url, const String& title)
16 {
17 ProtocolInfo info;
18 info.scheme = scheme;
19 info.baseURL = baseURL;
20 info.url = url;
21 info.title = title;
22
23 m_protocolMap.set(scheme, info);
24 }
25
26 NavigatorContentUtilsClient::CustomHandlersState NavigatorContentUtilsClientMock ::isProtocolHandlerRegistered(const String& scheme,
27 const WebCore::KURL& baseURL, const WebCore::KURL& url)
28 {
29 // "declined" state is checked by NavigatorContentUtils::isProtocolHandlerRe gistered() before calling this function.
30 if (m_protocolMap.contains(scheme))
31 return NavigatorContentUtilsClient::CustomHandlersRegistered;
32
33 return NavigatorContentUtilsClient::CustomHandlersNew;
34 }
35
36 void NavigatorContentUtilsClientMock::unregisterProtocolHandler(const String& sc heme, const WebCore::KURL& baseURL,
37 const WebCore::KURL& url)
38 {
39 m_protocolMap.remove(scheme);
40 }
41
42 } // WebCore
OLDNEW
« no previous file with comments | « Source/modules/navigatorcontentutils/testing/NavigatorContentUtilsClientMock.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698