From 218303b8b529f71681f0445c1d6cd579c23a6bd8 Mon Sep 17 00:00:00 2001 From: qiuzhong Date: Fri, 14 Dec 2018 13:22:11 +0800 Subject: [PATCH] Remove some useless test-level properties Remove useless test-level properties, including: * Incorrect type of the properties parameter for `promise_test()` * `flags` property passed to `test()`, which is unused in testharness.js * Incorrect type of the properties `generate_tests`: moved to comments * `help` property: moved the head of the test files * Default empty properties dictionary Related: #14394 --- .../values/shape-margin-000.html | 4 +- .../values/shape-margin-001.html | 4 +- .../values/shape-margin-002.html | 4 +- css/css-transitions/transition-delay-001.html | 6 +- .../transition-duration-001.html | 6 +- .../query-encoding/resources/resolve-url.js | 131 ++++++++--------- html/resources/common.js | 4 +- .../forms/the-input-element/datetime.html | 113 ++++++--------- .../forms/the-input-element/range.html | 134 +++++------------- .../forms/the-input-element/search_input.html | 10 +- .../template-as-a-descendant.html | 24 ++-- ...ng-stack-back-to-a-table-body-context.html | 3 +- ...learing-stack-back-to-a-table-context.html | 3 +- ...ing-stack-back-to-a-table-row-context.html | 3 +- .../template-owner-document.html | 6 +- media-source/mediasource-util.js | 13 +- 16 files changed, 176 insertions(+), 292 deletions(-) diff --git a/css/css-shapes/shape-outside/values/shape-margin-000.html b/css/css-shapes/shape-outside/values/shape-margin-000.html index 487868cee6024af..850b7c66113744e 100644 --- a/css/css-shapes/shape-outside/values/shape-margin-000.html +++ b/css/css-shapes/shape-outside/values/shape-margin-000.html @@ -27,9 +27,9 @@ } ]; generate_tests( ParsingUtils.testShapeMarginInlineStyle, - ParsingUtils.buildTestCases(shape_margin_valid_tests, "inline"), false); + ParsingUtils.buildTestCases(shape_margin_valid_tests, "inline")); generate_tests( ParsingUtils.testShapeMarginComputedStyle, - ParsingUtils.buildTestCases(shape_margin_valid_tests, "computed"), false); + ParsingUtils.buildTestCases(shape_margin_valid_tests, "computed")); diff --git a/css/css-shapes/shape-outside/values/shape-margin-001.html b/css/css-shapes/shape-outside/values/shape-margin-001.html index 39dea7efe81eeeb..6a82f6f0010c323 100644 --- a/css/css-shapes/shape-outside/values/shape-margin-001.html +++ b/css/css-shapes/shape-outside/values/shape-margin-001.html @@ -26,9 +26,9 @@ shape_margin_valid_unit_tests.push(testCase); }); generate_tests( ParsingUtils.testShapeMarginInlineStyle, - ParsingUtils.buildTestCases(shape_margin_valid_unit_tests, "inline"), true); + ParsingUtils.buildTestCases(shape_margin_valid_unit_tests, "inline")); generate_tests( ParsingUtils.testShapeMarginComputedStyle, - ParsingUtils.buildTestCases(shape_margin_valid_unit_tests, "computed"), true); + ParsingUtils.buildTestCases(shape_margin_valid_unit_tests, "computed")); diff --git a/css/css-shapes/shape-outside/values/shape-margin-002.html b/css/css-shapes/shape-outside/values/shape-margin-002.html index 4cb0c69ba78c410..0618588722afd79 100644 --- a/css/css-shapes/shape-outside/values/shape-margin-002.html +++ b/css/css-shapes/shape-outside/values/shape-margin-002.html @@ -37,9 +37,9 @@ }, ]; generate_tests( ParsingUtils.testShapeMarginInlineStyle, - ParsingUtils.buildTestCases(shape_margin_valid_tests, "inline"), true); + ParsingUtils.buildTestCases(shape_margin_valid_tests, "inline")); generate_tests( ParsingUtils.testShapeMarginComputedStyle, - ParsingUtils.buildTestCases(shape_margin_valid_tests, "computed"), true); + ParsingUtils.buildTestCases(shape_margin_valid_tests, "computed")); diff --git a/css/css-transitions/transition-delay-001.html b/css/css-transitions/transition-delay-001.html index 921525ea72d2e1e..8fa5f5825aad03a 100644 --- a/css/css-transitions/transition-delay-001.html +++ b/css/css-transitions/transition-delay-001.html @@ -69,11 +69,7 @@ }); var result = computedStyle(transition, 'transition-delay'); assert_equals(result, values[key], "Expected computed value"); - }, "parse '" + key + "'", - { - // mark tests that fail as such - flags: invalidTests[key] ? "invalid" : "" - }); + }, "parse '" + key + "'"); } } diff --git a/css/css-transitions/transition-duration-001.html b/css/css-transitions/transition-duration-001.html index b5c095f001efb37..60b9f5fc5c872c9 100644 --- a/css/css-transitions/transition-duration-001.html +++ b/css/css-transitions/transition-duration-001.html @@ -70,11 +70,7 @@ }); var result = computedStyle(transition, 'transition-duration'); assert_equals(result, values[key], "Expected computed value"); - }, "parse '" + key + "'", - { - // mark tests that fail as such - flags: invalidTests[key] ? "invalid" : "" - }); + }, "parse '" + key + "'"); } } diff --git a/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js b/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js index cf175eb4d3ae688..377ec9ae6437fdc 100644 --- a/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js +++ b/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js @@ -1,6 +1,34 @@ // NOTE: this file needs to be split up rather than expanded. See ../location.sub.html for some // extracted tests. Tracked by https://github.com/web-platform-tests/wpt/issues/4934. +/* +* help: +* https://html.spec.whatwg.org/multipage/#the-link-element +* https://html.spec.whatwg.org/multipage/#styling +* https://html.spec.whatwg.org/multipage/#prepare-a-script +* https://html.spec.whatwg.org/multipage/#concept-media-load-algorithm +* https://html.spec.whatwg.org/multipage/#track-url +* https://html.spec.whatwg.org/multipage/#concept-form-submit +* https://html.spec.whatwg.org/multipage/#set-the-frozen-base-url +* https://dom.spec.whatwg.org/#dom-node-baseuri +* https://html.spec.whatwg.org/multipage/#the-a-element +* https://html.spec.whatwg.org/multipage/#dom-worker +* https://html.spec.whatwg.org/multipage/#dom-sharedworker +* https://html.spec.whatwg.org/multipage/#dom-eventsource +* https://html.spec.whatwg.org/multipage/#dom-xmldocument-load +* https://html.spec.whatwg.org/multipage/#dom-open +* http://url.spec.whatwg.org/#dom-url-search +* https://www.w3.org/Bugs/Public/show_bug.cgi?id=24148 +* https://xhr.spec.whatwg.org/#the-open()-method +* https://html.spec.whatwg.org/multipage/#set-up-a-worker-script-settings-object +* https://html.spec.whatwg.org/multipage/#dom-workerglobalscope-importscripts +* https://html.spec.whatwg.org/multipage/#parse-a-websocket-url's-components +* https://html.spec.whatwg.org/multipage/#dom-websocket-url +* https://html.spec.whatwg.org/multipage/#parse-a-manifest +* https://www.w3.org/Bugs/Public/show_bug.cgi?id=23968 +* http://dev.w3.org/csswg/cssom/#requirements-on-user-agents-implementing-the-xml-stylesheet-processing-instruction +* http://url.spec.whatwg.org/#dom-url +*/ setup({explicit_done:true}); onload = function() { var encoding = '{{GET[encoding]}}'; @@ -41,8 +69,7 @@ onload = function() { assert_equals(window[id].document.documentElement.textContent, expected_current); }); - }, 'load nested browsing context <'+tag+' '+attr+'>', - {help:spec_url}); + }, 'load nested browsing context <'+tag+' '+attr+'>'); } spec_url_load_nested_browsing_context = { @@ -71,9 +98,7 @@ onload = function() { assert_true(elm.sheet.href.indexOf(expected_current) > -1, 'sheet.href ' + msg(expected_current, got)); assert_equals(elm.sheet.cssRules[0].style.content, '"'+expected_current+'"', 'sheet.cssRules[0].style.content'); }); - }, 'loading css ', - {help:['https://html.spec.whatwg.org/multipage/#the-link-element', - 'https://html.spec.whatwg.org/multipage/#styling']}); + }, 'loading css '); // loading js async_test(function() { @@ -83,8 +108,7 @@ onload = function() { elm.onload = this.step_func_done(function() { assert_equals(window.test_load_js_got, expected_current); }); - }, 'loading js @@ -24,80 +32,45 @@

