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

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

Issue 2170783002: Add a timeout to the update event in case page doesn't resolve promise from updateWith (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed the DCHECK Created 4 years, 5 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/PaymentRequestUpdateEvent.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/PaymentRequestUpdateEvent.h" 5 #include "modules/payments/PaymentRequestUpdateEvent.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "bindings/core/v8/V8BindingForTesting.h" 10 #include "bindings/core/v8/V8BindingForTesting.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 TEST(PaymentRequestUpdateEventTest, UpdaterNotRequired) 94 TEST(PaymentRequestUpdateEventTest, UpdaterNotRequired)
95 { 95 {
96 V8TestingScope scope; 96 V8TestingScope scope;
97 PaymentRequestUpdateEvent* event = PaymentRequestUpdateEvent::create(EventTy peNames::shippingaddresschange); 97 PaymentRequestUpdateEvent* event = PaymentRequestUpdateEvent::create(EventTy peNames::shippingaddresschange);
98 98
99 event->updateWith(scope.getScriptState(), ScriptPromiseResolver::create(scop e.getScriptState())->promise(), scope.getExceptionState()); 99 event->updateWith(scope.getScriptState(), ScriptPromiseResolver::create(scop e.getScriptState())->promise(), scope.getExceptionState());
100 100
101 EXPECT_FALSE(scope.getExceptionState().hadException()); 101 EXPECT_FALSE(scope.getExceptionState().hadException());
102 } 102 }
103 103
104 TEST(PaymentRequestUpdateEventTest, OnUpdatePaymentDetailsTimeout)
105 {
106 V8TestingScope scope;
107 PaymentRequestUpdateEvent* event = PaymentRequestUpdateEvent::create();
108 MockPaymentUpdater* updater = new MockPaymentUpdater;
109 event->setPaymentDetailsUpdater(updater);
110
111 EXPECT_CALL(*updater, onUpdatePaymentDetails(testing::_)).Times(0);
112 EXPECT_CALL(*updater, onUpdatePaymentDetailsFailure(testing::_));
113
114 event->onTimerFired(0);
115 }
116
104 } // namespace 117 } // namespace
105 } // namespace blink 118 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/payments/PaymentRequestUpdateEvent.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698