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

Side by Side Diff: ios/web/public/test/test_native_content_provider.mm

Issue 2614443004: [ios] Moved all web mocks to ios/web/public/test/fakes. (Closed)
Patch Set: Moved test_redirect_observer back Created 3 years, 11 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
OLDNEW
(Empty)
1 // Copyright 2016 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 #import "ios/web/public/test/test_native_content_provider.h"
6
7 #include <map>
8
9 #include "url/gurl.h"
10
11 @implementation TestNativeContentProvider {
12 std::map<GURL, id<CRWNativeContent>> _nativeContent;
13 }
14
15 - (void)setController:(id<CRWNativeContent>)controller forURL:(const GURL&)URL {
16 _nativeContent[URL] = controller;
17 }
18
19 - (BOOL)hasControllerForURL:(const GURL&)URL {
20 return _nativeContent.find(URL) != _nativeContent.end();
21 }
22
23 - (id<CRWNativeContent>)controllerForURL:(const GURL&)URL {
24 auto nativeContent = _nativeContent.find(URL);
25 if (nativeContent == _nativeContent.end()) {
26 return nil;
27 }
28 return nativeContent->second;
29 }
30
31 - (id<CRWNativeContent>)controllerForURL:(const GURL&)URL
32 withError:(NSError*)error
33 isPost:(BOOL)isPost {
34 NOTREACHED();
35 return nil;
36 }
37
38 @end
OLDNEW
« no previous file with comments | « ios/web/public/test/test_native_content_provider.h ('k') | ios/web/public/test/test_navigation_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698