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

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

Issue 2286773002: [ios] Use new JS execution API in browsing data partitioning test. (Closed)
Patch Set: Make GetLocalStorageItem return id. 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 | « ios/web/public/test/js_test_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/test/js_test_util.mm
diff --git a/ios/web/public/test/js_test_util.mm b/ios/web/public/test/js_test_util.mm
index a998e33344e938f15cc0f3062cd6062b7d3ff715..05a3e1cabe5ac404521e9188cf64afe827508207 100644
--- a/ios/web/public/test/js_test_util.mm
+++ b/ios/web/public/test/js_test_util.mm
@@ -37,12 +37,17 @@ id ExecuteJavaScript(CRWJSInjectionReceiver* receiver, NSString* script) {
}
id ExecuteJavaScript(WKWebView* web_view, NSString* script) {
+ return ExecuteJavaScript(web_view, script, nullptr);
+}
+
+id ExecuteJavaScript(WKWebView* web_view, NSString* script, NSError** error) {
__block base::scoped_nsobject<id> result;
__block bool completed = false;
[web_view evaluateJavaScript:script
- completionHandler:^(id evaluation_result, NSError* error) {
- DCHECK(!error);
- result.reset([evaluation_result copy]);
+ completionHandler:^(id script_result, NSError* script_error) {
+ result.reset([script_result copy]);
+ if (error)
+ *error = [[script_error copy] autorelease];
completed = true;
}];
base::test::ios::WaitUntilCondition(^{
« no previous file with comments | « ios/web/public/test/js_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698