Commit cfb9da4b authored by Chromium WPT Sync's avatar Chromium WPT Sync Committed by Commit Bot

Import wpt@ee893908a206f562a35f202fce67e667bc19f603

Using wpt-import in Chromium d0f5ec35.
With Chromium commits locally applied on WPT:
e83dd93c "Limit backtracking on regexp called from blink."
c8b6e1ce "Chromedriver] Fix PerformAction to support multi touch points cases"
500a74f5 "Add a runtime flag to enforce strict MIME type checks for workers."
eb07c684 "[scroll-snap] Add keyboard test to WPT"


Note to sheriffs: This CL imports external tests and adds
expectations for those tests; if this CL is large and causes
a few new failures, please fix the failures by adding new
lines to TestExpectations rather than reverting. See:
https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md

Directory owners for changes in this CL:
foolip@chromium.org, lpz@chromium.org, robertma@chromium.org:
  external/wpt/tools
foolip@chromium.org, robertma@chromium.org, smcgruer@chromium.org:
  external/wpt/infrastructure
rouslan@chromium.org, mathp@chromium.org:
  external/wpt/payment-method-basic-card

NOAUTOREVERT=true
TBR=robertma

No-Export: true
Change-Id: Ic138c9cce75d19378605f955e39fceb06c705422
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1921544Reviewed-by: default avatarWPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: WPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#716429}
parent 318912a6
...@@ -2093,3 +2093,6 @@ crbug.com/870173 virtual/omt-worker-fetch/http/tests/workers/worker-redirect.htm ...@@ -2093,3 +2093,6 @@ crbug.com/870173 virtual/omt-worker-fetch/http/tests/workers/worker-redirect.htm
# There is a version in wpt_internal that performs the same checks but works # There is a version in wpt_internal that performs the same checks but works
# as expected. # as expected.
external/wpt/ambient-light/AmbientLightSensor.https.html [ Skip ] external/wpt/ambient-light/AmbientLightSensor.https.html [ Skip ]
crbug.com/626703 [ Linux ] external/wpt/payment-method-basic-card/billing-address-is-null-manual.https.html [ Skip ]
crbug.com/626703 [ Mac ] external/wpt/payment-method-basic-card/billing-address-is-null-manual.https.html [ Skip ]
crbug.com/626703 [ Win ] external/wpt/payment-method-basic-card/billing-address-is-null-manual.https.html [ Skip ]
...@@ -2744,6 +2744,12 @@ crbug.com/618969 external/wpt/css/css-grid/subgrid/ [ Skip ] ...@@ -2744,6 +2744,12 @@ crbug.com/618969 external/wpt/css/css-grid/subgrid/ [ Skip ]
crbug.com/1012627 [ Win7 ] external/wpt/css/css-text/line-breaking/line-breaking-021.html [ Failure ] crbug.com/1012627 [ Win7 ] external/wpt/css/css-text/line-breaking/line-breaking-021.html [ Failure ]
# ====== New tests from wpt-importer added here ====== # ====== New tests from wpt-importer added here ======
crbug.com/626703 [ Linux ] external/wpt/html/semantics/document-metadata/the-link-element/link-multiple-error-events.html [ Timeout ]
crbug.com/626703 [ Mac ] external/wpt/html/semantics/document-metadata/the-link-element/link-multiple-error-events.html [ Timeout ]
crbug.com/626703 [ Win ] external/wpt/html/semantics/document-metadata/the-link-element/link-multiple-error-events.html [ Timeout ]
crbug.com/626703 [ Linux ] external/wpt/html/semantics/document-metadata/the-link-element/link-multiple-load-events.html [ Timeout ]
crbug.com/626703 [ Mac ] external/wpt/html/semantics/document-metadata/the-link-element/link-multiple-load-events.html [ Timeout ]
crbug.com/626703 [ Win ] external/wpt/html/semantics/document-metadata/the-link-element/link-multiple-load-events.html [ Timeout ]
crbug.com/626703 [ Mac ] external/wpt/css/css-flexbox/select-element-zero-height-001.html [ Failure ] crbug.com/626703 [ Mac ] external/wpt/css/css-flexbox/select-element-zero-height-001.html [ Failure ]
crbug.com/626703 [ Linux ] virtual/layout_ng_flex_box/external/wpt/css/css-flexbox/select-element-zero-height-001.html [ Failure ] crbug.com/626703 [ Linux ] virtual/layout_ng_flex_box/external/wpt/css/css-flexbox/select-element-zero-height-001.html [ Failure ]
crbug.com/626703 [ Mac ] virtual/layout_ng_flex_box/external/wpt/css/css-flexbox/select-element-zero-height-001.html [ Failure ] crbug.com/626703 [ Mac ] virtual/layout_ng_flex_box/external/wpt/css/css-flexbox/select-element-zero-height-001.html [ Failure ]
......
<!DOCTYPE html>
<link rel="author" title="Dom Farolino" href="mailto:dom@chromium.org">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-link-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link id=style_link rel=stylesheet>
<script>
async_test(t => {
const link = document.querySelector('#style_link');
link.onload = t.unreached_func('Sheet should fail to load');
link.onerror = t.step_func(() => {
link.onerror = t.step_func_done(() => {});
link.href = 'nonexistent.css?second';
});
link.href = 'nonexistent.css?first';
}, "Check if the <link>'s error event fires for each stylesheet it fails to load");
</script>
</head>
</html>
<!DOCTYPE html>
<link rel="author" title="Dom Farolino" href="mailto:dom@chromium.org">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-link-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link id=style_link rel=stylesheet>
<script>
async_test(t => {
const link = document.querySelector('#style_link');
link.onerror = t.unreached_func('Sheet should load successfully');
link.onload = t.step_func(() => {
link.onload = t.step_func_done(() => {});
link.href = 'style.css?second';
});
link.href = 'style.css?first';
}, "Check if the <link>'s load event fires for each stylesheet it loads");
</script>
</head>
</html>
[multiTouchPoints.html] [multiTouchPoints.html]
expected: expected:
if product == "firefox" or product == "safari" or product == "epiphany" or product == "webkit": ERROR if product == "firefox" or product == "safari" or product == "epiphany" or product == "webkit": ERROR
[TestDriver actions: two touch points with one moving one pause]
expected:
if product == "chrome": FAIL
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
// (https://github.com/tidoust/reffy-reports) // (https://github.com/tidoust/reffy-reports)
// Source: DOM Parsing and Serialization (https://w3c.github.io/DOM-Parsing/) // Source: DOM Parsing and Serialization (https://w3c.github.io/DOM-Parsing/)
[Constructor, Exposed=Window] [Exposed=Window]
interface DOMParser { interface DOMParser {
constructor();
[NewObject] Document parseFromString(DOMString str, SupportedType type); [NewObject] Document parseFromString(DOMString str, SupportedType type);
}; };
...@@ -16,20 +17,21 @@ enum SupportedType { ...@@ -16,20 +17,21 @@ enum SupportedType {
"image/svg+xml" "image/svg+xml"
}; };
[Constructor, Exposed=Window] [Exposed=Window]
interface XMLSerializer { interface XMLSerializer {
constructor();
DOMString serializeToString(Node root); DOMString serializeToString(Node root);
}; };
interface mixin InnerHTML { interface mixin InnerHTML {
[CEReactions, TreatNullAs=EmptyString] attribute DOMString innerHTML; [CEReactions] attribute [TreatNullAs=EmptyString] DOMString innerHTML;
}; };
Element includes InnerHTML; Element includes InnerHTML;
ShadowRoot includes InnerHTML; ShadowRoot includes InnerHTML;
partial interface Element { partial interface Element {
[CEReactions, TreatNullAs=EmptyString] attribute DOMString outerHTML; [CEReactions] attribute [TreatNullAs=EmptyString] DOMString outerHTML;
[CEReactions] void insertAdjacentHTML(DOMString position, DOMString text); [CEReactions] void insertAdjacentHTML(DOMString position, DOMString text);
}; };
......
<!DOCTYPE html> <meta charset="utf-8" />
<title>Test for requesting billing address</title>
<link
rel="help"
href="https://github.com/w3c/payment-method-basic-card/pull/65"
/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
setup({
explicit_done: true,
explicit_timeout: true,
});
const basicCard = { supportedMethods: "basic-card" };
const details = {
total: {
label: "label",
amount: { currency: "USD", value: "5.00" },
},
};
// Smoke tests
test(() => {
assert_true(
"onpaymentmethodchange" in PaymentRequest.prototype,
"The paymentmethodchange event handler is not supported on PaymentRequest"
);
assert_true(
"PaymentMethodChangeEvent" in window,
"The PaymentMethodChangeEvent is not supported"
);
}, "PaymentMethodChangeEvent support");
function dontRequestBillingAddress(options) {
promise_test(async t => {
const request = new PaymentRequest([basicCard], details, {
requestBillingAddress: false,
});
const showPromise = request.show();
// Let's check the method data from PaymentMethodChangeEvent.
const event = await new Promise(resolve =>
request.addEventListener("paymentmethodchange", resolve)
);
assert_true(
event instanceof PaymentMethodChangeEvent,
"Expected instance of PaymentMethodChangeEvent"
);
assert_equals(
event.methodDetails.billingAddress,
null,
"Expected methodDetails.billingAddress to be null"
);
// Let's check the billingAddress in the response
const response = await showPromise;
const {
details: { billingAddress: responseBillingAddress },
} = response;
assert_equals(
responseBillingAddress,
null,
"Expected PaymentResponse.data.billingAddress to be null"
);
// And we are done
await response.complete("success");
});
}
function requestBillingAddress() {
promise_test(async t => {
const request = new PaymentRequest([basicCard], details, {
requestBillingAddress: true,
});
const showPromise = request.show();
// Let's check the methodDetails from event.
const event = await new Promise(resolve =>
request.addEventListener("paymentmethodchange", resolve)
);
assert_true(
event instanceof PaymentMethodChangeEvent,
"Expected instance of PaymentMethodChangeEvent"
);
const { billingAddress: eventBillingAddress } = event.methodDetails;
checkRedactList(eventBillingAddress);
// Let's check the billingAddress in the response.
const response = await showPromise;
const {
details: { billingAddress: responseBillingAddress },
} = await showPromise;
checkRedactList(responseBillingAddress);
// And we are done.
await response.complete("success");
});
}
function checkRedaction(billingAddress) {
assert_true(
billingAddress instanceof PaymentAddress,
"Expected instance of PaymentAddress"
);
for (const item of ["organization", "phone", "recipient"]) {
assert_equals(
billingAddress[item],
"",
`Expected billingAddress's "${item}" attribute to equal null (redacted).`
);
}
}
</script>
<h2>Request billing address</h2>
<p>
Click on each button in sequence from top to bottom without refreshing the
page. Each button will bring up the Payment Request UI window.
</p>
<p>
When the payment sheet is presented, select a payment method (e.g., a credit
card), and press "Pay".
</p>
<ol>
<li>
<button onclick="dontRequestBillingAddress()">
When no billing address is requested,
`PaymentMethodChangeEvent.methodData.billingAddress` is null.
</button>
</li>
<li>
<button onclick="requestBillingAddress()">
When billing address is
requested,`PaymentMethodChangeEvent.methodData.billingAddress` is a
`PaymentAddress`.
</button>
</li>
<li><button onclick="done()">Done!</button></li>
</ol>
<small>
If you find a buggy test, please
<a href="https://github.com/web-platform-tests/wpt/issues">file a bug</a> and
tag one of the
<a
href="https://github.com/web-platform-tests/wpt/blob/master/payment-request/META.yml"
>suggested reviewers</a
>.
</small>
# flake8: noqa # flake8: noqa
from client import ( from .client import (
Cookies, Cookies,
Element, Element,
Find, Find,
...@@ -8,7 +8,7 @@ from client import ( ...@@ -8,7 +8,7 @@ from client import (
Session, Session,
Timeouts, Timeouts,
Window) Window)
from error import ( from .error import (
ElementNotSelectableException, ElementNotSelectableException,
ElementNotVisibleException, ElementNotVisibleException,
InvalidArgumentException, InvalidArgumentException,
......
import urlparse from . import error
from . import protocol
import error from . import transport
import protocol
import transport
from six import string_types from six import string_types
from six.moves.urllib import parse as urlparse
def command(func): def command(func):
......
import collections import collections
import json import json
from six import itervalues
class WebDriverException(Exception): class WebDriverException(Exception):
http_status = None http_status = None
...@@ -205,6 +206,6 @@ def get(error_code): ...@@ -205,6 +206,6 @@ def get(error_code):
_errors = collections.defaultdict() _errors = collections.defaultdict()
for item in locals().values(): for item in list(itervalues(locals())):
if type(item) == type and issubclass(item, WebDriverException): if type(item) == type and issubclass(item, WebDriverException):
_errors[item.status_code] = item _errors[item.status_code] = item
import httplib
import json import json
import select import select
import urlparse from six.moves.urllib import parse as urlparse
from six.moves import http_client as httplib
import error from . import error
from six import text_type from six import text_type
......
...@@ -3,6 +3,6 @@ mozinfo==1.1.0 ...@@ -3,6 +3,6 @@ mozinfo==1.1.0
mozlog==5.0 mozlog==5.0
mozdebug==0.1.1 mozdebug==0.1.1
pillow==6.2.1 pillow==6.2.1
urllib3[secure]==1.25.6 urllib3[secure]==1.25.7
requests==2.22.0 requests==2.22.0
six==1.13.0 six==1.13.0
...@@ -213,7 +213,7 @@ class MarionetteTestharnessProtocolPart(TestharnessProtocolPart): ...@@ -213,7 +213,7 @@ class MarionetteTestharnessProtocolPart(TestharnessProtocolPart):
handles = self.marionette.window_handles handles = self.marionette.window_handles
if len(handles) == 2: if len(handles) == 2:
test_window = next(iter(set(handles) - {parent})) test_window = next(iter(set(handles) - {parent}))
elif handles[0] == parent and len(handles) > 2: elif len(handles) > 2 and handles[0] == parent:
# Hope the first one here is the test window # Hope the first one here is the test window
test_window = handles[1] test_window = handles[1]
......
...@@ -12,7 +12,7 @@ def perform_actions(session, actions): ...@@ -12,7 +12,7 @@ def perform_actions(session, actions):
@pytest.mark.parametrize("action_type", ["none", "key", "pointer"]) @pytest.mark.parametrize("action_type", ["none", "key", "pointer"])
def test_pause_positive_integer(session, action_type): def test_pause_positive_integer(session, action_type):
for valid_duration in [0, 1]: for valid_duration in [0.0, 1]:
actions = [{ actions = [{
"type": action_type, "type": action_type,
"id": "foobar", "id": "foobar",
...@@ -38,7 +38,7 @@ def test_pause_positive_integer(session, action_type): ...@@ -38,7 +38,7 @@ def test_pause_positive_integer(session, action_type):
@pytest.mark.parametrize("action_type", ["none", "key", "pointer"]) @pytest.mark.parametrize("action_type", ["none", "key", "pointer"])
def test_pause_invalid_types(session, action_type): def test_pause_invalid_types(session, action_type):
for invalid_type in [0.0, None, "foo", True, [], {}]: for invalid_type in [0.1, None, "foo", True, [], {}]:
actions = [{ actions = [{
"type": action_type, "type": action_type,
"id": "foobar", "id": "foobar",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment