blob: 3d4268416ae19a744c54bab589321c3332e26264 [file] [log] [blame]
// 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 IOS_WEB_TEST_WK_WEB_VIEW_CRASH_UTILS_H_
#define IOS_WEB_TEST_WK_WEB_VIEW_CRASH_UTILS_H_
#import <WebKit/WebKit.h>
namespace web {
// Simulates WKWebView crash by calling its private API.
void SimulateWKWebViewCrash(WKWebView* webView);
// Returns a specialized WKWebView mock object with overridden JavaScript
// evaluation method that fails with WKErrorWebContentProcessTerminated error.
WKWebView* CreateTerminatedWKWebView() NS_RETURNS_RETAINED;
// Returns a specialized WKWebView mock object with overridden JavaScript
// evaluation method that always succeeds with nil result.
WKWebView* CreateHealthyWKWebView() NS_RETURNS_RETAINED;
} // web
#endif // IOS_WEB_TEST_WK_WEB_VIEW_CRASH_UTILS_H_