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

Side by Side Diff: third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp

Issue 2734493002: Incognito mode behavior for 3rd party Android payment apps. (Closed)
Patch Set: Fix test Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/payments/PaymentRequest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/payments/PaymentRequest.h" 5 #include "modules/payments/PaymentRequest.h"
6 6
7 #include "bindings/core/v8/V8BindingForTesting.h" 7 #include "bindings/core/v8/V8BindingForTesting.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/ExceptionCode.h" 9 #include "core/dom/ExceptionCode.h"
10 #include "modules/payments/PaymentTestHelper.h" 10 #include "modules/payments/PaymentTestHelper.h"
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 EXPECT_FALSE(scope.getExceptionState().hadException()); 398 EXPECT_FALSE(scope.getExceptionState().hadException());
399 399
400 String errorMessage; 400 String errorMessage;
401 request->show(scope.getScriptState()) 401 request->show(scope.getScriptState())
402 .then(funcs.expectNoCall(), funcs.expectCall(&errorMessage)); 402 .then(funcs.expectNoCall(), funcs.expectCall(&errorMessage));
403 403
404 static_cast<payments::mojom::blink::PaymentRequestClient*>(request)->OnError( 404 static_cast<payments::mojom::blink::PaymentRequestClient*>(request)->OnError(
405 payments::mojom::blink::PaymentErrorReason::USER_CANCEL); 405 payments::mojom::blink::PaymentErrorReason::USER_CANCEL);
406 406
407 v8::MicrotasksScope::PerformCheckpoint(scope.getScriptState()->isolate()); 407 v8::MicrotasksScope::PerformCheckpoint(scope.getScriptState()->isolate());
408 EXPECT_EQ("Request cancelled", errorMessage); 408 EXPECT_EQ("AbortError: Request cancelled", errorMessage);
409 } 409 }
410 410
411 TEST(PaymentRequestTest, RejectShowPromiseOnUpdateDetailsFailure) { 411 TEST(PaymentRequestTest, RejectShowPromiseOnUpdateDetailsFailure) {
412 V8TestingScope scope; 412 V8TestingScope scope;
413 PaymentRequestMockFunctionScope funcs(scope.getScriptState()); 413 PaymentRequestMockFunctionScope funcs(scope.getScriptState());
414 makePaymentRequestOriginSecure(scope.document()); 414 makePaymentRequestOriginSecure(scope.document());
415 PaymentRequest* request = PaymentRequest::create( 415 PaymentRequest* request = PaymentRequest::create(
416 scope.getExecutionContext(), buildPaymentMethodDataForTest(), 416 scope.getExecutionContext(), buildPaymentMethodDataForTest(),
417 buildPaymentDetailsForTest(), scope.getExceptionState()); 417 buildPaymentDetailsForTest(), scope.getExceptionState());
418 EXPECT_FALSE(scope.getExceptionState().hadException()); 418 EXPECT_FALSE(scope.getExceptionState().hadException());
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 scope.getScriptState(), 639 scope.getScriptState(),
640 fromJSONString(scope.getScriptState()->isolate(), 640 fromJSONString(scope.getScriptState()->isolate(),
641 detailWithShippingOptions, scope.getExceptionState()))); 641 detailWithShippingOptions, scope.getExceptionState())));
642 642
643 EXPECT_FALSE(scope.getExceptionState().hadException()); 643 EXPECT_FALSE(scope.getExceptionState().hadException());
644 EXPECT_TRUE(request->shippingOption().isNull()); 644 EXPECT_TRUE(request->shippingOption().isNull());
645 } 645 }
646 646
647 } // namespace 647 } // namespace
648 } // namespace blink 648 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/payments/PaymentRequest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698