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

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

Issue 2489943003: Revert of [Web Payments] Mojom namespace blink -> payments (Closed)
Patch Set: 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/OnPaymentResponseTest.cpp
diff --git a/third_party/WebKit/Source/modules/payments/OnPaymentResponseTest.cpp b/third_party/WebKit/Source/modules/payments/OnPaymentResponseTest.cpp
index c4dfd58a6593882a0dc490f57a6c7072e0a9b44e..b64e160a5cc63b1ba5960d7f7c3a0b57f74ae61d 100644
--- a/third_party/WebKit/Source/modules/payments/OnPaymentResponseTest.cpp
+++ b/third_party/WebKit/Source/modules/payments/OnPaymentResponseTest.cpp
@@ -28,9 +28,8 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
ASSERT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- buildPaymentResponseForTest();
- response->shipping_address = payments::mojom::blink::PaymentAddress::New();
+ mojom::blink::PaymentResponsePtr response = buildPaymentResponseForTest();
+ response->shipping_address = mojom::blink::PaymentAddress::New();
response->shipping_address->country = "US";
response->shipping_address->language_code = "en";
response->shipping_address->script_code = "Latn";
@@ -38,8 +37,8 @@
request->show(scope.getScriptState())
.then(funcs.expectNoCall(), funcs.expectCall());
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
}
// If the merchant requests shipping information, but the browser does not
@@ -54,15 +53,14 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
ASSERT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- buildPaymentResponseForTest();
+ mojom::blink::PaymentResponsePtr response = buildPaymentResponseForTest();
response->shipping_option = "standardShipping";
request->show(scope.getScriptState())
.then(funcs.expectNoCall(), funcs.expectCall());
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
}
// If the merchant requests a payer name, but the browser does not provide it,
@@ -77,14 +75,14 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
EXPECT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- payments::mojom::blink::PaymentResponse::New();
-
- request->show(scope.getScriptState())
- .then(funcs.expectNoCall(), funcs.expectCall());
-
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ mojom::blink::PaymentResponsePtr response =
+ mojom::blink::PaymentResponse::New();
+
+ request->show(scope.getScriptState())
+ .then(funcs.expectNoCall(), funcs.expectCall());
+
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
}
// If the merchant requests an email address, but the browser does not provide
@@ -99,14 +97,14 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
EXPECT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- payments::mojom::blink::PaymentResponse::New();
-
- request->show(scope.getScriptState())
- .then(funcs.expectNoCall(), funcs.expectCall());
-
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ mojom::blink::PaymentResponsePtr response =
+ mojom::blink::PaymentResponse::New();
+
+ request->show(scope.getScriptState())
+ .then(funcs.expectNoCall(), funcs.expectCall());
+
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
}
// If the merchant requests a phone number, but the browser does not provide it,
@@ -121,14 +119,14 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
EXPECT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- payments::mojom::blink::PaymentResponse::New();
-
- request->show(scope.getScriptState())
- .then(funcs.expectNoCall(), funcs.expectCall());
-
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ mojom::blink::PaymentResponsePtr response =
+ mojom::blink::PaymentResponse::New();
+
+ request->show(scope.getScriptState())
+ .then(funcs.expectNoCall(), funcs.expectCall());
+
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
}
// If the merchant requests shipping information, but the browser provides an
@@ -143,10 +141,9 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
ASSERT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- buildPaymentResponseForTest();
+ mojom::blink::PaymentResponsePtr response = buildPaymentResponseForTest();
response->shipping_option = "";
- response->shipping_address = payments::mojom::blink::PaymentAddress::New();
+ response->shipping_address = mojom::blink::PaymentAddress::New();
response->shipping_address->country = "US";
response->shipping_address->language_code = "en";
response->shipping_address->script_code = "Latn";
@@ -154,8 +151,8 @@
request->show(scope.getScriptState())
.then(funcs.expectNoCall(), funcs.expectCall());
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
}
// If the merchant requests shipping information, but the browser provides an
@@ -170,16 +167,15 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
ASSERT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- buildPaymentResponseForTest();
+ mojom::blink::PaymentResponsePtr response = buildPaymentResponseForTest();
response->shipping_option = "standardShipping";
- response->shipping_address = payments::mojom::blink::PaymentAddress::New();
-
- request->show(scope.getScriptState())
- .then(funcs.expectNoCall(), funcs.expectCall());
-
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ response->shipping_address = mojom::blink::PaymentAddress::New();
+
+ request->show(scope.getScriptState())
+ .then(funcs.expectNoCall(), funcs.expectCall());
+
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
}
// If the merchant requests a payer name, but the browser provides an empty
@@ -194,15 +190,15 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
EXPECT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- payments::mojom::blink::PaymentResponse::New();
+ mojom::blink::PaymentResponsePtr response =
+ mojom::blink::PaymentResponse::New();
response->payer_name = "";
request->show(scope.getScriptState())
.then(funcs.expectNoCall(), funcs.expectCall());
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
}
// If the merchant requests an email, but the browser provides an empty string
@@ -217,15 +213,15 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
EXPECT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- payments::mojom::blink::PaymentResponse::New();
+ mojom::blink::PaymentResponsePtr response =
+ mojom::blink::PaymentResponse::New();
response->payer_email = "";
request->show(scope.getScriptState())
.then(funcs.expectNoCall(), funcs.expectCall());
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
}
// If the merchant requests a phone number, but the browser provides an empty
@@ -240,15 +236,15 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
EXPECT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- payments::mojom::blink::PaymentResponse::New();
+ mojom::blink::PaymentResponsePtr response =
+ mojom::blink::PaymentResponse::New();
response->payer_phone = "";
request->show(scope.getScriptState())
.then(funcs.expectNoCall(), funcs.expectCall());
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
}
// If the merchant does not request shipping information, but the browser
@@ -263,9 +259,9 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
ASSERT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- payments::mojom::blink::PaymentResponse::New();
- response->shipping_address = payments::mojom::blink::PaymentAddress::New();
+ mojom::blink::PaymentResponsePtr response =
+ mojom::blink::PaymentResponse::New();
+ response->shipping_address = mojom::blink::PaymentAddress::New();
response->shipping_address->country = "US";
response->shipping_address->language_code = "en";
response->shipping_address->script_code = "Latn";
@@ -273,8 +269,8 @@
request->show(scope.getScriptState())
.then(funcs.expectNoCall(), funcs.expectCall());
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
}
// If the merchant does not request shipping information, but the browser
@@ -289,15 +285,15 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
ASSERT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- payments::mojom::blink::PaymentResponse::New();
+ mojom::blink::PaymentResponsePtr response =
+ mojom::blink::PaymentResponse::New();
response->shipping_option = "";
request->show(scope.getScriptState())
.then(funcs.expectNoCall(), funcs.expectCall());
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
}
// If the merchant does not request a payer name, but the browser provides it,
@@ -312,15 +308,15 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
EXPECT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- payments::mojom::blink::PaymentResponse::New();
+ mojom::blink::PaymentResponsePtr response =
+ mojom::blink::PaymentResponse::New();
response->payer_name = "";
request->show(scope.getScriptState())
.then(funcs.expectNoCall(), funcs.expectCall());
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
}
// If the merchant does not request an email, but the browser provides it,
@@ -335,15 +331,15 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
EXPECT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- payments::mojom::blink::PaymentResponse::New();
+ mojom::blink::PaymentResponsePtr response =
+ mojom::blink::PaymentResponse::New();
response->payer_email = "";
request->show(scope.getScriptState())
.then(funcs.expectNoCall(), funcs.expectCall());
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
}
// If the merchant does not request a phone number, but the browser provides it,
@@ -358,15 +354,15 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
EXPECT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- payments::mojom::blink::PaymentResponse::New();
+ mojom::blink::PaymentResponsePtr response =
+ mojom::blink::PaymentResponse::New();
response->payer_phone = "";
request->show(scope.getScriptState())
.then(funcs.expectNoCall(), funcs.expectCall());
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
}
// If the merchant requests shipping information, but the browser provides an
@@ -381,17 +377,16 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
ASSERT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- buildPaymentResponseForTest();
+ mojom::blink::PaymentResponsePtr response = buildPaymentResponseForTest();
response->shipping_option = "standardShipping";
- response->shipping_address = payments::mojom::blink::PaymentAddress::New();
+ response->shipping_address = mojom::blink::PaymentAddress::New();
response->shipping_address->country = "Atlantis";
request->show(scope.getScriptState())
.then(funcs.expectNoCall(), funcs.expectCall());
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
}
class PaymentResponseFunction : public ScriptFunction {
@@ -430,10 +425,9 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
ASSERT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- buildPaymentResponseForTest();
+ mojom::blink::PaymentResponsePtr response = buildPaymentResponseForTest();
response->shipping_option = "standardShipping";
- response->shipping_address = payments::mojom::blink::PaymentAddress::New();
+ response->shipping_address = mojom::blink::PaymentAddress::New();
response->shipping_address->country = "US";
response->shipping_address->language_code = "en";
response->shipping_address->script_code = "Latn";
@@ -442,8 +436,8 @@
.then(PaymentResponseFunction::create(scope.getScriptState(), &outValue),
funcs.expectNoCall());
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
v8::MicrotasksScope::PerformCheckpoint(scope.isolate());
PaymentResponse* resp = V8PaymentResponse::toImplWithTypeCheck(
@@ -465,16 +459,16 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
EXPECT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- payments::mojom::blink::PaymentResponse::New();
+ mojom::blink::PaymentResponsePtr response =
+ mojom::blink::PaymentResponse::New();
response->payer_name = "Jon Doe";
ScriptValue outValue;
request->show(scope.getScriptState())
.then(PaymentResponseFunction::create(scope.getScriptState(), &outValue),
funcs.expectNoCall());
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
v8::MicrotasksScope::PerformCheckpoint(scope.isolate());
PaymentResponse* pr = V8PaymentResponse::toImplWithTypeCheck(
@@ -494,16 +488,16 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
EXPECT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- payments::mojom::blink::PaymentResponse::New();
+ mojom::blink::PaymentResponsePtr response =
+ mojom::blink::PaymentResponse::New();
response->payer_email = "abc@gmail.com";
ScriptValue outValue;
request->show(scope.getScriptState())
.then(PaymentResponseFunction::create(scope.getScriptState(), &outValue),
funcs.expectNoCall());
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
v8::MicrotasksScope::PerformCheckpoint(scope.isolate());
PaymentResponse* pr = V8PaymentResponse::toImplWithTypeCheck(
@@ -523,8 +517,8 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
EXPECT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- payments::mojom::blink::PaymentResponse::New();
+ mojom::blink::PaymentResponsePtr response =
+ mojom::blink::PaymentResponse::New();
response->payer_phone = "0123";
ScriptValue outValue;
@@ -532,8 +526,8 @@
.then(PaymentResponseFunction::create(scope.getScriptState(), &outValue),
funcs.expectNoCall());
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
v8::MicrotasksScope::PerformCheckpoint(scope.isolate());
PaymentResponse* pr = V8PaymentResponse::toImplWithTypeCheck(
scope.isolate(), outValue.v8Value());
@@ -558,8 +552,8 @@
.then(PaymentResponseFunction::create(scope.getScriptState(), &outValue),
funcs.expectNoCall());
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(buildPaymentResponseForTest());
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ buildPaymentResponseForTest());
v8::MicrotasksScope::PerformCheckpoint(scope.isolate());
PaymentResponse* resp = V8PaymentResponse::toImplWithTypeCheck(
@@ -580,16 +574,16 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
EXPECT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- payments::mojom::blink::PaymentResponse::New();
+ mojom::blink::PaymentResponsePtr response =
+ mojom::blink::PaymentResponse::New();
response->payer_phone = String();
ScriptValue outValue;
request->show(scope.getScriptState())
.then(PaymentResponseFunction::create(scope.getScriptState(), &outValue),
funcs.expectNoCall());
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
v8::MicrotasksScope::PerformCheckpoint(scope.isolate());
PaymentResponse* pr = V8PaymentResponse::toImplWithTypeCheck(
@@ -609,16 +603,16 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
EXPECT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- payments::mojom::blink::PaymentResponse::New();
+ mojom::blink::PaymentResponsePtr response =
+ mojom::blink::PaymentResponse::New();
response->payer_name = String();
ScriptValue outValue;
request->show(scope.getScriptState())
.then(PaymentResponseFunction::create(scope.getScriptState(), &outValue),
funcs.expectNoCall());
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
v8::MicrotasksScope::PerformCheckpoint(scope.isolate());
PaymentResponse* pr = V8PaymentResponse::toImplWithTypeCheck(
@@ -638,16 +632,16 @@
scope.getScriptState(), buildPaymentMethodDataForTest(),
buildPaymentDetailsForTest(), options, scope.getExceptionState());
EXPECT_FALSE(scope.getExceptionState().hadException());
- payments::mojom::blink::PaymentResponsePtr response =
- payments::mojom::blink::PaymentResponse::New();
+ mojom::blink::PaymentResponsePtr response =
+ mojom::blink::PaymentResponse::New();
response->payer_email = String();
ScriptValue outValue;
request->show(scope.getScriptState())
.then(PaymentResponseFunction::create(scope.getScriptState(), &outValue),
funcs.expectNoCall());
- static_cast<payments::mojom::blink::PaymentRequestClient*>(request)
- ->OnPaymentResponse(std::move(response));
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnPaymentResponse(
+ std::move(response));
v8::MicrotasksScope::PerformCheckpoint(scope.isolate());
PaymentResponse* pr = V8PaymentResponse::toImplWithTypeCheck(

Powered by Google App Engine
This is Rietveld 408576698