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

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

Issue 2651883008: Make content::FeaturePolicy implement WebFeaturePolicy, and use it in blink code (Closed)
Patch Set: Cleanup Created 3 years, 10 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
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/PaymentTestHelper.h" 5 #include "modules/payments/PaymentTestHelper.h"
6 6
7 #include "bindings/core/v8/ScriptState.h" 7 #include "bindings/core/v8/ScriptState.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "modules/payments/PaymentCurrencyAmount.h" 9 #include "modules/payments/PaymentCurrencyAmount.h"
10 #include "modules/payments/PaymentMethodData.h" 10 #include "modules/payments/PaymentMethodData.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 return methodData; 162 return methodData;
163 } 163 }
164 164
165 payments::mojom::blink::PaymentResponsePtr buildPaymentResponseForTest() { 165 payments::mojom::blink::PaymentResponsePtr buildPaymentResponseForTest() {
166 payments::mojom::blink::PaymentResponsePtr result = 166 payments::mojom::blink::PaymentResponsePtr result =
167 payments::mojom::blink::PaymentResponse::New(); 167 payments::mojom::blink::PaymentResponse::New();
168 return result; 168 return result;
169 } 169 }
170 170
171 void makePaymentRequestOriginSecure(Document& document) { 171 void makePaymentRequestOriginSecure(Document& document) {
172 document.setSecurityOrigin( 172 document.updateSecurityOrigin(
raymes 2017/02/13 04:45:22 Are there other places that call setSecurityOrigin
iclelland 2017/02/23 20:04:12 That's actually a really good point -- Most of the
173 SecurityOrigin::create(KURL(KURL(), "https://www.example.com/"))); 173 SecurityOrigin::create(KURL(KURL(), "https://www.example.com/")));
174 } 174 }
175 175
176 PaymentRequestMockFunctionScope::PaymentRequestMockFunctionScope( 176 PaymentRequestMockFunctionScope::PaymentRequestMockFunctionScope(
177 ScriptState* scriptState) 177 ScriptState* scriptState)
178 : m_scriptState(scriptState) {} 178 : m_scriptState(scriptState) {}
179 179
180 PaymentRequestMockFunctionScope::~PaymentRequestMockFunctionScope() { 180 PaymentRequestMockFunctionScope::~PaymentRequestMockFunctionScope() {
181 v8::MicrotasksScope::PerformCheckpoint(m_scriptState->isolate()); 181 v8::MicrotasksScope::PerformCheckpoint(m_scriptState->isolate());
182 for (MockFunction* mockFunction : m_mockFunctions) { 182 for (MockFunction* mockFunction : m_mockFunctions) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 ON_CALL(*this, call(testing::_)) 222 ON_CALL(*this, call(testing::_))
223 .WillByDefault( 223 .WillByDefault(
224 testing::DoAll(SaveValueIn(m_value), testing::ReturnArg<0>())); 224 testing::DoAll(SaveValueIn(m_value), testing::ReturnArg<0>()));
225 } 225 }
226 226
227 v8::Local<v8::Function> PaymentRequestMockFunctionScope::MockFunction::bind() { 227 v8::Local<v8::Function> PaymentRequestMockFunctionScope::MockFunction::bind() {
228 return bindToV8Function(); 228 return bindToV8Function();
229 } 229 }
230 230
231 } // namespace blink 231 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698