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

Import wpt@bc0ed740d1afbd88607aab23ab23ddc81d685073

Using wpt-import in Chromium e096591e.
With Chromium commits locally applied on WPT:
6386d9d8 "Update service_worker_unregister_and_register()"


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:
bjonesbe@adobe.com:
  external/wpt/css/css-shapes
foolip@chromium.org, lpz@chromium.org, robertma@chromium.org:
  external/wpt/tools
nzolghadr@chromium.org, mustaq@chromium.org:
  external/wpt/pointerevents

NOAUTOREVERT=true
TBR=lpz

No-Export: true
Change-Id: I2df8cbb5beeb4841b3f0e3f2aa529d9f4bf199da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1864243Reviewed-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@{#706689}
parent e1961cc7
......@@ -19,16 +19,16 @@
// font relative units: em, ex, ch, rem
var units = ['em', 'ex', 'ch', 'rem'];
var resolveds = {};
ParsingUtils.setupFonts(function () {
var div = document.createElement('div');
document.body.appendChild(div);
units.forEach(function(unit) {
div.style.width = '10' + unit;
var s = getComputedStyle(div);
resolveds[unit] = parseFloat(s.width);
});
document.body.removeChild(div);
})();
ParsingUtils.setupFonts();
var div = document.createElement('div');
document.body.appendChild(div);
units.forEach(function(unit) {
div.style.width = '10' + unit;
var s = getComputedStyle(div);
resolveds[unit] = parseFloat(s.width);
});
document.body.removeChild(div);
function fillArray(string, length) {
return Array.apply(null, new Array(length)).map(String.prototype.valueOf, string);
......@@ -49,6 +49,8 @@
});
generate_tests(testUnit, tests);
ParsingUtils.restoreFonts();
</script>
</body>
</html>
......@@ -27,7 +27,7 @@
var captureGot = false;
setup({ explicit_done: true });
setup({ single_test: true });
add_completion_callback(showPointerTypes);
function run() {
......@@ -49,9 +49,7 @@
// When the setPointerCapture method is invoked, if the specified pointer is not in active button state, then the method must have no effect on subsequent pointer events.
// TA: 13.2
on_event(target0, "pointerout", function (event) {
test(function() {
assert_false(captureGot, "pointer capture is not set while button state is inactive")
}, "pointer capture is not set while button state is inactive");
assert_false(captureGot, "pointer capture is not set while button state is inactive")
// Make sure the test finishes after all the input actions are completed.
actions_promise.then( () => {
done();
......
......@@ -63,6 +63,13 @@
"help": "Print branch point from master",
"virtualenv": false
},
"rev-list": {
"path": "revlist.py",
"script": "run_rev_list",
"parser": "get_parser",
"help": "List tagged revisions at regular intervals",
"virtualenv": false
},
"install-android-emulator": {
"path": "android.py",
"script": "run_install",
......
import argparse
import logging
import os
import time
from tools.wpt.testfiles import get_git_cmd
here = os.path.dirname(__file__)
wpt_root = os.path.abspath(os.path.join(here, os.pardir, os.pardir))
logger = logging.getLogger()
MYPY = False
if MYPY:
# MYPY is set to True when run under Mypy.
from typing import Any
from typing import Dict
from typing import List
from typing import Text
def calculate_cutoff_date(until, epoch, offset):
return ((((until - offset) // epoch)) * epoch) + offset
def parse_epoch(string):
# type: (str) -> int
UNIT_DICT = {"h": 3600, "d": 86400, "w": 604800}
base = string[:-1]
unit = string[-1:]
if base.isdigit() and unit in UNIT_DICT:
return int(base) * UNIT_DICT[unit]
raise argparse.ArgumentTypeError('must be digits followed by h/d/w')
def get_tagged_revisions(pattern):
# type: (bytes) -> List[..., Dict]
'''
Returns the tagged revisions indexed by the committer date.
'''
git = get_git_cmd(wpt_root)
args = [
pattern,
'--sort=-committerdate',
'--format=%(refname:lstrip=2) %(objectname) %(committerdate:raw)',
'--count=100000'
]
for line in git("for-each-ref", *args).splitlines():
tag, commit, date, _ = line.split(" ")
date = int(date)
yield tag, commit, date
def list_tagged_revisons(epoch, max_count):
# type: (**Any) -> List[Text]
logger.debug("list_tagged_revisons(%s, %s)" % (epoch, max_count))
# Set an offset to start to count the the weekly epoch from
# Monday 00:00:00. This is particularly important for the weekly epoch
# because fix the start of the epoch to Monday. This offset is calculated
# from Thursday, 1 January 1970 0:00:00 to Monday, 5 January 1970 0:00:00
epoch_offset = 345600
# "epoch_threshold" set a safety margin after this time it is fine to
# consider that any tags are created and pushed.
epoch_threshold = 600
epoch_until = int(time.time()) - epoch_threshold
count = 0
# Iterates the tagged revisions in descending order finding the more
# recent commit still older than a "cutoff_date" value.
# When a commit is found "cutoff_date" is set to a new value multiplier of
# "epoch" but still below of the date of the current commit found.
# This needed to deal with intervals where no candidates were found
# for the current "epoch" and the next candidate found is yet below
# the lower values of the interval (it is the case of J and I for the
# interval between Wed and Tue, in the example). The algorithm fix
# the next "cutoff_date" value based on the date value of the current one
# skipping the intermediate values.
# The loop ends once we reached the required number of revisions to return
# or the are no more tagged revisions or the cutoff_date reach zero.
#
# Fri Sat Sun Mon Tue Wed Thu Fri Sat
# | | | | | | | | |
# -A---B-C---DEF---G---H--IJ----------K-----L-M----N--O--
# ^
# now
# Expected result: N,M,K,J,H,G,F,C,A
cutoff_date = calculate_cutoff_date(epoch_until, epoch, epoch_offset)
for _, commit, date in get_tagged_revisions("refs/tags/merge_pr_*"):
if count >= max_count:
return
if date < cutoff_date:
print(commit)
count += 1
cutoff_date = calculate_cutoff_date(date, epoch, epoch_offset)
def get_parser():
# type: () -> argparse.ArgumentParser
parser = argparse.ArgumentParser()
parser.add_argument("--epoch",
default="1d",
type=parse_epoch,
help="regular interval of time selected to get the "
"tagged revisions. Valid values are digits "
"followed by h/d/w (e.x. 9h, 9d, 9w ...) where "
"the mimimun selectable interval is one hour "
"(1h)")
parser.add_argument("--max-count",
default=1,
type=int,
help="maximum number of revisions to be returned by "
"the command")
return parser
def run_rev_list(**kwargs):
# type: (**Any) -> None
list_tagged_revisons(kwargs["epoch"], kwargs["max_count"])
This is a testharness.js-based test.
FAIL Shape Outside Basic Shape Computed Font Relative Lengths Uncaught TypeError: ParsingUtils.setupFonts(...) is not a function
PASS em units
PASS ex units
PASS ch units
PASS rem units
Harness: the test ran to completion.
This is a testharness.js-based test.
PASS em units
PASS ex units
PASS ch units
PASS rem units
Harness: the test ran to completion.
This is a testharness.js-based test.
PASS em units
FAIL ex units assert_equals: expected "polygon(130.078px 130.078px)" but got "polygon(130.08px 130.08px)"
PASS ch units
PASS rem units
Harness: the test ran to completion.
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