diff options
47 files changed, 1046 insertions, 469 deletions
diff --git a/components/layout/display_list/conversions.rs b/components/layout/display_list/conversions.rs index f49c37e7f91..f541ef581ac 100644 --- a/components/layout/display_list/conversions.rs +++ b/components/layout/display_list/conversions.rs @@ -8,7 +8,6 @@ use style::computed_values::image_rendering::T as ImageRendering; use style::computed_values::mix_blend_mode::T as MixBlendMode; use style::computed_values::transform_style::T as TransformStyle; use style::values::computed::{BorderStyle, Filter}; -use style::values::generics::effects::Filter as GenericFilter; use style::values::specified::border::BorderImageRepeatKeyword; use style::values::RGBA; use webrender_api as wr; @@ -40,19 +39,19 @@ impl ToLayout for Filter { type Type = wr::FilterOp; fn to_layout(&self) -> Self::Type { match *self { - GenericFilter::Blur(radius) => wr::FilterOp::Blur(radius.px()), - GenericFilter::Brightness(amount) => wr::FilterOp::Brightness(amount.0), - GenericFilter::Contrast(amount) => wr::FilterOp::Contrast(amount.0), - GenericFilter::Grayscale(amount) => wr::FilterOp::Grayscale(amount.0), - GenericFilter::HueRotate(angle) => wr::FilterOp::HueRotate(angle.radians()), - GenericFilter::Invert(amount) => wr::FilterOp::Invert(amount.0), - GenericFilter::Opacity(amount) => wr::FilterOp::Opacity(amount.0.into(), amount.0), - GenericFilter::Saturate(amount) => wr::FilterOp::Saturate(amount.0), - GenericFilter::Sepia(amount) => wr::FilterOp::Sepia(amount.0), + Filter::Blur(radius) => wr::FilterOp::Blur(radius.px()), + Filter::Brightness(amount) => wr::FilterOp::Brightness(amount.0), + Filter::Contrast(amount) => wr::FilterOp::Contrast(amount.0), + Filter::Grayscale(amount) => wr::FilterOp::Grayscale(amount.0), + Filter::HueRotate(angle) => wr::FilterOp::HueRotate(angle.radians()), + Filter::Invert(amount) => wr::FilterOp::Invert(amount.0), + Filter::Opacity(amount) => wr::FilterOp::Opacity(amount.0.into(), amount.0), + Filter::Saturate(amount) => wr::FilterOp::Saturate(amount.0), + Filter::Sepia(amount) => wr::FilterOp::Sepia(amount.0), // Statically check that DropShadow is impossible. - GenericFilter::DropShadow(ref shadow) => match *shadow {}, + Filter::DropShadow(ref shadow) => match *shadow {}, // Statically check that Url is impossible. - GenericFilter::Url(ref url) => match *url {}, + Filter::Url(ref url) => match *url {}, } } } diff --git a/components/layout/display_list/gradient.rs b/components/layout/display_list/gradient.rs index 9b19ee48299..264bea7fbee 100644 --- a/components/layout/display_list/gradient.rs +++ b/components/layout/display_list/gradient.rs @@ -2,16 +2,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -// FIXME(rust-lang/rust#26264): Remove GenericEndingShape and GenericGradientItem. - use crate::display_list::ToLayout; use app_units::Au; use euclid::{Point2D, Size2D, Vector2D}; use style::properties::ComputedValues; use style::values::computed::image::{EndingShape, LineDirection}; use style::values::computed::{Angle, GradientItem, LengthPercentage, Percentage, Position}; -use style::values::generics::image::EndingShape as GenericEndingShape; -use style::values::generics::image::GradientItem as GenericGradientItem; use style::values::generics::image::{Circle, ColorStop, Ellipse, ShapeExtent}; use style::values::specified::position::{X, Y}; use webrender_api::{ExtendMode, Gradient, GradientBuilder, GradientStop, RadialGradient}; @@ -92,11 +88,11 @@ fn convert_gradient_stops( let mut stop_items = gradient_items .iter() .filter_map(|item| match *item { - GenericGradientItem::SimpleColorStop(color) => Some(ColorStop { + GradientItem::SimpleColorStop(color) => Some(ColorStop { color, position: None, }), - GenericGradientItem::ComplexColorStop { color, position } => Some(ColorStop { + GradientItem::ComplexColorStop { color, position } => Some(ColorStop { color, position: Some(position), }), @@ -301,17 +297,15 @@ pub fn radial( center.vertical.to_used_value(size.height), ); let radius = match shape { - GenericEndingShape::Circle(Circle::Radius(length)) => { + EndingShape::Circle(Circle::Radius(length)) => { let length = Au::from(length); Size2D::new(length, length) }, - GenericEndingShape::Circle(Circle::Extent(extent)) => { - circle_size_keyword(extent, &size, ¢er) - }, - GenericEndingShape::Ellipse(Ellipse::Radii(x, y)) => { + EndingShape::Circle(Circle::Extent(extent)) => circle_size_keyword(extent, &size, ¢er), + EndingShape::Ellipse(Ellipse::Radii(x, y)) => { Size2D::new(x.to_used_value(size.width), y.to_used_value(size.height)) }, - GenericEndingShape::Ellipse(Ellipse::Extent(extent)) => { + EndingShape::Ellipse(Ellipse::Extent(extent)) => { ellipse_size_keyword(extent, &size, ¢er) }, }; diff --git a/components/script/CMakeLists.txt b/components/script/CMakeLists.txt index 0d892801469..5cf4071a144 100644 --- a/components/script/CMakeLists.txt +++ b/components/script/CMakeLists.txt @@ -1,4 +1,4 @@ -project(script) +project(script LANGUAGES) cmake_minimum_required(VERSION 2.6) set(DUMMY ${CMAKE_BUILD_TYPE}) diff --git a/components/script/build.rs b/components/script/build.rs index cefabaac4f8..794e2fe3283 100644 --- a/components/script/build.rs +++ b/components/script/build.rs @@ -9,47 +9,12 @@ use std::fmt; use std::fs::File; use std::io::Write; use std::path::PathBuf; -use std::process::Command; use std::str; use std::time::Instant; fn main() { let start = Instant::now(); - let target = env::var("TARGET").unwrap(); - let host = env::var("HOST").unwrap(); - if target.contains("windows") && host != target { - assert_eq!( - host, "x86_64-pc-windows-msvc", - "Only cross-compiling from x64 is supported" - ); - assert_eq!( - target, "i686-pc-windows-msvc", - "Only cross-compiling to x86 is supported" - ); - assert!(env::var("VSINSTALLDIR").is_err()); - // When cross-compiling on Windows, we need to ensure that the PATH is - // set up appropriately for the target before invoking make. - if env::var("VCVARSALL_PATH").is_err() { - panic!( - "Need to provide VCVARSALL_PATH value with path to \ - vcvarsall.bat from Visual Studio installation" - ); - } - - let vcvars = Command::new("vcvars.bat").output().unwrap(); - assert!(vcvars.status.success()); - let output = str::from_utf8(&vcvars.stdout).unwrap(); - for line in output.lines() { - let mut parts = line.splitn(2, '='); - if let Some(name) = parts.next() { - if let Some(value) = parts.next() { - env::set_var(name, value); - } - } - } - } - // This must use the Ninja generator -- it's the only one that // parallelizes cmake's output properly. (Cmake generates // separate makefiles, each of which try to build @@ -61,19 +26,6 @@ fn main() { // We must use Ninja on Windows for this -- msbuild is painfully slow, // and ninja is easier to install than make. build.generator("Ninja"); - // We have to explicitly specify the full path to link.exe, - // for reasons that I don't understand. If we just give - // link.exe, it tries to use script-*/out/link.exe, which of - // course does not exist. - let link = std::process::Command::new("where") - .arg("link.exe") - .output() - .unwrap(); - let link_path: Vec<&str> = std::str::from_utf8(&link.stdout) - .unwrap() - .split("\r\n") - .collect(); - build.define("CMAKE_LINKER", link_path[0]); } build.build(); diff --git a/components/script/vcvars.bat b/components/script/vcvars.bat deleted file mode 100644 index 205599fd33c..00000000000 --- a/components/script/vcvars.bat +++ /dev/null @@ -1,2 +0,0 @@ -call "%VCVARSALL_PATH%\vcvarsall.bat" x64_x86 -set diff --git a/tests/wpt/metadata/FileAPI/url/url-with-fetch.any.js.ini b/tests/wpt/metadata/FileAPI/url/url-with-fetch.any.js.ini index 3a3d15b8406..947e223fb28 100644 --- a/tests/wpt/metadata/FileAPI/url/url-with-fetch.any.js.ini +++ b/tests/wpt/metadata/FileAPI/url/url-with-fetch.any.js.ini @@ -14,9 +14,6 @@ [Revoke blob URL after creating Request, will fetch] expected: FAIL - [Revoke blob URL after calling fetch, fetch should succeed] - expected: FAIL - [url-with-fetch.any.html] [Untitled] @@ -37,6 +34,3 @@ [Revoke blob URL after creating Request, will fetch] expected: FAIL - [Revoke blob URL after calling fetch, fetch should succeed] - expected: FAIL - diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index c5acdb9ee11..116c88f2ca7 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -130021,6 +130021,30 @@ {} ] ], + "css/css-multicol/columnfill-auto-max-height-001.html": [ + [ + "css/css-multicol/columnfill-auto-max-height-001.html", + [ + [ + "/css/reference/ref-filled-green-100px-square.xht", + "==" + ] + ], + {} + ] + ], + "css/css-multicol/columnfill-auto-max-height-002.html": [ + [ + "css/css-multicol/columnfill-auto-max-height-002.html", + [ + [ + "/css/reference/ref-filled-green-100px-square.xht", + "==" + ] + ], + {} + ] + ], "css/css-multicol/float-and-block.html": [ [ "css/css-multicol/float-and-block.html", @@ -294514,6 +294538,11 @@ {} ] ], + "docs/running-tests/command-line-arguments.md": [ + [ + {} + ] + ], "docs/running-tests/custom-runner.md": [ [ {} @@ -344689,26 +344718,344 @@ {} ] ], - "IndexedDB/nested-cloning-large-multiple.html": [ + "IndexedDB/nested-cloning-large-multiple.any.js": [ [ - "IndexedDB/nested-cloning-large-multiple.html", + "IndexedDB/nested-cloning-large-multiple.any.html", { + "script_metadata": [ + [ + "title", + "IndexedDB: large nested objects are cloned correctly" + ], + [ + "timeout", + "long" + ], + [ + "script", + "support-promises.js" + ], + [ + "script", + "nested-cloning-common.js" + ], + [ + "global", + "window,dedicatedworker,sharedworker,serviceworker" + ] + ], + "timeout": "long" + } + ], + [ + "IndexedDB/nested-cloning-large-multiple.any.serviceworker.html", + { + "script_metadata": [ + [ + "title", + "IndexedDB: large nested objects are cloned correctly" + ], + [ + "timeout", + "long" + ], + [ + "script", + "support-promises.js" + ], + [ + "script", + "nested-cloning-common.js" + ], + [ + "global", + "window,dedicatedworker,sharedworker,serviceworker" + ] + ], + "timeout": "long" + } + ], + [ + "IndexedDB/nested-cloning-large-multiple.any.sharedworker.html", + { + "script_metadata": [ + [ + "title", + "IndexedDB: large nested objects are cloned correctly" + ], + [ + "timeout", + "long" + ], + [ + "script", + "support-promises.js" + ], + [ + "script", + "nested-cloning-common.js" + ], + [ + "global", + "window,dedicatedworker,sharedworker,serviceworker" + ] + ], + "timeout": "long" + } + ], + [ + "IndexedDB/nested-cloning-large-multiple.any.worker.html", + { + "script_metadata": [ + [ + "title", + "IndexedDB: large nested objects are cloned correctly" + ], + [ + "timeout", + "long" + ], + [ + "script", + "support-promises.js" + ], + [ + "script", + "nested-cloning-common.js" + ], + [ + "global", + "window,dedicatedworker,sharedworker,serviceworker" + ] + ], "timeout": "long" } ] ], - "IndexedDB/nested-cloning-large.html": [ + "IndexedDB/nested-cloning-large.any.js": [ + [ + "IndexedDB/nested-cloning-large.any.html", + { + "script_metadata": [ + [ + "title", + "IndexedDB: large nested objects are cloned correctly" + ], + [ + "timeout", + "long" + ], + [ + "script", + "support-promises.js" + ], + [ + "script", + "nested-cloning-common.js" + ], + [ + "global", + "window,dedicatedworker,sharedworker,serviceworker" + ] + ], + "timeout": "long" + } + ], [ - "IndexedDB/nested-cloning-large.html", + "IndexedDB/nested-cloning-large.any.serviceworker.html", { + "script_metadata": [ + [ + "title", + "IndexedDB: large nested objects are cloned correctly" + ], + [ + "timeout", + "long" + ], + [ + "script", + "support-promises.js" + ], + [ + "script", + "nested-cloning-common.js" + ], + [ + "global", + "window,dedicatedworker,sharedworker,serviceworker" + ] + ], + "timeout": "long" + } + ], + [ + "IndexedDB/nested-cloning-large.any.sharedworker.html", + { + "script_metadata": [ + [ + "title", + "IndexedDB: large nested objects are cloned correctly" + ], + [ + "timeout", + "long" + ], + [ + "script", + "support-promises.js" + ], + [ + "script", + "nested-cloning-common.js" + ], + [ + "global", + "window,dedicatedworker,sharedworker,serviceworker" + ] + ], + "timeout": "long" + } + ], + [ + "IndexedDB/nested-cloning-large.any.worker.html", + { + "script_metadata": [ + [ + "title", + "IndexedDB: large nested objects are cloned correctly" + ], + [ + "timeout", + "long" + ], + [ + "script", + "support-promises.js" + ], + [ + "script", + "nested-cloning-common.js" + ], + [ + "global", + "window,dedicatedworker,sharedworker,serviceworker" + ] + ], "timeout": "long" } ] ], - "IndexedDB/nested-cloning-small.html": [ + "IndexedDB/nested-cloning-small.any.js": [ + [ + "IndexedDB/nested-cloning-small.any.html", + { + "script_metadata": [ + [ + "title", + "IndexedDB: small nested objects are cloned correctly" + ], + [ + "timeout", + "long" + ], + [ + "script", + "support-promises.js" + ], + [ + "script", + "nested-cloning-common.js" + ], + [ + "global", + "window,dedicatedworker,sharedworker,serviceworker" + ] + ], + "timeout": "long" + } + ], + [ + "IndexedDB/nested-cloning-small.any.serviceworker.html", + { + "script_metadata": [ + [ + "title", + "IndexedDB: small nested objects are cloned correctly" + ], + [ + "timeout", + "long" + ], + [ + "script", + "support-promises.js" + ], + [ + "script", + "nested-cloning-common.js" + ], + [ + "global", + "window,dedicatedworker,sharedworker,serviceworker" + ] + ], + "timeout": "long" + } + ], + [ + "IndexedDB/nested-cloning-small.any.sharedworker.html", + { + "script_metadata": [ + [ + "title", + "IndexedDB: small nested objects are cloned correctly" + ], + [ + "timeout", + "long" + ], + [ + "script", + "support-promises.js" + ], + [ + "script", + "nested-cloning-common.js" + ], + [ + "global", + "window,dedicatedworker,sharedworker,serviceworker" + ] + ], + "timeout": "long" + } + ], [ - "IndexedDB/nested-cloning-small.html", + "IndexedDB/nested-cloning-small.any.worker.html", { + "script_metadata": [ + [ + "title", + "IndexedDB: small nested objects are cloned correctly" + ], + [ + "timeout", + "long" + ], + [ + "script", + "support-promises.js" + ], + [ + "script", + "nested-cloning-common.js" + ], + [ + "global", + "window,dedicatedworker,sharedworker,serviceworker" + ] + ], "timeout": "long" } ] @@ -445207,16 +445554,28 @@ {} ] ], - "wake-lock/wakelock-insecure-context.html": [ + "wake-lock/wakelock-insecure-context.any.js": [ [ - "wake-lock/wakelock-insecure-context.html", - {} - ] - ], - "wake-lock/wakelock-state-is-global.https.html": [ + "wake-lock/wakelock-insecure-context.any.html", + { + "script_metadata": [ + [ + "title", + "Wake Lock API is not exposed in an insecure context" + ] + ] + } + ], [ - "wake-lock/wakelock-state-is-global.https.html", - {} + "wake-lock/wakelock-insecure-context.any.worker.html", + { + "script_metadata": [ + [ + "title", + "Wake Lock API is not exposed in an insecure context" + ] + ] + } ] ], "wake-lock/wakelock-supported-by-feature-policy.html": [ @@ -445225,10 +445584,28 @@ {} ] ], - "wake-lock/wakelock-type.https.html": [ + "wake-lock/wakelock-type.https.any.js": [ [ - "wake-lock/wakelock-type.https.html", - {} + "wake-lock/wakelock-type.https.any.html", + { + "script_metadata": [ + [ + "title", + "WakeLock.request() with invaild type" + ] + ] + } + ], + [ + "wake-lock/wakelock-type.https.any.worker.html", + { + "script_metadata": [ + [ + "title", + "WakeLock.request() with invaild type" + ] + ] + } ] ], "wasm/create_multiple_memory.worker.js": [ @@ -488104,16 +488481,16 @@ "db5f710ceb5652ed8b9746f883948fac41262d6b", "support" ], - "IndexedDB/nested-cloning-large-multiple.html": [ - "f263efbcf6d8f1601e623690ba0de799edce406b", + "IndexedDB/nested-cloning-large-multiple.any.js": [ + "d64df916d801b106759fb0ca2e6547d5686fac8d", "testharness" ], - "IndexedDB/nested-cloning-large.html": [ - "6e4f9be2ee6ce57605ad0248f37f794f6d8a70a2", + "IndexedDB/nested-cloning-large.any.js": [ + "cadfeb04599d2c946037a8a726ea37357fb41172", "testharness" ], - "IndexedDB/nested-cloning-small.html": [ - "558415f2342038eb079b4267fdcb0b133fbb9da8", + "IndexedDB/nested-cloning-small.any.js": [ + "864752827a9afd1932f1e0978e1cff825af42fb4", "testharness" ], "IndexedDB/objectstore_keyorder.htm": [ @@ -601820,6 +602197,14 @@ "2949a1996ebae0c48329906ea7ef34c83080e90f", "reftest" ], + "css/css-multicol/columnfill-auto-max-height-001.html": [ + "6d8877e7632bed4f989c233ed38d40a00111be32", + "reftest" + ], + "css/css-multicol/columnfill-auto-max-height-002.html": [ + "7d156b2d0cfde3f1fd1c25a48616e778c3135c74", + "reftest" + ], "css/css-multicol/extremely-tall-multicol-with-extremely-tall-child-crash.html": [ "6e40afe54c9ce9aa50765f778d74640454dcc1ce", "testharness" @@ -642433,11 +642818,11 @@ "reftest" ], "css/vendor-imports/mozilla/mozilla-central-reftests/contain/contain-layout-suppress-baseline-002-ref.html": [ - "d4095fd987b83596f4884b77e87a759d506bda9b", + "0587c90c35e20733c9489982c161214be0444cbf", "support" ], "css/vendor-imports/mozilla/mozilla-central-reftests/contain/contain-layout-suppress-baseline-002.html": [ - "845290768acbe5b3bd81d4c78e4a4cf61fecc906", + "a370386edeea604609831bfdf1df7757d370f747", "reftest" ], "css/vendor-imports/mozilla/mozilla-central-reftests/contain/contain-paint-clip-001-ref.html": [ @@ -642717,7 +643102,7 @@ "reftest" ], "css/vendor-imports/mozilla/mozilla-central-reftests/contain/reftest.list": [ - "eaf31a7dc12937847b0d850dadb3ad0ee6cadcc4", + "9a70ca1e9ae609f583a9837916718392e799571c", "support" ], "css/vendor-imports/mozilla/mozilla-central-reftests/counter-styles-3/dependent-builtin-ref.html": [ @@ -650957,7 +651342,7 @@ "support" ], "docs/conf.py": [ - "c295c3d9e7fc812fe99b31c29ed4e232713801f0", + "b3bce7971129bc2b4f62a86f4798ec69c49d7cc8", "support" ], "docs/index.rst": [ @@ -650973,7 +651358,7 @@ "support" ], "docs/requirements.txt": [ - "d888313b041f49a5c17124bfa18471ff882c1326", + "dceaed13bc3f2a724f2ff204ea0824df80977193", "support" ], "docs/reviewing-tests/checklist.md": [ @@ -650996,12 +651381,16 @@ "5851cd5572264cb06066b9c8d6721bd1fe995a0a", "support" ], + "docs/running-tests/command-line-arguments.md": [ + "598c9da2a10514062ee3ea06d5c5335677763e32", + "support" + ], "docs/running-tests/custom-runner.md": [ "4e860edbb21193a82d7333541eb55ada124c82f1", "support" ], "docs/running-tests/from-local-system.md": [ - "3cc4d9735ff1223d263a5b2bf6f72b9a2fa8c3eb", + "695f8403da4a8a52eddb25492ac89edd7c33e6e7", "support" ], "docs/running-tests/from-web.md": [ @@ -651297,7 +651686,7 @@ "testharness" ], "dom/events/EventListener-handleEvent.html": [ - "6630f273fff4b450d1fcc425828b5f1f53357e54", + "1eb80ccb15f0bc6fda7d04d4fc01555ea6b8ab04", "testharness" ], "dom/events/EventListener-incumbent-global-1.sub.html": [ @@ -652693,7 +653082,7 @@ "testharness" ], "dom/traversal/TreeWalker-acceptNode-filter.html": [ - "1446f40f68dd25f13b97bdce2a425cd9f36104d1", + "e2110aff3b3dec517f70866f908de2f919c089a4", "testharness" ], "dom/traversal/TreeWalker-basic.html": [ @@ -674513,7 +674902,7 @@ "support" ], "html/semantics/rellist-feature-detection.html": [ - "d290439d8ee647b2f8d95ddc45ac390dccde9843", + "45debcc49a487d43437b04e6e8a429f7db321db1", "testharness" ], "html/semantics/scripting-1/META.yml": [ @@ -680269,7 +680658,7 @@ "support" ], "interfaces/html.idl": [ - "f44f5da96ff6e400cd51a404e3f06ae558d4cff4", + "5ae46f742922f4c455380745f124769399086eb9", "support" ], "interfaces/image-capture.idl": [ @@ -680573,7 +680962,7 @@ "support" ], "interfaces/webxr.idl": [ - "2d1bd9fe5f5702d69051fe00b2f958a9a3a4b82c", + "63327a3f55d79f1acdc2cbd53a98b0a089aade2d", "support" ], "interfaces/worklets.idl": [ @@ -694101,7 +694490,7 @@ "testharness" ], "preload/download-resources.html": [ - "510ebb480457e9e1b0d6ea788a8bd36c825bc634", + "557c9656b1813c52e373ee70e565a44e966389bf", "testharness" ], "preload/dynamic-adding-preload-imagesrcset.html": [ @@ -694121,7 +694510,7 @@ "testharness" ], "preload/link-header-on-subresource.html": [ - "087a3429e649348d2b35fd92bf03ebc6307c72dc", + "7047115a1caf4989ea5e80e80db35bc2dcdf2a6b", "testharness" ], "preload/link-header-preload-delay-onload.html": [ @@ -694161,7 +694550,7 @@ "testharness" ], "preload/onerror-event.html": [ - "8190be87a4b7caf69ba07d07d239ff8143be3b05", + "2038e06e941cf7b146fcb744c6c5a2ded3072abc", "testharness" ], "preload/onload-event.html": [ @@ -694169,11 +694558,11 @@ "testharness" ], "preload/preload-csp.sub.html": [ - "65e9b3a2a6d350598e88cd2c8a7e4fa8d10d7533", + "62d0c71039b7c06a4299ac71e055ff3786de5c41", "testharness" ], "preload/preload-default-csp.sub.html": [ - "923431456cf7e01d66556fda7241be0e660dacc0", + "9fc11945866834c70c9ad270fb11d37a443ac3d0", "testharness" ], "preload/preload-strict-dynamic.html": [ @@ -719977,7 +720366,7 @@ "support" ], "tools/wpt/wpt.py": [ - "909d435b6485f7e78c996ef02960160b53a0851c", + "4130e1eecf8ae52dbc0b68f6cd59010dd4e435e4", "support" ], "tools/wptrunner/.gitignore": [ @@ -723072,20 +723461,16 @@ "6f05d23550e2b0c967fac5b436a5e3336222ffe2", "support" ], - "wake-lock/wakelock-insecure-context.html": [ - "2c61f41311db3f9edf0502ea752ca27970eed3fb", - "testharness" - ], - "wake-lock/wakelock-state-is-global.https.html": [ - "2eee31982498caab44b5160237c7ce7f8ce9a569", + "wake-lock/wakelock-insecure-context.any.js": [ + "f32cc3c354354f99852bb198760cdbd9229355a4", "testharness" ], "wake-lock/wakelock-supported-by-feature-policy.html": [ "d6289fff43c8717ac6e9ace59713e6fd70bd249d", "testharness" ], - "wake-lock/wakelock-type.https.html": [ - "df7a68a040bef273efcd2584dfe3612adc05d85b", + "wake-lock/wakelock-type.https.any.js": [ + "26ebcbef557014fe5b5b7d4f4f145ac5f0305a02", "testharness" ], "wasm/META.yml": [ diff --git a/tests/wpt/metadata/css/cssom-view/matchMedia-display-none-iframe.html.ini b/tests/wpt/metadata/css/cssom-view/matchMedia-display-none-iframe.html.ini new file mode 100644 index 00000000000..e6e1f29e274 --- /dev/null +++ b/tests/wpt/metadata/css/cssom-view/matchMedia-display-none-iframe.html.ini @@ -0,0 +1,2 @@ +[matchMedia-display-none-iframe.html] + expected: ERROR diff --git a/tests/wpt/metadata/dom/events/EventListener-handleEvent.html.ini b/tests/wpt/metadata/dom/events/EventListener-handleEvent.html.ini index 9815c2a274c..72f7b4b3565 100644 --- a/tests/wpt/metadata/dom/events/EventListener-handleEvent.html.ini +++ b/tests/wpt/metadata/dom/events/EventListener-handleEvent.html.ini @@ -8,3 +8,9 @@ [calls `handleEvent` method of `EventListener`] expected: FAIL + [throws if `handleEvent` is falsy and not callable] + expected: FAIL + + [throws if `handleEvent` is thruthy and not callable] + expected: FAIL + diff --git a/tests/wpt/metadata/fetch/content-type/response.window.js.ini b/tests/wpt/metadata/fetch/content-type/response.window.js.ini index 8ee00ab8dc0..ed72b0bad35 100644 --- a/tests/wpt/metadata/fetch/content-type/response.window.js.ini +++ b/tests/wpt/metadata/fetch/content-type/response.window.js.ini @@ -312,25 +312,19 @@ [<iframe>: separate response Content-Type: text/plain */*;charset=gbk] expected: FAIL - [<iframe>: combined response Content-Type: text/html;" \\" text/plain] + [<iframe>: separate response Content-Type: text/html;charset=gbk text/plain text/html] expected: FAIL - [<iframe>: separate response Content-Type: text/html */*] - expected: FAIL - - [<iframe>: combined response Content-Type: text/html;" text/plain] + [<iframe>: separate response Content-Type: */* text/html] expected: FAIL - [<iframe>: combined response Content-Type: */* text/html] + [<iframe>: separate response Content-Type: text/html;x=" text/plain] expected: FAIL - [<iframe>: combined response Content-Type: text/html;charset=gbk text/plain text/html] + [<iframe>: separate response Content-Type: text/html;" \\" text/plain] expected: FAIL - [<iframe>: combined response Content-Type: text/html */*] - expected: FAIL - - [<iframe>: combined response Content-Type: text/html */*;charset=gbk] + [<iframe>: separate response Content-Type: text/html */*] expected: FAIL [<iframe>: combined response Content-Type: text/html;x=" text/plain] diff --git a/tests/wpt/metadata/fetch/nosniff/parsing-nosniff.window.js.ini b/tests/wpt/metadata/fetch/nosniff/parsing-nosniff.window.js.ini index a639f15230c..ce73518c20a 100644 --- a/tests/wpt/metadata/fetch/nosniff/parsing-nosniff.window.js.ini +++ b/tests/wpt/metadata/fetch/nosniff/parsing-nosniff.window.js.ini @@ -11,6 +11,9 @@ [X-Content-Type-Options%3A%20nosniff%0C] expected: FAIL - [Content-Type-Options%3A%20nosniff] + [X-Content-Type-Options%3A%20'NosniFF'] + expected: FAIL + + [X-Content-Type-Options%3A%20%2Cnosniff] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_2.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_2.html.ini new file mode 100644 index 00000000000..75d75b4cda2 --- /dev/null +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_2.html.ini @@ -0,0 +1,4 @@ +[traverse_the_history_2.html] + [Multiple history traversals, last would be aborted] + expected: FAIL + diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_4.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_4.html.ini new file mode 100644 index 00000000000..385376c7321 --- /dev/null +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_4.html.ini @@ -0,0 +1,4 @@ +[traverse_the_history_4.html] + [Multiple history traversals, last would be aborted] + expected: FAIL + diff --git a/tests/wpt/metadata/html/dom/interfaces.https.html.ini b/tests/wpt/metadata/html/dom/interfaces.https.html.ini index d048aad6f1b..4606098c2b5 100644 --- a/tests/wpt/metadata/html/dom/interfaces.https.html.ini +++ b/tests/wpt/metadata/html/dom/interfaces.https.html.ini @@ -6765,9 +6765,6 @@ [HTMLMediaElement interface: document.createElement("video") must inherit property "seekable" with the proper type] expected: FAIL - [HTMLMediaElement interface: document.createElement("video") must inherit property "loop" with the proper type] - expected: PASS - [HTMLMediaElement interface: document.createElement("video") must inherit property "controls" with the proper type] expected: FAIL @@ -6780,9 +6777,6 @@ [HTMLMediaElement interface: document.createElement("audio") must inherit property "seekable" with the proper type] expected: FAIL - [HTMLMediaElement interface: document.createElement("audio") must inherit property "loop" with the proper type] - expected: PASS - [HTMLMediaElement interface: document.createElement("audio") must inherit property "controls" with the proper type] expected: FAIL @@ -6795,9 +6789,6 @@ [HTMLMediaElement interface: new Audio() must inherit property "seekable" with the proper type] expected: FAIL - [HTMLMediaElement interface: new Audio() must inherit property "loop" with the proper type] - expected: PASS - [HTMLMediaElement interface: new Audio() must inherit property "controls" with the proper type] expected: FAIL @@ -6807,9 +6798,6 @@ [HTMLMediaElement interface: attribute seekable] expected: FAIL - [HTMLMediaElement interface: attribute loop] - expected: PASS - [HTMLMediaElement interface: operation play()] expected: FAIL @@ -9363,6 +9351,15 @@ [HTMLLinkElement interface: attribute imageSrcset] expected: FAIL + [HTMLFormElement interface: document.createElement("form") must inherit property "requestSubmit(HTMLElement)" with the proper type] + expected: FAIL + + [HTMLFormElement interface: operation requestSubmit(HTMLElement)] + expected: FAIL + + [HTMLFormElement interface: calling requestSubmit(HTMLElement) on document.createElement("form") with too few arguments must throw TypeError] + expected: FAIL + [interfaces.https.html?exclude=(Document|Window|HTML.*)] [HTML IDL tests] @@ -10817,3 +10814,30 @@ [ElementInternals interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [ElementInternals interface: operation setValidity(ValidityStateFlags, DOMString, HTMLElement)] + expected: FAIL + + [ElementInternals interface: operation setFormValue([object Object\],[object Object\],[object Object\], [object Object\],[object Object\],[object Object\])] + expected: FAIL + + [ElementInternals interface: operation reportValidity()] + expected: FAIL + + [ElementInternals interface: operation checkValidity()] + expected: FAIL + + [ElementInternals interface: attribute labels] + expected: FAIL + + [ElementInternals interface: attribute form] + expected: FAIL + + [ElementInternals interface: attribute willValidate] + expected: FAIL + + [ElementInternals interface: attribute validationMessage] + expected: FAIL + + [ElementInternals interface: attribute validity] + expected: FAIL + diff --git a/tests/wpt/metadata/html/dom/interfaces.worker.js.ini b/tests/wpt/metadata/html/dom/interfaces.worker.js.ini index 6144c27c83d..2301241aec5 100644 --- a/tests/wpt/metadata/html/dom/interfaces.worker.js.ini +++ b/tests/wpt/metadata/html/dom/interfaces.worker.js.ini @@ -834,3 +834,27 @@ [TextMetrics interface object name] expected: FAIL + [ImageBitmapRenderingContext interface: operation transferFromImageBitmap(ImageBitmap)] + expected: FAIL + + [ImageBitmapRenderingContext interface: existence and properties of interface object] + expected: FAIL + + [ImageBitmapRenderingContext interface: existence and properties of interface prototype object] + expected: FAIL + + [ImageBitmapRenderingContext interface: attribute canvas] + expected: FAIL + + [ImageBitmapRenderingContext interface: existence and properties of interface prototype object's "constructor" property] + expected: FAIL + + [ImageBitmapRenderingContext interface object name] + expected: FAIL + + [ImageBitmapRenderingContext interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + + [ImageBitmapRenderingContext interface object length] + expected: FAIL + diff --git a/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/non-active-document.html.ini b/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/non-active-document.html.ini deleted file mode 100644 index 8cc42056d34..00000000000 --- a/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/non-active-document.html.ini +++ /dev/null @@ -1,10 +0,0 @@ -[non-active-document.html] - [DOMParser] - expected: FAIL - - [createHTMLDocument] - expected: FAIL - - [<template>] - expected: FAIL - diff --git a/tests/wpt/metadata/html/semantics/rellist-feature-detection.html.ini b/tests/wpt/metadata/html/semantics/rellist-feature-detection.html.ini index d2762c55d7b..d64c90f3857 100644 --- a/tests/wpt/metadata/html/semantics/rellist-feature-detection.html.ini +++ b/tests/wpt/metadata/html/semantics/rellist-feature-detection.html.ini @@ -2,3 +2,15 @@ [Make sure that relList based feature detection is working] expected: FAIL + [Make sure that relList based feature detection is working for <a>] + expected: FAIL + + [Make sure that relList based feature detection is working for <form>] + expected: FAIL + + [Make sure that relList based feature detection is working for <area>] + expected: FAIL + + [Make sure that relList based feature detection is working for <link>] + expected: FAIL + diff --git a/tests/wpt/mozilla/meta/css/transition_calc_implicit.html.ini b/tests/wpt/mozilla/meta/css/transition_calc_implicit.html.ini new file mode 100644 index 00000000000..dbea4f293ad --- /dev/null +++ b/tests/wpt/mozilla/meta/css/transition_calc_implicit.html.ini @@ -0,0 +1,2 @@ +[transition_calc_implicit.html] + expected: TIMEOUT diff --git a/tests/wpt/mozilla/meta/mozilla/paint_timing.html.ini b/tests/wpt/mozilla/meta/mozilla/paint_timing.html.ini new file mode 100644 index 00000000000..14a9e778f39 --- /dev/null +++ b/tests/wpt/mozilla/meta/mozilla/paint_timing.html.ini @@ -0,0 +1,4 @@ +[paint_timing.html] + [Performance entries observer] + expected: FAIL + diff --git a/tests/wpt/web-platform-tests/IndexedDB/nested-cloning-large-multiple.html b/tests/wpt/web-platform-tests/IndexedDB/nested-cloning-large-multiple.any.js index f263efbcf6d..d64df916d80 100644 --- a/tests/wpt/web-platform-tests/IndexedDB/nested-cloning-large-multiple.html +++ b/tests/wpt/web-platform-tests/IndexedDB/nested-cloning-large-multiple.any.js @@ -1,14 +1,9 @@ -<!doctype html> -<meta charset="utf8"> -<meta name="timeout" content="long"> -<title>IndexedDB: large nested objects are cloned correctly</title> -<link rel="help" href="https://w3c.github.io/IndexedDB/#abort-transaction"> -<link rel="author" href="pwnall@chromium.org" title="Victor Costan"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="support-promises.js"></script> -<script src="nested-cloning-common.js"></script> -<script> +// META: title=IndexedDB: large nested objects are cloned correctly +// META: timeout=long +// META: script=support-promises.js +// META: script=nested-cloning-common.js +// META: global=window,dedicatedworker,sharedworker,serviceworker +'use strict'; cloningTestWithKeyGenerator( 'multiple requests of objects with blobs and large typed arrays', [ @@ -50,5 +45,3 @@ cloningTestWithKeyGenerator( { type: 'blob', size: wrapThreshold, mimeType: 'text/x-blink20', seed: 20 }, ], ]); - -</script> diff --git a/tests/wpt/web-platform-tests/IndexedDB/nested-cloning-large.html b/tests/wpt/web-platform-tests/IndexedDB/nested-cloning-large.any.js index 6e4f9be2ee6..cadfeb04599 100644 --- a/tests/wpt/web-platform-tests/IndexedDB/nested-cloning-large.html +++ b/tests/wpt/web-platform-tests/IndexedDB/nested-cloning-large.any.js @@ -1,14 +1,9 @@ -<!doctype html> -<meta charset="utf8"> -<meta name="timeout" content="long"> -<title>IndexedDB: large nested objects are cloned correctly</title> -<link rel="help" href="https://w3c.github.io/IndexedDB/#abort-transaction"> -<link rel="author" href="pwnall@chromium.org" title="Victor Costan"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="support-promises.js"></script> -<script src="nested-cloning-common.js"></script> -<script> +// META: title=IndexedDB: large nested objects are cloned correctly +// META: timeout=long +// META: script=support-promises.js +// META: script=nested-cloning-common.js +// META: global=window,dedicatedworker,sharedworker,serviceworker +'use strict'; cloningTest('large typed array', [ { type: 'buffer', size: wrapThreshold, seed: 1 }, @@ -45,5 +40,3 @@ cloningTestWithKeyGenerator('object with blobs and large typed arrays', [ seed: 5 }, }, ]); - -</script> diff --git a/tests/wpt/web-platform-tests/IndexedDB/nested-cloning-small.html b/tests/wpt/web-platform-tests/IndexedDB/nested-cloning-small.any.js index 558415f2342..864752827a9 100644 --- a/tests/wpt/web-platform-tests/IndexedDB/nested-cloning-small.html +++ b/tests/wpt/web-platform-tests/IndexedDB/nested-cloning-small.any.js @@ -1,14 +1,9 @@ -<!doctype html> -<meta charset="utf8"> -<meta name="timeout" content="long"> -<title>IndexedDB: small nested objects are cloned correctly</title> -<link rel="help" href="https://w3c.github.io/IndexedDB/#abort-transaction"> -<link rel="author" href="pwnall@chromium.org" title="Victor Costan"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="support-promises.js"></script> -<script src="nested-cloning-common.js"></script> -<script> +// META: title=IndexedDB: small nested objects are cloned correctly +// META: timeout=long +// META: script=support-promises.js +// META: script=nested-cloning-common.js +// META: global=window,dedicatedworker,sharedworker,serviceworker +'use strict'; cloningTest('small typed array', [ { type: 'buffer', size: 64, seed: 1 }, @@ -42,6 +37,4 @@ cloningTestWithKeyGenerator('array of blobs and small typed arrays', [ { type: 'buffer', size: 64, seed: 4 }, { type: 'blob', size: wrapThreshold, mimeType: 'text/x-blink-05', seed: 5 }, ], -]); - -</script> +]);
\ No newline at end of file diff --git a/tests/wpt/web-platform-tests/css/css-multicol/columnfill-auto-max-height-001.html b/tests/wpt/web-platform-tests/css/css-multicol/columnfill-auto-max-height-001.html new file mode 100644 index 00000000000..6d8877e7632 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-multicol/columnfill-auto-max-height-001.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> + + <meta charset="UTF-8"> + + <title>CSS Multi-column Layout Test: 'column-fill: auto' and height constrained of a multi-column container</title> + + <!-- + + See also + + Bug 1348839: 'column-fill: auto' does not fill as expected, content ends up in one column + https://bugzilla.mozilla.org/show_bug.cgi?id=1348839 + + --> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> + <link rel="help" href="https://www.w3.org/TR/css-multicol-1/#cf" title="7.1 column-fill"> + <link rel="match" href="../reference/ref-filled-green-100px-square.xht"> + + <meta name="flags" content=""> + <meta content="This test verifies how content is distributed among columns when the height of a multi-column container is constrained and when 'column-fill' is set to 'auto'. In this test, the line box height is exactly 25px. So, content should fill 4 lines of the first column and should only fill up the first column. Since column rules are only drawn between two columns that both have content and since the test expects only 1 column filled with content, therefore the column rule should not be painted, thus the 'no red' test success condition." name="assert"> + + <style> + div + { + color: green; + column-count: 2; + column-fill: auto; /* fill columns sequentially */ + column-gap: 4em; /* computes to 100px */ + column-rule: red solid 4em; + font-family: Ahem; + /* + To download Ahem font: + http://www.w3.org/Style/CSS/Test/Fonts/Ahem/ + */ + font-size: 25px; + line-height: 1; + max-height: 100px; + width: 300px; + } + </style> + + <p>Test passes if there is a filled green square and <strong>no red</strong>. + + <div>Abcd efgh ijkl mno.</div> diff --git a/tests/wpt/web-platform-tests/css/css-multicol/columnfill-auto-max-height-002.html b/tests/wpt/web-platform-tests/css/css-multicol/columnfill-auto-max-height-002.html new file mode 100644 index 00000000000..7d156b2d0cf --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-multicol/columnfill-auto-max-height-002.html @@ -0,0 +1,59 @@ +<!DOCTYPE html> + + <meta charset="UTF-8"> + + <title>CSS Multi-column Layout Test: 'column-fill: auto' and height constrained of a multi-column container</title> + + <!-- + + See also + + Bug 1348839: 'column-fill: auto' does not fill as expected, content ends up in one column + https://bugzilla.mozilla.org/show_bug.cgi?id=1348839 + + --> + + <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> + <link rel="help" href="https://www.w3.org/TR/css-multicol-1/#cf" title="7.1 column-fill"> + <link rel="match" href="../reference/ref-filled-green-100px-square.xht"> + + <meta name="flags" content=""> + <meta content="This test verifies how content is distributed among columns when the height of a multi-column container is constrained and when 'column-fill' is set to 'auto'. In this test, the line box height is exactly 25px. So, content should fill 4 lines of the first column and should only fill up the first column. Since column rules are only drawn between two columns that both have content and since the test expects only 1 column filled with content, therefore the column rule should not be painted, thus the 'no red' test success condition." name="assert"> + + <style> + div + { + color: green; + column-count: 4; + column-fill: auto; /* fill columns sequentially */ + column-gap: 4em; /* computes to 100px */ + column-rule: red solid 4em; + font-family: Ahem; + /* + To download Ahem font: + http://www.w3.org/Style/CSS/Test/Fonts/Ahem/ + */ + font-size: 25px; + line-height: 1; + max-height: 100px; + orphans: 1; + /* + In this test, the orphans property specifies the + minimum number of line boxes that must be left + in a column box before a column break, that must + be left at the bottom of a column box. + */ + widows: 1; + /* + In this test, the widows property specifies the + minimum number of line boxes that must be left + in a column box after a column break, that must + be left at the top of a column box. + */ + width: 700px; + } + </style> + + <p>Test passes if there is a filled green square and <strong>no red</strong>. + + <div>Abcd efgh ijkl mno.</div> diff --git a/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/contain/contain-layout-suppress-baseline-002-ref.html b/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/contain/contain-layout-suppress-baseline-002-ref.html index d4095fd987b..0587c90c35e 100644 --- a/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/contain/contain-layout-suppress-baseline-002-ref.html +++ b/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/contain/contain-layout-suppress-baseline-002-ref.html @@ -8,19 +8,18 @@ .flexBaselineCheck { display: flex; border: 1px solid black; - height: 70px; } .flexBaselineCheck > * { border: 2px solid teal; - /* In the testcase, the (baseline-aligned) items should all have their bottom borders aligned with the 50px-tall canvas. In other words, their - bottom borders should all be 20px away from the bottom of their flex - container. Here in the reference case, we just use "flex-end" alignment - plus a hardcoded 20px margin-bottom to produce a precise reference - for what that should look like. */ + bottom borders should all be aligned at the bottom of their flex + container, separated from the bottom by only by their margin-end + distance. Here in the reference case, we just use "flex-end" alignment + (plus the same amount of margin) to produce a precise reference for what + that should look like. */ align-self: flex-end; - margin-bottom: 20px; + margin: 2px; } canvas { background: purple; diff --git a/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/contain/contain-layout-suppress-baseline-002.html b/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/contain/contain-layout-suppress-baseline-002.html index 845290768ac..a370386edee 100644 --- a/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/contain/contain-layout-suppress-baseline-002.html +++ b/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/contain/contain-layout-suppress-baseline-002.html @@ -11,12 +11,12 @@ .flexBaselineCheck { display: flex; border: 1px solid black; - height: 70px; } .flexBaselineCheck > * { contain: layout; border: 2px solid teal; align-self: baseline; + margin: 2px; } canvas { background: purple; diff --git a/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/contain/reftest.list b/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/contain/reftest.list index eaf31a7dc12..9a70ca1e9ae 100644 --- a/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/contain/reftest.list +++ b/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/contain/reftest.list @@ -48,3 +48,10 @@ == contain-layout-ignored-cases-no-principal-box-003.html contain-layout-ignored-cases-no-principal-box-003-ref.html == contain-layout-suppress-baseline-001.html contain-layout-suppress-baseline-001-ref.html == contain-layout-suppress-baseline-002.html contain-layout-suppress-baseline-002-ref.html + +# The following lines are duplicates of other lines from further up in this +# manifest. They're listed again here so we can re-run these tests with +# column-span enabled. These lines can be removed once the pref becomes +# default-enabled (Bug 1426010). +== contain-size-multicol-002.html contain-size-multicol-002-ref.html +== contain-size-multicol-003.html contain-size-multicol-003-ref.html diff --git a/tests/wpt/web-platform-tests/docs/conf.py b/tests/wpt/web-platform-tests/docs/conf.py index c295c3d9e7f..b3bce797112 100644 --- a/tests/wpt/web-platform-tests/docs/conf.py +++ b/tests/wpt/web-platform-tests/docs/conf.py @@ -12,9 +12,12 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # -#import os -#import sys -#sys.path.insert(0, os.path.abspath('.')) +import os +import sys +sys.path.insert(0, os.path.abspath('..')) +sys.path.insert(0, os.path.abspath('../tools/wptserve')) +sys.path.insert(0, os.path.abspath('../tools')) +import localpaths # -- Project information ----------------------------------------------------- @@ -38,7 +41,8 @@ release = u'' # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'recommonmark' + 'recommonmark', + 'sphinxarg.ext' ] # Add any paths that contain templates here, relative to this directory. diff --git a/tests/wpt/web-platform-tests/docs/requirements.txt b/tests/wpt/web-platform-tests/docs/requirements.txt index d888313b041..dceaed13bc3 100644 --- a/tests/wpt/web-platform-tests/docs/requirements.txt +++ b/tests/wpt/web-platform-tests/docs/requirements.txt @@ -1,2 +1,3 @@ recommonmark==0.5.0 Sphinx==1.8.5 +sphinx-argparse==0.2.5 diff --git a/tests/wpt/web-platform-tests/docs/running-tests/command-line-arguments.md b/tests/wpt/web-platform-tests/docs/running-tests/command-line-arguments.md new file mode 100644 index 00000000000..598c9da2a10 --- /dev/null +++ b/tests/wpt/web-platform-tests/docs/running-tests/command-line-arguments.md @@ -0,0 +1,14 @@ +# Command-Line Arguments + +The `wpt` command-line application offers a number of features for interacting +with WPT. The functionality is organized into "sub-commands", and each accepts +a different set of command-line arguments. + +This page documents all of the available sub-commands and associated arguments. + +```eval_rst +.. argparse:: + :module: tools.wpt.wpt + :func: create_complete_parser + :prog: wpt +``` diff --git a/tests/wpt/web-platform-tests/docs/running-tests/from-local-system.md b/tests/wpt/web-platform-tests/docs/running-tests/from-local-system.md index 3cc4d9735ff..695f8403da4 100644 --- a/tests/wpt/web-platform-tests/docs/running-tests/from-local-system.md +++ b/tests/wpt/web-platform-tests/docs/running-tests/from-local-system.md @@ -97,6 +97,9 @@ customising the test run: ./wpt run --help +[A complete listing of the command-line arguments is available +here](command-line-arguments). + Additional browser-specific documentation: ```eval_rst diff --git a/tests/wpt/web-platform-tests/dom/events/EventListener-handleEvent.html b/tests/wpt/web-platform-tests/dom/events/EventListener-handleEvent.html index 6630f273fff..1eb80ccb15f 100644 --- a/tests/wpt/web-platform-tests/dom/events/EventListener-handleEvent.html +++ b/tests/wpt/web-platform-tests/dom/events/EventListener-handleEvent.html @@ -5,13 +5,12 @@ <script src="/resources/testharnessreport.js"></script> <link rel="help" href="https://dom.spec.whatwg.org/#callbackdef-eventlistener"> <div id=log></div> -<div id=target></div> <script> setup({ allow_uncaught_exception: true }); test(function(t) { var type = "foo"; - var target = document.getElementById("target"); + var target = document.createElement("div"); var eventListener = { handleEvent: function(evt) { var that = this; @@ -30,12 +29,16 @@ test(function(t) { test(function(t) { var type = "foo"; - var target = document.getElementById("target"); - var thrownError = new Error(); + var target = document.createElement("div"); + var thrownError = { name: "test" }; var uncaughtError; - - window.addEventListener("error", function(event) { + var errorHandler = function(event) { uncaughtError = event.error; + }; + + window.addEventListener("error", errorHandler); + t.add_cleanup(function() { + window.removeEventListener("error", errorHandler); }); target.addEventListener(type, { @@ -50,7 +53,7 @@ test(function(t) { test(function(t) { var type = "foo"; - var target = document.getElementById("target"); + var target = document.createElement("div"); var calls = 0; target.addEventListener(type, { @@ -68,11 +71,27 @@ test(function(t) { test(function(t) { var type = "foo"; - var target = document.getElementById("target"); - var uncaughtError; + var target = document.createElement("div"); + var calls = 0; + var eventListener = function() { calls++; }; + eventListener.handleEvent = t.unreached_func("`handleEvent` method should not be called on functions"); + + target.addEventListener(type, eventListener); + target.dispatchEvent(new Event(type)); + assert_equals(calls, 1); +}, "doesn't call `handleEvent` method on callable `EventListener`"); - window.addEventListener("error", function(event) { +test(function(t) { + var type = "foo"; + var target = document.createElement("div"); + var uncaughtError; + var errorHandler = function(event) { uncaughtError = event.error; + }; + + window.addEventListener("error", errorHandler); + t.add_cleanup(function() { + window.removeEventListener("error", errorHandler); }); target.addEventListener(type, { @@ -81,5 +100,26 @@ test(function(t) { target.dispatchEvent(new Event(type)); assert_true(uncaughtError instanceof TypeError); -}, "throws if `handleEvent` is not callable"); +}, "throws if `handleEvent` is falsy and not callable"); + +test(function(t) { + var type = "foo"; + var target = document.createElement("div"); + var uncaughtError; + var errorHandler = function(event) { + uncaughtError = event.error; + }; + + window.addEventListener("error", errorHandler); + t.add_cleanup(function() { + window.removeEventListener("error", errorHandler); + }); + + target.addEventListener(type, { + handleEvent: 1, + }); + + target.dispatchEvent(new Event(type)); + assert_true(uncaughtError instanceof TypeError); +}, "throws if `handleEvent` is thruthy and not callable"); </script> diff --git a/tests/wpt/web-platform-tests/dom/traversal/TreeWalker-acceptNode-filter.html b/tests/wpt/web-platform-tests/dom/traversal/TreeWalker-acceptNode-filter.html index 1446f40f68d..e2110aff3b3 100644 --- a/tests/wpt/web-platform-tests/dom/traversal/TreeWalker-acceptNode-filter.html +++ b/tests/wpt/web-platform-tests/dom/traversal/TreeWalker-acceptNode-filter.html @@ -8,6 +8,7 @@ Test adapted from https://dxr.mozilla.org/chromium/source/src/third_party/WebKit <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="traversal-support.js"></script> +<link rel="help" href="https://dom.spec.whatwg.org/#callbackdef-nodefilter"> <div id=log></div> </head> <body> @@ -102,10 +103,10 @@ test(function() assert_node(walker.currentNode, { type: Element, id: 'root' }); }, 'Testing with object with non-function acceptNode property'); -test(function() +test(function(t) { var filter = function() { return NodeFilter.FILTER_ACCEPT; }; - filter.acceptNode = function(node) { return NodeFilter.FILTER_SKIP; }; + filter.acceptNode = t.unreached_func("`acceptNode` method should not be called on functions"); var walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter); assert_node(walker.firstChild(), { type: Element, id: 'A1' }); assert_node(walker.nextNode(), { type: Element, id: 'B1' }); @@ -113,17 +114,6 @@ test(function() test(function() { - var filter = { - acceptNode: function(node) { - return NodeFilter.FILTER_ACCEPT; - } - }; - var walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter); - assert_node(walker.firstChild(), { type: Element, id: 'A1' }); -}, 'Testing acceptNode callee'); - -test(function() -{ var test_error = { name: "test" }; var walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, function(node) { @@ -135,6 +125,38 @@ test(function() assert_node(walker.currentNode, { type: Element, id: 'root' }); }, 'Testing with filter function that throws'); +test(function() { + var testError = { name: "test" }; + var filter = { + get acceptNode() { + throw testError; + }, + }; + + var walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter); + assert_throws(testError, function() { walker.firstChild(); }); + assert_node(walker.currentNode, { type: Element, id: 'root' }); + assert_throws(testError, function() { walker.nextNode(); }); + assert_node(walker.currentNode, { type: Element, id: 'root' }); +}, "rethrows errors when getting `acceptNode`"); + +test(function() { + var calls = 0; + var walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, { + get acceptNode() { + calls++; + return function() { + return NodeFilter.FILTER_ACCEPT; + }; + }, + }); + + assert_equals(calls, 0); + walker.nextNode(); + walker.nextNode(); + assert_equals(calls, 2); +}, "performs `Get` on every traverse"); + test(function() { var test_error = { name: "test" }; diff --git a/tests/wpt/web-platform-tests/html/semantics/rellist-feature-detection.html b/tests/wpt/web-platform-tests/html/semantics/rellist-feature-detection.html index d290439d8ee..45debcc49a4 100644 --- a/tests/wpt/web-platform-tests/html/semantics/rellist-feature-detection.html +++ b/tests/wpt/web-platform-tests/html/semantics/rellist-feature-detection.html @@ -24,10 +24,11 @@ link_support_table['a'] = { 'apple-touch-icon-precomposed', 'canonical'] }; link_support_table['area'] = link_support_table['a']; -link_support_table['form'] = link_support_table['form']; +link_support_table['form'] = link_support_table['a']; -function test_rellist(tag_name, rel_table) { - let element = document.createElement(tag_name); +function test_rellist(tag_name) { + const rel_table = link_support_table[tag_name]; + const element = document.createElement(tag_name); let tag = element.tagName; // Test that setting rel is also setting relList, for both // valid and invalid values. @@ -74,10 +75,10 @@ function test_rellist(tag_name, rel_table) { } } -test(function() { - test_rellist('LINK', link_support_table['link']); - test_rellist('A', link_support_table['a']); - test_rellist('AREA', link_support_table['area']); - test_rellist('FORM', link_support_table['form']); -}, 'Make sure that relList based feature detection is working'); +['link', 'a', 'area', 'form'].forEach(tag_name => { + test( + () => test_rellist(tag_name), + `Make sure that relList based feature detection is working for <${tag_name}>` + ); +}); </script> diff --git a/tests/wpt/web-platform-tests/interfaces/html.idl b/tests/wpt/web-platform-tests/interfaces/html.idl index f44f5da96ff..5ae46f74292 100644 --- a/tests/wpt/web-platform-tests/interfaces/html.idl +++ b/tests/wpt/web-platform-tests/interfaces/html.idl @@ -116,6 +116,8 @@ interface HTMLElement : Element { [CEReactions] attribute DOMString autocapitalize; [CEReactions] attribute [TreatNullAs=EmptyString] DOMString innerText; + + ElementInternals attachInternals(); }; HTMLElement includes GlobalEventHandlers; @@ -795,6 +797,7 @@ interface HTMLFormElement : HTMLElement { getter (RadioNodeList or Element) (DOMString name); void submit(); + void requestSubmit(optional HTMLElement submitter); [CEReactions] void reset(); boolean checkValidity(); boolean reportValidity(); @@ -1412,9 +1415,9 @@ interface Path2D { }; Path2D includes CanvasPath; -[Exposed=Window] +[Exposed=(Window,Worker)] interface ImageBitmapRenderingContext { - readonly attribute HTMLCanvasElement canvas; + readonly attribute (HTMLCanvasElement or OffscreenCanvas) canvas; void transferFromImageBitmap(ImageBitmap? bitmap); }; @@ -1422,14 +1425,14 @@ dictionary ImageBitmapRenderingContextSettings { boolean alpha = true; }; -typedef (OffscreenCanvasRenderingContext2D or WebGLRenderingContext or WebGL2RenderingContext) OffscreenRenderingContext; +typedef (OffscreenCanvasRenderingContext2D or ImageBitmapRenderingContext or WebGLRenderingContext or WebGL2RenderingContext) OffscreenRenderingContext; dictionary ImageEncodeOptions { DOMString type = "image/png"; unrestricted double quality; }; -enum OffscreenRenderingContextId { "2d", "webgl", "webgl2" }; +enum OffscreenRenderingContextId { "2d", "bitmaprenderer", "webgl", "webgl2" }; [Constructor([EnforceRange] unsigned long long width, [EnforceRange] unsigned long long height), Exposed=(Window,Worker), Transferable] interface OffscreenCanvas : EventTarget { @@ -1477,6 +1480,40 @@ dictionary ElementDefinitionOptions { DOMString extends; }; +[Exposed=Window] +interface ElementInternals { + // Form-associated custom elements + + void setFormValue((File or USVString or FormData)? value, + optional (File or USVString or FormData)? state); + + readonly attribute HTMLFormElement? form; + + void setValidity(ValidityStateFlags flags, + optional DOMString message, + optional HTMLElement anchor); + readonly attribute boolean willValidate; + readonly attribute ValidityState validity; + readonly attribute DOMString validationMessage; + boolean checkValidity(); + boolean reportValidity(); + + readonly attribute NodeList labels; +}; + +dictionary ValidityStateFlags { + boolean valueMissing = false; + boolean typeMismatch = false; + boolean patternMismatch = false; + boolean tooLong = false; + boolean tooShort = false; + boolean rangeUnderflow = false; + boolean rangeOverflow = false; + boolean stepMismatch = false; + boolean badInput = false; + boolean customError = false; +}; + dictionary FocusOptions { boolean preventScroll = false; }; diff --git a/tests/wpt/web-platform-tests/interfaces/webxr.idl b/tests/wpt/web-platform-tests/interfaces/webxr.idl index 2d1bd9fe5f5..63327a3f55d 100644 --- a/tests/wpt/web-platform-tests/interfaces/webxr.idl +++ b/tests/wpt/web-platform-tests/interfaces/webxr.idl @@ -32,7 +32,7 @@ enum XREnvironmentBlendMode { // Attributes readonly attribute XREnvironmentBlendMode environmentBlendMode; [SameObject] readonly attribute XRRenderState renderState; - readonly attribute XRInputSourceArray inputSources; + [SameObject] readonly attribute XRInputSourceArray inputSources; // Methods void updateRenderState(optional XRRenderStateInit state); diff --git a/tests/wpt/web-platform-tests/preload/download-resources.html b/tests/wpt/web-platform-tests/preload/download-resources.html index 510ebb48045..557c9656b18 100644 --- a/tests/wpt/web-platform-tests/preload/download-resources.html +++ b/tests/wpt/web-platform-tests/preload/download-resources.html @@ -1,10 +1,8 @@ <!DOCTYPE html> +<title>Makes sure that preloaded resources are downloaded</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/preload/resources/preload_helper.js"></script> -<script> - var t = async_test('Makes sure that preloaded resources are downloaded'); -</script> <link rel=preload href="resources/dummy.js" as=script> <link rel=preload href="resources/dummy.css" as=style> <link rel=preload href="resources/square.png" as=image> @@ -17,9 +15,25 @@ <link rel=preload href="resources/dummy.xml" as="fetch"> <body> <script> - window.addEventListener("load", t.step_func(function() { - t.step_timeout(function() { - verifyPreloadAndRTSupport() + setup({explicit_done: true}); + + var iterations = 0; + + function check_finished() { + if (numberOfResourceTimingEntries("resources/dummy.js") == 1 && + numberOfResourceTimingEntries("resources/dummy.css") == 1 && + numberOfResourceTimingEntries("/fonts/CanvasTest.ttf") == 1 && + numberOfResourceTimingEntries("resources/white.mp4") == 1 && + numberOfResourceTimingEntries("resources/sound_5.oga") == 1 && + numberOfResourceTimingEntries("resources/foo.vtt") == 1 && + numberOfResourceTimingEntries("resources/dummy.xml?foo=bar") == 0 && + numberOfResourceTimingEntries("resources/dummy.xml?novalue") == 0 && + numberOfResourceTimingEntries("resources/dummy.xml") == 1) { + done(); + } + iterations++; + if (iterations == 10) { + // At least one is expected to fail, but this should give details to the exact failure(s). verifyNumberOfResourceTimingEntries("resources/dummy.js", 1); verifyNumberOfResourceTimingEntries("resources/dummy.css", 1); verifyNumberOfResourceTimingEntries("/fonts/CanvasTest.ttf", 1); @@ -29,8 +43,15 @@ verifyNumberOfResourceTimingEntries("resources/dummy.xml?foo=bar", 0); verifyNumberOfResourceTimingEntries("resources/dummy.xml?novalue", 0); verifyNumberOfResourceTimingEntries("resources/dummy.xml", 1); - t.done(); - }, 5000); - })); + done(); + } else { + step_timeout(check_finished, 500); + } + } + + window.addEventListener("load", function() { + verifyPreloadAndRTSupport(); + step_timeout(check_finished, 500); + }); </script> </body> diff --git a/tests/wpt/web-platform-tests/preload/link-header-on-subresource.html b/tests/wpt/web-platform-tests/preload/link-header-on-subresource.html index 087a3429e64..7047115a1ca 100644 --- a/tests/wpt/web-platform-tests/preload/link-header-on-subresource.html +++ b/tests/wpt/web-platform-tests/preload/link-header-on-subresource.html @@ -1,18 +1,31 @@ <!DOCTYPE html> +<title>Makes sure that Link headers on subresources preload resources</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/preload/resources/preload_helper.js"></script> -<script> - var t = async_test('Makes sure that Link headers on subresources preload resources'); -</script> <link rel=stylesheet href="resources/dummy-preloads-subresource.css?link-header-on-subresource"> <script> - window.addEventListener("load", t.step_func(function() { - t.step_timeout(function() { - verifyPreloadAndRTSupport(); + setup({explicit_done: true}); + + var iterations = 0; + + function check_finished() { + if (numberOfResourceTimingEntries("/fonts/CanvasTest.ttf?link-header-on-subresource") == 1) { + done(); + } + iterations++; + if (iterations == 10) { + // This is expected to fail, but this should give details to the exact failure. verifyNumberOfResourceTimingEntries("/fonts/CanvasTest.ttf?link-header-on-subresource", 1); - t.done(); - }, 5000); - })); + done(); + } else { + step_timeout(check_finished, 500); + } + } + + window.addEventListener("load", function() { + verifyPreloadAndRTSupport(); + step_timeout(check_finished, 500); + }); </script> diff --git a/tests/wpt/web-platform-tests/preload/onerror-event.html b/tests/wpt/web-platform-tests/preload/onerror-event.html index 8190be87a4b..2038e06e941 100644 --- a/tests/wpt/web-platform-tests/preload/onerror-event.html +++ b/tests/wpt/web-platform-tests/preload/onerror-event.html @@ -1,12 +1,10 @@ <!DOCTYPE html> <html> -<head></head> -<body> +<title>Makes sure that preloaded resources trigger the onerror event</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/preload/resources/preload_helper.js"></script> <script> - var t = async_test('Makes sure that preloaded resources trigger the onerror event'); var scriptFailed = false; var styleFailed = false; var imageFailed = false; @@ -28,10 +26,20 @@ <link rel=preload href="non-existent/dummy.xml?foo" as=foobarxmlthing onerror="gibberishFailed = true;"> <link rel=preload href="non-existent/dummy.xml?fetch" as=fetch onerror="fetchFailed = true;"> <link rel=preload href="non-existent/dummy.xml?empty" onerror="emptyFailed = true;"> +<body> <script> - window.onload = t.step_func(function() { - t.step_timeout(function() { - verifyPreloadAndRTSupport(); + setup({explicit_done: true}); + + var iterations = 0; + + function check_finished() { + if (styleFailed && scriptFailed && imageFailed && fontFailed && videoFailed && audioFailed && + trackFailed && !gibberishFailed && fetchFailed && !emptyFailed) { + done(); + } + iterations++; + if (iterations == 10) { + // At least one is expected to fail, but this should give details to the exact failure(s). assert_true(styleFailed, "style triggered error event"); assert_true(scriptFailed, "script triggered error event"); assert_true(imageFailed, "image triggered error event"); @@ -42,8 +50,15 @@ assert_false(gibberishFailed, "gibberish as value did not trigger error event"); assert_true(fetchFailed, "fetch as triggered error event"); assert_false(emptyFailed, "empty as triggered error event"); - t.done(); - }, 5000); + done(); + } else { + step_timeout(check_finished, 500); + } + } + + window.addEventListener("load", function() { + verifyPreloadAndRTSupport(); + step_timeout(check_finished, 500); }); </script> </body> diff --git a/tests/wpt/web-platform-tests/preload/preload-csp.sub.html b/tests/wpt/web-platform-tests/preload/preload-csp.sub.html index 65e9b3a2a6d..62d0c71039b 100644 --- a/tests/wpt/web-platform-tests/preload/preload-csp.sub.html +++ b/tests/wpt/web-platform-tests/preload/preload-csp.sub.html @@ -15,41 +15,41 @@ <link rel=preload href="resources/dummy.xml"> <body> <script> -setup({explicit_done: true}); + setup({explicit_done: true}); -var iterations = 0; + var iterations = 0; -function check_finished() { - if (numberOfResourceTimingEntries("{{host}}:{{ports[http][1]}}/preload/resources/dummy.js") == 0 && - numberOfResourceTimingEntries("resources/dummy.css") == 0 && - numberOfResourceTimingEntries("resources/square.png") == 0 && - numberOfResourceTimingEntries("/fonts/CanvasTest.ttf") == 0 && - numberOfResourceTimingEntries("resources/white.mp4") == 0 && - numberOfResourceTimingEntries("resources/sound_5.oga") == 0 && - numberOfResourceTimingEntries("resources/foo.vtt") == 0 && - numberOfResourceTimingEntries("resources/dummy.xml") == 0) { - done(); + function check_finished() { + if (numberOfResourceTimingEntries("{{host}}:{{ports[http][1]}}/preload/resources/dummy.js") == 0 && + numberOfResourceTimingEntries("resources/dummy.css") == 0 && + numberOfResourceTimingEntries("resources/square.png") == 0 && + numberOfResourceTimingEntries("/fonts/CanvasTest.ttf") == 0 && + numberOfResourceTimingEntries("resources/white.mp4") == 0 && + numberOfResourceTimingEntries("resources/sound_5.oga") == 0 && + numberOfResourceTimingEntries("resources/foo.vtt") == 0 && + numberOfResourceTimingEntries("resources/dummy.xml") == 0) { + done(); + } + iterations++; + if (iterations == 10) { + // At least one is expected to fail, but this should give details to the exact failure(s). + verifyNumberOfResourceTimingEntries("{{host}}:{{ports[http][1]}}/preload/resources/dummy.js", 0); + verifyNumberOfResourceTimingEntries("resources/dummy.css", 0); + verifyNumberOfResourceTimingEntries("resources/square.png", 0); + verifyNumberOfResourceTimingEntries("/fonts/CanvasTest.ttf", 0); + verifyNumberOfResourceTimingEntries("resources/white.mp4", 0); + verifyNumberOfResourceTimingEntries("resources/sound_5.oga", 0); + verifyNumberOfResourceTimingEntries("resources/foo.vtt", 0); + verifyNumberOfResourceTimingEntries("resources/dummy.xml", 0); + done(); + } else { + step_timeout(check_finished, 500); + } } - iterations++; - if (iterations == 10) { - // At least one is expected to fail, but this should give details to the exact failure(s). - verifyNumberOfResourceTimingEntries("{{host}}:{{ports[http][1]}}/preload/resources/dummy.js", 0); - verifyNumberOfResourceTimingEntries("resources/dummy.css", 0); - verifyNumberOfResourceTimingEntries("resources/square.png", 0); - verifyNumberOfResourceTimingEntries("/fonts/CanvasTest.ttf", 0); - verifyNumberOfResourceTimingEntries("resources/white.mp4", 0); - verifyNumberOfResourceTimingEntries("resources/sound_5.oga", 0); - verifyNumberOfResourceTimingEntries("resources/foo.vtt", 0); - verifyNumberOfResourceTimingEntries("resources/dummy.xml", 0); - done(); - } else { - step_timeout(check_finished, 500); - } -} -window.addEventListener("load", function() { - verifyPreloadAndRTSupport(); - step_timeout(check_finished, 500); -}); + window.addEventListener("load", function() { + verifyPreloadAndRTSupport(); + step_timeout(check_finished, 500); + }); </script> diff --git a/tests/wpt/web-platform-tests/preload/preload-default-csp.sub.html b/tests/wpt/web-platform-tests/preload/preload-default-csp.sub.html index 923431456cf..9fc11945866 100644 --- a/tests/wpt/web-platform-tests/preload/preload-default-csp.sub.html +++ b/tests/wpt/web-platform-tests/preload/preload-default-csp.sub.html @@ -15,41 +15,41 @@ <link rel=preload href="resources/dummy.xml"> <body> <script> -setup({explicit_done: true}); + setup({explicit_done: true}); -var iterations = 0; + var iterations = 0; -function check_finished() { - if (numberOfResourceTimingEntries("{{host}}:{{ports[http][1]}}/preload/resources/dummy.js") == 0 && - numberOfResourceTimingEntries("resources/dummy.css") == 0 && - numberOfResourceTimingEntries("resources/square.png") == 0 && - numberOfResourceTimingEntries("/fonts/CanvasTest.ttf") == 0 && - numberOfResourceTimingEntries("resources/white.mp4") == 0 && - numberOfResourceTimingEntries("resources/sound_5.oga") == 0 && - numberOfResourceTimingEntries("resources/foo.vtt") == 0 && - numberOfResourceTimingEntries("resources/dummy.xml") == 0) { - done(); + function check_finished() { + if (numberOfResourceTimingEntries("{{host}}:{{ports[http][1]}}/preload/resources/dummy.js") == 0 && + numberOfResourceTimingEntries("resources/dummy.css") == 0 && + numberOfResourceTimingEntries("resources/square.png") == 0 && + numberOfResourceTimingEntries("/fonts/CanvasTest.ttf") == 0 && + numberOfResourceTimingEntries("resources/white.mp4") == 0 && + numberOfResourceTimingEntries("resources/sound_5.oga") == 0 && + numberOfResourceTimingEntries("resources/foo.vtt") == 0 && + numberOfResourceTimingEntries("resources/dummy.xml") == 0) { + done(); + } + iterations++; + if (iterations == 10) { + // At least one is expected to fail, but this should give details to the exact failure(s). + verifyNumberOfResourceTimingEntries("{{host}}:{{ports[http][1]}}/preload/resources/dummy.js", 0); + verifyNumberOfResourceTimingEntries("resources/dummy.css", 0); + verifyNumberOfResourceTimingEntries("resources/square.png", 0); + verifyNumberOfResourceTimingEntries("/fonts/CanvasTest.ttf", 0); + verifyNumberOfResourceTimingEntries("resources/white.mp4", 0); + verifyNumberOfResourceTimingEntries("resources/sound_5.oga", 0); + verifyNumberOfResourceTimingEntries("resources/foo.vtt", 0); + verifyNumberOfResourceTimingEntries("resources/dummy.xml", 0); + done(); + } else { + step_timeout(check_finished, 500); + } } - iterations++; - if (iterations == 10) { - // At least one is expected to fail, but this should give details to the exact failure(s). - verifyNumberOfResourceTimingEntries("{{host}}:{{ports[http][1]}}/preload/resources/dummy.js", 0); - verifyNumberOfResourceTimingEntries("resources/dummy.css", 0); - verifyNumberOfResourceTimingEntries("resources/square.png", 0); - verifyNumberOfResourceTimingEntries("/fonts/CanvasTest.ttf", 0); - verifyNumberOfResourceTimingEntries("resources/white.mp4", 0); - verifyNumberOfResourceTimingEntries("resources/sound_5.oga", 0); - verifyNumberOfResourceTimingEntries("resources/foo.vtt", 0); - verifyNumberOfResourceTimingEntries("resources/dummy.xml", 0); - done(); - } else { - step_timeout(check_finished, 500); - } -} -window.addEventListener("load", function() { - verifyPreloadAndRTSupport(); - step_timeout(check_finished, 500); -}); + window.addEventListener("load", function() { + verifyPreloadAndRTSupport(); + step_timeout(check_finished, 500); + }); </script> diff --git a/tests/wpt/web-platform-tests/tools/wpt/wpt.py b/tests/wpt/web-platform-tests/tools/wpt/wpt.py index 909d435b648..4130e1eecf8 100644 --- a/tests/wpt/web-platform-tests/tools/wpt/wpt.py +++ b/tests/wpt/web-platform-tests/tools/wpt/wpt.py @@ -80,6 +80,34 @@ def import_command(prog, command, props): return script, parser +def create_complete_parser(): + """Eagerly load all subparsers. This involves more work than is required + for typical command-line usage. It is maintained for the purposes of + documentation generation as implemented in WPT's top-level `/docs` + directory.""" + + commands = load_commands() + parser = argparse.ArgumentParser() + subparsers = parser.add_subparsers() + + for command in commands: + props = commands[command] + + if props["virtualenv"]: + setup_virtualenv(None, False, props) + + subparser = import_command('wpt', command, props)[1] + if not subparser: + continue + + subparsers.add_parser(command, + help=props["help"], + add_help=False, + parents=[subparser]) + + return parser + + def setup_virtualenv(path, skip_venv_setup, props): if skip_venv_setup and path is None: raise ValueError("Must set --venv when --skip-venv-setup is used") diff --git a/tests/wpt/web-platform-tests/wake-lock/wakelock-insecure-context.any.js b/tests/wpt/web-platform-tests/wake-lock/wakelock-insecure-context.any.js new file mode 100644 index 00000000000..f32cc3c3543 --- /dev/null +++ b/tests/wpt/web-platform-tests/wake-lock/wakelock-insecure-context.any.js @@ -0,0 +1,5 @@ +//META: title=Wake Lock API is not exposed in an insecure context + +test(() => { + assert_false("WakeLock" in self, "'WakeLock' must not be exposed"); +}, "Wake Lock API is not exposed in an insecure context"); diff --git a/tests/wpt/web-platform-tests/wake-lock/wakelock-insecure-context.html b/tests/wpt/web-platform-tests/wake-lock/wakelock-insecure-context.html deleted file mode 100644 index 2c61f41311d..00000000000 --- a/tests/wpt/web-platform-tests/wake-lock/wakelock-insecure-context.html +++ /dev/null @@ -1,13 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>Wake Lock API is not exposed in an insecure context</title> -<link rel="help" href="https://w3c.github.io/wake-lock/#wake-locks"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script> - -test(t => { - assert_false("WakeLock" in self, "'WakeLock' must not be exposed"); -}, "Wake Lock API is not exposed in an insecure context"); - -</script> diff --git a/tests/wpt/web-platform-tests/wake-lock/wakelock-state-is-global.https.html b/tests/wpt/web-platform-tests/wake-lock/wakelock-state-is-global.https.html deleted file mode 100644 index 2eee3198249..00000000000 --- a/tests/wpt/web-platform-tests/wake-lock/wakelock-state-is-global.https.html +++ /dev/null @@ -1,75 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>wake lock state should be global</title> -<link rel="help" href="https://w3c.github.io/wake-lock/"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> - -<body> -<script id="iframe" type="text/plain"> -let iframeWakeLock; -const controller = new AbortController(); -const signal = controller.signal; -window.onmessage = async message => { - switch(message.data) { - case "ACQUIRED": - iframeWakeLock = new WakeLock("screen"); - await iframeWakeLock.request({ signal }); - parent.postMessage(iframeWakeLock.active, "*"); - break; - case "RELEASED": - controller.abort(); - parent.postMessage(iframeWakeLock.active, "*"); - break; - default: - parent.postMessage("unknown operation", "*"); - } -} -</script> - -<script> -function load_iframe() { - return new Promise(resolve => { - const iframe = document.createElement("iframe"); - iframe.onload = () => { resolve(iframe); }; - iframe.srcdoc = "<script>" + - document.getElementById('iframe').textContent + - "<\/script>"; - document.body.appendChild(iframe); - }); -} - -function wait_for_message(iframe) { - return new Promise(resolve => { - self.addEventListener("message", function listener(e) { - if (e.source === iframe.contentWindow) { - resolve(e.data); - self.removeEventListener("message", listener); - } - }); - }); -} - -promise_test(async t => { - const wakeLock = await new WakeLock("screen"); - const iframe = await load_iframe(); - const eventWatcher = new EventWatcher(t, wakeLock, "activechange"); - - assert_false(wakeLock.active, "wakeLock is initially false"); - - //when iframe wake lock is acquired, parent wake lock should be actived - iframe.contentWindow.postMessage("ACQUIRED", "*"); - const isActive1 = await wait_for_message(iframe); - await eventWatcher.wait_for("activechange"); - assert_true(isActive1, "the iframe wake lock state is actived when iframe wake lock is acquired"); - assert_true(wakeLock.active, "the wake lock state is actived when iframe wake lock is acquired"); - - //when iframe wake lock is released, parent wake lock should be inactived - iframe.contentWindow.postMessage("RELEASED", "*"); - const isActive2 = await wait_for_message(iframe); - eventWatcher.wait_for("activechange"); - assert_false(isActive2, "the iframe wake lock state is inactived when iframe wake lock is released"); - assert_false(wakeLock.active, "the wake lock state is inactived when iframe wake lock is released"); -}, "Test that wake lock state should be global"); -</script> -</body> diff --git a/tests/wpt/web-platform-tests/wake-lock/wakelock-type.https.any.js b/tests/wpt/web-platform-tests/wake-lock/wakelock-type.https.any.js new file mode 100644 index 00000000000..26ebcbef557 --- /dev/null +++ b/tests/wpt/web-platform-tests/wake-lock/wakelock-type.https.any.js @@ -0,0 +1,19 @@ +//META: title=WakeLock.request() with invaild type + +promise_test(async t => { + await promise_rejects(t, new TypeError(), WakeLock.request()); +}, "'TypeError' is thrown when set an empty wake lock type"); + +promise_test(t => { + const invalidTypes = [ + "invalid", + null, + 123, + {}, + "", + true + ]; + invalidTypes.map(async invalidType => { + await promise_rejects(t, new TypeError(), WakeLock.request(invalidType)); + }); +}, "'TypeError' is thrown when set an invalid wake lock type"); diff --git a/tests/wpt/web-platform-tests/wake-lock/wakelock-type.https.html b/tests/wpt/web-platform-tests/wake-lock/wakelock-type.https.html deleted file mode 100644 index df7a68a040b..00000000000 --- a/tests/wpt/web-platform-tests/wake-lock/wakelock-type.https.html +++ /dev/null @@ -1,38 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>WakeLockType Test</title> -<link rel="help" href="https://w3c.github.io/wake-lock/"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> - -<script> - -test(() => { - const wakeLock = new WakeLock("screen"); - assert_equals(wakeLock.type, "screen"); -}, "Test that wakeLock.type is 'screen' when screen wake lock is invoked"); - -test(() => { - const wakeLock = new WakeLock("system"); - assert_equals(wakeLock.type, "system"); -}, "Test that wakeLock.type is 'system' when system wake lock is invoked"); - -test(() => { - assert_throws(new TypeError(), () => new WakeLock()); -}, "'TypeError' is thrown when set an empty wake lock type"); - -test(() => { - const invalidTypes = [ - "invalid", - null, - 123, - {}, - "", - true - ]; - invalidTypes.map(invalidType => { - assert_throws(new TypeError(), () => new WakeLock(invalidType)); - }) -}, "'TypeError' is thrown when set an invalid wake lock type"); - -</script> |