Date and Time Inputs

diff --git a/html/semantics/forms/the-input-element/range.html b/html/semantics/forms/the-input-element/range.html index 209ce25306e0298..577611bb802552a 100644 --- a/html/semantics/forms/the-input-element/range.html +++ b/html/semantics/forms/the-input-element/range.html @@ -8,6 +8,13 @@ + + + + + + + @@ -48,137 +55,91 @@

Input Range

function() { assert_equals(document.getElementById('range_basic').type, "range"); }, - "range type support on input element", - { - "help" : "https://html.spec.whatwg.org/multipage/#dom-input-type" - } + "range type support on input element" ); test( function() { assert_equals(document.getElementById('range_basic').min, "0") }, - "min attribute support on input element", - { - "help" : "https://html.spec.whatwg.org/multipage/#dom-input-min" - } + "min attribute support on input element" ); test( function() { assert_equals(document.getElementById('range_basic').max, "5") }, - "max attribute support on input element", - { - "help" : "https://html.spec.whatwg.org/multipage/#dom-input-max" - } + "max attribute support on input element" ); test( function() { assert_equals(document.getElementById('illegal_min_and_max').min, "ab") }, - "Illegal value of min attribute", - { - "help" : [ - "https://html.spec.whatwg.org/multipage/#dom-input-min", - "https://html.spec.whatwg.org/multipage/#range-state-(type=range)" - ] - } + "Illegal value of min attribute" ); test( function() { assert_equals(document.getElementById('illegal_min_and_max').max, "f") }, - "Illegal value of max attribute", - { - "help" : [ - "https://html.spec.whatwg.org/multipage/#dom-input-max", - "https://html.spec.whatwg.org/multipage/#range-state-(type=range)" - ] - } + "Illegal value of max attribute" ); test( function() { assert_equals(document.getElementById('illegal_value_and_step').value, "3") }, - "Converting an illegal string to the default value", - { - "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)" - } + "Converting an illegal string to the default value" ); test( function() { assert_equals(document.getElementById('illegal_value_and_step').step, "xyz") }, - "Illegal value of step attribute", - { - "help" : [ - "https://html.spec.whatwg.org/multipage/#dom-input-step", - "https://html.spec.whatwg.org/multipage/#range-state-(type=range)" - ] - } + "Illegal value of step attribute" ); test( function() { assert_equals(document.getElementById('value_smaller_than_min').value, "0") }, - "the value is set to min when a smaller value than min attribute is given", - { - "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)" - } + "the value is set to min when a smaller value than min attribute is given" ); test( function() { assert_equals(document.getElementById('value_larger_than_max').value, "5") }, - "the value is set to max when a larger value than max attribute is given", - { - "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)" - } + "the value is set to max when a larger value than max attribute is given" ); test( function() { assert_equals(document.getElementById('empty_attributes').min, "") }, - "default value of min attribute in input type=range", - { "help" : "https://html.spec.whatwg.org/multipage/#dom-input-min" } + "default value of min attribute in input type=range" ); test( function() { assert_equals(document.getElementById('empty_attributes').max, "") }, - "default value of max attribute in input type=range", - { - "help" : "https://html.spec.whatwg.org/multipage/#dom-input-max" - } + "default value of max attribute in input type=range" ); test( function() { assert_equals(document.getElementById('value_not_specified').value, "4") }, - "default value when min and max attributes are given (= min plus half the difference between min and max)", - { - "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)" - } + "default value when min and max attributes are given (= min plus half the difference between min and max)" ); test( function() { assert_equals(document.getElementById('control_step_mismatch').value, "4") }, - "default value with step control when both min and max attributes are given", - { - "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)" - } + "default value with step control when both min and max attributes are given" ); // Chrome would result in different value out of the range between min and max. Why? @@ -186,49 +147,35 @@

