OLD | NEW |
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 #ifndef IOS_WEB_TEST_WK_WEB_VIEW_CRASH_UTILS_H_ | 5 #ifndef IOS_WEB_TEST_WK_WEB_VIEW_CRASH_UTILS_H_ |
6 #define IOS_WEB_TEST_WK_WEB_VIEW_CRASH_UTILS_H_ | 6 #define IOS_WEB_TEST_WK_WEB_VIEW_CRASH_UTILS_H_ |
7 | 7 |
8 #import <WebKit/WebKit.h> | 8 #import <WebKit/WebKit.h> |
9 | 9 |
10 namespace web { | 10 namespace web { |
11 | 11 |
12 // Simulates WKWebView crash by calling its private API. | 12 // Simulates WKWebView crash by calling its private API. |
13 void SimulateWKWebViewCrash(WKWebView* webView); | 13 void SimulateWKWebViewCrash(WKWebView* webView); |
14 | 14 |
15 // Returns a specialized WKWebView mock object with overridden JavaScript | 15 // Returns a specialized WKWebView mock object with overridden JavaScript |
16 // evaluation method that fails with WKErrorWebContentProcessTerminated error. | 16 // evaluation method that fails with WKErrorWebContentProcessTerminated error. |
17 WKWebView* CreateTerminatedWKWebView(); | 17 WKWebView* CreateTerminatedWKWebView() NS_RETURNS_RETAINED; |
18 | 18 |
19 // Returns a specialized WKWebView mock object with overridden JavaScript | 19 // Returns a specialized WKWebView mock object with overridden JavaScript |
20 // evaluation method that always succeeds with nil result. | 20 // evaluation method that always succeeds with nil result. |
21 WKWebView* CreateHealthyWKWebView(); | 21 WKWebView* CreateHealthyWKWebView() NS_RETURNS_RETAINED; |
22 } // web | 22 } // web |
23 | 23 |
24 #endif // IOS_WEB_TEST_WK_WEB_VIEW_CRASH_UTILS_H_ | 24 #endif // IOS_WEB_TEST_WK_WEB_VIEW_CRASH_UTILS_H_ |
OLD | NEW |