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

Side by Side Diff: ios/web/test/wk_web_view_crash_utils.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
« no previous file with comments | « ios/web/test/web_test_suite.mm ('k') | ios/web/web_state/js/page_script_util_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/web/test/wk_web_view_crash_utils.h" 5 #import "ios/web/test/wk_web_view_crash_utils.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 #import <WebKit/WebKit.h> 8 #import <WebKit/WebKit.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #import "base/mac/scoped_nsobject.h" 11 #import "base/mac/scoped_nsobject.h"
12 #include "ios/web/public/test/test_browser_state.h" 12 #include "ios/web/public/test/fakes/test_browser_state.h"
13 #import "ios/web/public/web_view_creation_util.h" 13 #import "ios/web/public/web_view_creation_util.h"
14 #import "third_party/ocmock/OCMock/NSInvocation+OCMAdditions.h" 14 #import "third_party/ocmock/OCMock/NSInvocation+OCMAdditions.h"
15 #import "third_party/ocmock/OCMock/OCMock.h" 15 #import "third_party/ocmock/OCMock/OCMock.h"
16 16
17 namespace { 17 namespace {
18 18
19 // Returns an OCMocked WKWebView whose |evaluateJavaScript:completionHandler:| 19 // Returns an OCMocked WKWebView whose |evaluateJavaScript:completionHandler:|
20 // method has been mocked to execute |block| instead. |block| cannot be nil. 20 // method has been mocked to execute |block| instead. |block| cannot be nil.
21 WKWebView* BuildMockWKWebViewWithStubbedJSEvalFunction( 21 WKWebView* BuildMockWKWebViewWithStubbedJSEvalFunction(
22 void (^block)(NSInvocation*)) { 22 void (^block)(NSInvocation*)) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 id succeed = ^void(NSInvocation* invocation) { 64 id succeed = ^void(NSInvocation* invocation) {
65 void (^completionHandler)(id, NSError*) = 65 void (^completionHandler)(id, NSError*) =
66 [invocation getArgumentAtIndexAsObject:3]; 66 [invocation getArgumentAtIndexAsObject:3];
67 // Always succceeds with nil result. 67 // Always succceeds with nil result.
68 completionHandler(nil, nil); 68 completionHandler(nil, nil);
69 }; 69 };
70 return BuildMockWKWebViewWithStubbedJSEvalFunction(succeed); 70 return BuildMockWKWebViewWithStubbedJSEvalFunction(succeed);
71 } 71 }
72 72
73 } // namespace web 73 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/test/web_test_suite.mm ('k') | ios/web/web_state/js/page_script_util_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698