Input Range

function() { assert_equals(document.getElementById('max_smaller_than_min').value, "2") }, - "default value when both min and max attributes are given, while min > max", - { - "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)" - } + "default value when both min and max attributes are given, while min > max" ); test( function() { assert_equals(document.getElementById('default_step_scale_factor_1').value, "7") }, - "The default step scale factor is 1, unless min attribute has non-integer value", - { - "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)" - } + "The default step scale factor is 1, unless min attribute has non-integer value" ); test( function() { assert_equals(document.getElementById('default_step_scale_factor_2').value, "6.3") }, - "Step scale factor behavior when min attribute has integer value but max attribute is non-integer ", - { - "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)" } + "Step scale factor behavior when min attribute has integer value but max attribute is non-integer " ); test( function() { assert_equals(document.getElementById('default_step_scale_factor_3').step, "1") }, - "The default scale factor is 1 even if step attribute is explicitly set to non-integer value, unless min attribute has non-integer value", - { - "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)" - } + "The default scale factor is 1 even if step attribute is explicitly set to non-integer value, unless min attribute has non-integer value" ); test( function() { assert_equals(document.getElementById('float_step_scale_factor').value, "6.8") }, - "Solving the step mismatch", - { - "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)" - } + "Solving the step mismatch" ); // Firefox Nightly (24.0a1) would result in the possible maximum value in this range... (i.e. 12) @@ -238,10 +185,7 @@

