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

Unified Diff: ios/web/public/test/web_test_with_web_state.mm

Issue 2254553003: [ios] Fixed Resetting the page for unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed DCHECK Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/test/web_test_with_web_state.mm
diff --git a/ios/web/public/test/web_test_with_web_state.mm b/ios/web/public/test/web_test_with_web_state.mm
index d5a95137910c33a6bc663a38b24c5294d9be9e0e..d16f409cc90343f0bbfd331f8f3adf33f18f4cbe 100644
--- a/ios/web/public/test/web_test_with_web_state.mm
+++ b/ios/web/public/test/web_test_with_web_state.mm
@@ -155,10 +155,6 @@ id WebTestWithWebState::ExecuteJavaScript(NSString* script) {
[GetWebController(web_state())
executeJavaScript:script
completionHandler:^(id result, NSError* error) {
- if (error && error.code != WKErrorJavaScriptResultTypeIsUnsupported) {
- NOTREACHED() << " error: " << error.code
- << " for script: " << base::SysNSStringToUTF8(script);
- }
executionResult.reset([result copy]);
executionCompleted = true;
}];
@@ -184,7 +180,7 @@ const web::WebState* WebTestWithWebState::web_state() const {
bool WebTestWithWebState::ResetPageIfNavigationStalled(NSString* load_check) {
id inner_html = ExecuteJavaScript(
@"(document && document.body && document.body.innerHTML) || 'undefined'");
- if ([inner_html rangeOfString:load_check].location == NSNotFound) {
+ if (![inner_html rangeOfString:load_check].length) {
web_state_->SetWebUsageEnabled(false);
web_state_->SetWebUsageEnabled(true);
[GetWebController(web_state()) triggerPendingLoad];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698