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

Side by Side Diff: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestDataUrlTest.java

Issue 2859613002: Disable web payments API on blob: and data: schemes. (Closed)
Patch Set: Fix up Android test Created 3 years, 7 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.chrome.browser.payments;
6
7 import android.support.test.filters.MediumTest;
8
9 import org.chromium.base.test.util.Feature;
10
11 import java.util.concurrent.ExecutionException;
12 import java.util.concurrent.TimeoutException;
13
14 /** Web payments test for data URL. */
15 public class PaymentRequestDataUrlTest extends PaymentRequestTestBase {
16 public PaymentRequestDataUrlTest() {
17 super("data:text/html,<html><head>"
18 + "<meta name=\"viewport\" content=\"width=device-width, initial -scale=1, "
19 + "maximum-scale=1\"></head><body><button id=\"buy\" onclick=\"t ry { "
20 + "(new PaymentRequest([{supportedMethods: ['basic-card']}], "
21 + "{total: {label: 'Total', "
22 + " amount: {currency: 'USD', value: '1.00'}}})).show(); "
23 + "} catch(e) { "
24 + "document.getElementById('result').innerHTML = e; "
25 + "}\">Data URL Test</button><div id='result'></div></body></htm l>");
26 }
27
28 @Override
29 public void onMainActivityStarted()
30 throws InterruptedException, ExecutionException, TimeoutException {}
31
32 @MediumTest
33 @Feature({"Payments"})
34 public void test() throws InterruptedException, ExecutionException, TimeoutE xception {
35 openPageAndClickNode("buy");
36 expectResultContains(new String[] {"SecurityError: Failed to construct ' PaymentRequest': "
37 + "Must be in a secure context"});
38 }
39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698