Input Range

e.stepUp(); assert_equals(e.value, "9") }, - "Performing stepUp()", - { - "help" : "https://html.spec.whatwg.org/multipage/#dom-input-stepup" - } + "Performing stepUp()" ); // Firefox Nightly (24.0a1) would result in the possible minimum value in this range... (i.e. 3) @@ -251,10 +195,7 @@

Input Range

e.stepDown(); assert_equals(e.value, "6") }, - "Performing stepDown()", - { - "help" : "https://html.spec.whatwg.org/multipage/#dom-input-stepdown" - } + "Performing stepDown()" ); // Chrome and Opera would throw DOM Exception 11 (InvalidStateError) @@ -265,10 +206,7 @@

Input Range

e.stepUp(2); assert_equals(e.value, "12") }, - "Performing stepUp() beyond the value of the max attribute", - { - "help" : "https://html.spec.whatwg.org/multipage/#dom-input-stepup" - } + "Performing stepUp() beyond the value of the max attribute" ); // Chrome and Opera would throw DOM Exception 11 (InvalidStateError) @@ -278,18 +216,14 @@

Input Range

var e = document.getElementById('stepdown_beyond_min'); e.stepDown(2); assert_equals(e.value, "3") - }, "Performing stepDown() beyond the value of the min attribute", { - "help" : "https://html.spec.whatwg.org/multipage/#dom-input-stepdown" - } + }, "Performing stepDown() beyond the value of the min attribute" ); test( function() { var e = document.getElementById('should_skip_whitespace'); assert_equals(e.value, "123") - }, "Skip ASCII whitespace within input", { - "help" : "https://html.spec.whatwg.org/multipage/#best-representation-of-the-number-as-a-floating-point-number" - } + }, "Skip ASCII whitespace within input" ); test( @@ -297,9 +231,7 @@

Input Range

var e = document.getElementById('exponent_value1'); e.value = 1e2; assert_equals(e.value, "100") - }, "Multiply value by ten raised to the exponentth power with `e`", { - "help" : "https://html.spec.whatwg.org/multipage/#best-representation-of-the-number-as-a-floating-point-number" - } + }, "Multiply value by ten raised to the exponentth power with `e`" ); test( @@ -307,9 +239,7 @@

Input Range

var e = document.getElementById('exponent_value2'); e.value = 1E2; assert_equals(e.value, "100") - }, "Multiply value by ten raised to the exponentth power with `E`", { - "help" : "https://html.spec.whatwg.org/multipage/#best-representation-of-the-number-as-a-floating-point-number" - } + }, "Multiply value by ten raised to the exponentth power with `E`" ); diff --git a/html/semantics/forms/the-input-element/search_input.html b/html/semantics/forms/the-input-element/search_input.html index 175cdde99a339a2..7b63cd43e1b46e1 100644 --- a/html/semantics/forms/the-input-element/search_input.html +++ b/html/semantics/forms/the-input-element/search_input.html @@ -6,7 +6,9 @@ - + + + @@ -23,10 +25,8 @@

