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

Unified Diff: third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp

Issue 2472753003: Move fromJSONString to V8Binding (Closed)
Patch Set: Really swallow exception Created 4 years, 1 month 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
Index: third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp
diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp b/third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp
index 6b964ad49d445573fa0992e220920eae0f586e77..eff21605a3854d2b2454f68a731d32a57bd52fe0 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp
@@ -4,7 +4,6 @@
#include "modules/payments/PaymentRequest.h"
-#include "bindings/core/v8/JSONValuesForV8.h"
#include "bindings/core/v8/V8BindingForTesting.h"
#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
@@ -471,8 +470,8 @@ TEST(PaymentRequestTest, RejectShowPromiseOnInvalidPaymentDetailsUpdate) {
.then(funcs.expectNoCall(), funcs.expectCall());
request->onUpdatePaymentDetails(ScriptValue::from(
- scope.getScriptState(),
- fromJSONString(scope.getScriptState(), "{}", scope.getExceptionState())));
+ scope.getScriptState(), fromJSONString(scope.getScriptState()->isolate(),
+ "{}", scope.getExceptionState())));
EXPECT_FALSE(scope.getExceptionState().hadException());
}
@@ -500,8 +499,8 @@ TEST(PaymentRequestTest,
"\"5.00\"}, \"selected\": true}]}";
request->onUpdatePaymentDetails(ScriptValue::from(
scope.getScriptState(),
- fromJSONString(scope.getScriptState(), detailWithShippingOptions,
- scope.getExceptionState())));
+ fromJSONString(scope.getScriptState()->isolate(),
+ detailWithShippingOptions, scope.getExceptionState())));
EXPECT_FALSE(scope.getExceptionState().hadException());
EXPECT_EQ("standardShippingOption", request->shippingOption());
String detailWithoutShippingOptions =
@@ -510,8 +509,8 @@ TEST(PaymentRequestTest,
request->onUpdatePaymentDetails(ScriptValue::from(
scope.getScriptState(),
- fromJSONString(scope.getScriptState(), detailWithoutShippingOptions,
- scope.getExceptionState())));
+ fromJSONString(scope.getScriptState()->isolate(),
+ detailWithoutShippingOptions, scope.getExceptionState())));
EXPECT_FALSE(scope.getExceptionState().hadException());
EXPECT_TRUE(request->shippingOption().isNull());
@@ -539,9 +538,10 @@ TEST(
"{\"id\": \"fast\", \"label\": \"Fast\", \"amount\": {\"currency\": "
"\"USD\", \"value\": \"50.00\"}}]}";
- request->onUpdatePaymentDetails(ScriptValue::from(
- scope.getScriptState(), fromJSONString(scope.getScriptState(), detail,
- scope.getExceptionState())));
+ request->onUpdatePaymentDetails(
+ ScriptValue::from(scope.getScriptState(),
+ fromJSONString(scope.getScriptState()->isolate(),
+ detail, scope.getExceptionState())));
EXPECT_FALSE(scope.getExceptionState().hadException());
EXPECT_TRUE(request->shippingOption().isNull());
@@ -567,9 +567,10 @@ TEST(PaymentRequestTest, UseTheSelectedShippingOptionFromPaymentDetailsUpdate) {
"{\"id\": \"fast\", \"label\": \"Fast\", \"amount\": {\"currency\": "
"\"USD\", \"value\": \"50.00\"}, \"selected\": true}]}";
- request->onUpdatePaymentDetails(ScriptValue::from(
- scope.getScriptState(), fromJSONString(scope.getScriptState(), detail,
- scope.getExceptionState())));
+ request->onUpdatePaymentDetails(
+ ScriptValue::from(scope.getScriptState(),
+ fromJSONString(scope.getScriptState()->isolate(),
+ detail, scope.getExceptionState())));
EXPECT_FALSE(scope.getExceptionState().hadException());
EXPECT_EQ("fast", request->shippingOption());
@@ -593,7 +594,7 @@ TEST(PaymentRequestTest, NoExceptionWithErrorMessageInUpdate) {
request->onUpdatePaymentDetails(ScriptValue::from(
scope.getScriptState(),
- fromJSONString(scope.getScriptState(), detailWithErrorMsg,
+ fromJSONString(scope.getScriptState()->isolate(), detailWithErrorMsg,
scope.getExceptionState())));
EXPECT_FALSE(scope.getExceptionState().hadException());
}
@@ -632,8 +633,8 @@ TEST(PaymentRequestTest,
request->onUpdatePaymentDetails(ScriptValue::from(
scope.getScriptState(),
- fromJSONString(scope.getScriptState(), detailWithShippingOptions,
- scope.getExceptionState())));
+ fromJSONString(scope.getScriptState()->isolate(),
+ detailWithShippingOptions, scope.getExceptionState())));
EXPECT_FALSE(scope.getExceptionState().hadException());
EXPECT_TRUE(request->shippingOption().isNull());
« no previous file with comments | « third_party/WebKit/Source/modules/nfc/NFC.cpp ('k') | third_party/WebKit/Source/modules/payments/PaymentResponse.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698