Search Input

diff --git a/html/semantics/scripting-1/the-template-element/template-element/template-as-a-descendant.html b/html/semantics/scripting-1/the-template-element/template-element/template-as-a-descendant.html index 8ad6532172c948e..caa1beab47ae800 100644 --- a/html/semantics/scripting-1/the-template-element/template-element/template-as-a-descendant.html +++ b/html/semantics/scripting-1/the-template-element/template-element/template-as-a-descendant.html @@ -72,15 +72,15 @@ 'Template element is created by innerHTML', doc.head], ]; -generate_tests(templateIsAChild, parameters, - 'Template element as a descendant of the HEAD and BODY elements'); +// Template element as a descendant of the HEAD and BODY elements +generate_tests(templateIsAChild, parameters); parameters = [['Template element as a descendant of the FRAMESET element. ' + 'Template element is created by innerHTML', frameset], ]; -generate_tests(templateIsDisallowedAsAChild, parameters, - 'Template element should be disallowed as a descendant of the FRAMESET elements'); +// Template element should be disallowed as a descendant of the FRAMESET elements +generate_tests(templateIsDisallowedAsAChild, parameters); parameters = [['Template element as an indirect descendant of the BODY element. ' + @@ -90,15 +90,15 @@ 'Template element is created by innerHTML', doc.head], ]; -generate_tests(templateIsAnIndirectChild, parameters, - 'Template element as an indirect descendant of the HEAD, BODY and FRAMESET elements'); +// Template element as an indirect descendant of the HEAD, BODY and FRAMESET elements +generate_tests(templateIsAnIndirectChild, parameters); parameters = [['Template element as an indirect descendant of the FRAMESET element. ' + 'Template element is created by innerHTML', frameset], ]; -generate_tests(templateIsDisallowedAsAnIndirectChild, parameters, - 'Template element should be disallowed as an indirect descendant of the FRAMESET elements'); +// Template element should be disallowed as an indirect descendant of the FRAMESET elements +generate_tests(templateIsDisallowedAsAnIndirectChild, parameters); @@ -112,8 +112,8 @@ 'Template element is appended by appendChild()', doc, frameset] ]; -generate_tests(templateIsAnAppendedChild, parameters, - 'Template element as a descendant of the HEAD, BODY and FRAMESET elements'); +// Template element as a descendant of the HEAD, BODY and FRAMESET elements +generate_tests(templateIsAnAppendedChild, parameters); @@ -127,8 +127,8 @@ 'Template element is appended by appendChild()', doc, frameset] ]; -generate_tests(templateIsAnAppendedIndirectChild, parameters, - 'Template element as a descendant of the HEAD, BODY and FRAMESET elements'); +// Template element as a descendant of the HEAD, BODY and FRAMESET elements +generate_tests(templateIsAnAppendedIndirectChild, parameters); diff --git a/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-body-context.html b/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-body-context.html index a150faa1d7ee850..2e7d5408214c057 100644 --- a/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-body-context.html +++ b/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-body-context.html @@ -175,7 +175,8 @@ doc, 'tbody', '', null, null] ]; -generate_tests(doTest, parameters, 'Clearing stack back to a table body context.'); +// Clearing stack back to a table body context. +generate_tests(doTest, parameters); diff --git a/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-context.html b/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-context.html index 23a4e7b0bbf3873..b805d3c9f9921bc 100644 --- a/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-context.html +++ b/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-context.html @@ -77,7 +77,8 @@ doc, '', 'col1', 'COL'] ]; -generate_tests(doTest, parameters, 'Clearing stack back to a table body context.'); +// Clearing stack back to a table body context. +generate_tests(doTest, parameters); diff --git a/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-row-context.html b/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-row-context.html index 25039161261054b..d213c0fbddf9d71 100644 --- a/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-row-context.html +++ b/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-row-context.html @@ -64,7 +64,8 @@ doc, '', null, null] ]; -generate_tests(doTest, parameters, 'Clearing stack back to a table body context.'); +// Clearing stack back to a table body context. +generate_tests(doTest, parameters); diff --git a/html/syntax/parsing/template/creating-an-element-for-the-token/template-owner-document.html b/html/syntax/parsing/template/creating-an-element-for-the-token/template-owner-document.html index bec3364adffec6c..6738a6fde55a1d6 100644 --- a/html/syntax/parsing/template/creating-an-element-for-the-token/template-owner-document.html +++ b/html/syntax/parsing/template/creating-an-element-for-the-token/template-owner-document.html @@ -171,9 +171,9 @@ assert_equals(element.ownerDocument, template.content.ownerDocument) } -generate_tests(compare_owners, parameters, - 'Test ownerDocument property of all HTML5 elements in a template. ' - + 'Current DOCUMENT has no browsing context.'); +// Test ownerDocument property of all HTML5 elements in a template. +// Current DOCUMENT has no browsing context. +generate_tests(compare_owners, parameters); var context = newContext(); parameters = []; diff --git a/media-source/mediasource-util.js b/media-source/mediasource-util.js index bb701e705245828..7e3b539b05d87c8 100644 --- a/media-source/mediasource-util.js +++ b/media-source/mediasource-util.js @@ -330,16 +330,15 @@ }; window['MediaSourceUtil'] = MediaSourceUtil; - window['media_test'] = function(testFunction, description, options) + window['media_test'] = function(testFunction, description) { - options = options || {}; return async_test(function(test) { addExtraTestMethods(test); testFunction(test); - }, description, options); + }, description); }; - window['mediasource_test'] = function(testFunction, description, options) + window['mediasource_test'] = function(testFunction, description) { return media_test(function(test) { @@ -362,10 +361,10 @@ { testFunction(test, mediaTag, mediaSource); }); - }, description, options); + }, description); }; - window['mediasource_testafterdataloaded'] = function(testFunction, description, options) + window['mediasource_testafterdataloaded'] = function(testFunction, description) { mediasource_test(function(test, mediaElement, mediaSource) { @@ -383,7 +382,7 @@ { testFunction(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData); }); - }, description, options); + }, description); } function timeRangesToString(ranges)