WebKit Bugzilla
Attachment 341895 Details for
Bug 186261
: import-w3c-tests should rely on <meta name="flags"> to detect CSS manual tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186261-20180604091200.patch (text/plain), 4.71 KB, created by
Frédéric Wang (:fredw)
on 2018-06-04 00:12:01 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Frédéric Wang (:fredw)
Created:
2018-06-04 00:12:01 PDT
Size:
4.71 KB
patch
obsolete
>Subversion Revision: 232461 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index a2cfb0d64b6129b8e9c27d1e3deb9322d283d6c4..1d93eba26bab6618bbb057e791f350f1f0df90d8 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,18 @@ >+2018-06-04 Frederic Wang <fwang@igalia.com> >+ >+ import-w3c-tests should rely on <meta name="flags"> to detect CSS manual tests >+ https://bugs.webkit.org/show_bug.cgi?id=186261 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Scripts/webkitpy/w3c/test_parser.py: >+ (TestParser.analyze_test): Also consider manual tests per CSS WG rules. >+ (TestParser.is_css_manualtest): Helper function to detect whether a file is a manual test >+ from its <meta name="flags"> tags. This is based on SourceFile::content_is_css_manual from >+ the WPT repository. >+ * Scripts/webkitpy/w3c/test_parser_unittest.py: Add a test to verify whether files with >+ <meta name="flags"> are manual are non-manual according to CSS WG rules. >+ > 2018-06-03 Fujii Hironori <Hironori.Fujii@sony.com> > > [Win][MiniBrowser] Remove gMiniBrowser global variable >diff --git a/Tools/Scripts/webkitpy/w3c/test_parser.py b/Tools/Scripts/webkitpy/w3c/test_parser.py >index 719cb8fab42a4eea945a168a05ef0755107a6222..c85a5b137d0bd0ea08b1a1099185c6c8692badf3 100644 >--- a/Tools/Scripts/webkitpy/w3c/test_parser.py >+++ b/Tools/Scripts/webkitpy/w3c/test_parser.py >@@ -116,7 +116,7 @@ class TestParser(object): > test_info = {'test': self.filename, 'reference': self.potential_ref_filename()} > test_info['reference_support_info'] = {} > # we check for wpt manual test before checking for jstest, as some WPT manual tests can be classified as CSS JS tests >- elif self.is_wpt_manualtest(): >+ elif self.is_wpt_manualtest() or self.is_css_manualtest(): > test_info = {'test': self.filename, 'manualtest': True} > elif self.is_jstest(): > test_info = {'test': self.filename, 'jstest': True} >@@ -141,6 +141,18 @@ class TestParser(object): > """Returns whether the test is a manual test according WPT rules (i.e. file ends with -manual.htm path).""" > return self.filename.endswith('-manual.htm') or self.filename.endswith('-manual.html') > >+ def is_css_manualtest(self): >+ """Returns whether the test is a manual test according to CSS WG-style rules.""" >+ # For further details and discussions, see the following links: >+ # https://web-platform-tests.org/writing-tests/css-metadata.html#requirement-flags >+ # https://github.com/web-platform-tests/wpt/issues/5381 >+ # https://github.com/web-platform-tests/wpt/issues/5293 >+ for match in self.test_doc.findAll(name='meta', attrs={'name': 'flags', 'content': True}): >+ css_flags = set(match['content'].split()) >+ if bool(css_flags & {"animated", "font", "history", "interact", "paged", "speech", "userstyle"}): >+ return True >+ return False >+ > def is_slow_test(self): > return any([match.name == 'meta' and match['name'] == 'timeout' for match in self.test_doc.findAll(content='long')]) > >diff --git a/Tools/Scripts/webkitpy/w3c/test_parser_unittest.py b/Tools/Scripts/webkitpy/w3c/test_parser_unittest.py >index 580a991d5490d9580da0d55fff90b720ec0886d1..a5ab6d45e2224f1098fe706a3702d6d0476df3aa 100644 >--- a/Tools/Scripts/webkitpy/w3c/test_parser_unittest.py >+++ b/Tools/Scripts/webkitpy/w3c/test_parser_unittest.py >@@ -168,6 +168,31 @@ class TestParserTest(unittest.TestCase): > > self.assertTrue(test_info['manualtest'], 'test_info is None') > >+ def test_analyze_css_manual_test(self): >+ """ Tests analyze_test() using a css manual test """ >+ >+ test_path = os.path.join(os.path.sep, 'some', 'madeup', 'path') >+ parser = TestParser(options, os.path.join(test_path, 'somefile.html')) >+ >+ for content in ["", "flag1", "flag1 flag2", "flag1 flag2 flag3"]: >+ test_html = """ >+<head> >+ <meta name="flags" content="%s"> >+</head>""" % content >+ test_info = parser.analyze_test(test_contents=test_html) >+ self.assertEqual(test_info, None, 'test_info is not None') >+ >+ for flag in ["animated", "font", "history", "interact", "paged", "speech", "userstyle"]: >+ test_html = """ >+<head> >+ <meta name="flags" content="flag1 flag2"> >+ <meta name="flags" content="flag3 %s flag4 flag5"> >+ <meta name="flags" content="flag6"> >+</head> >+""" % flag >+ test_info = parser.analyze_test(test_contents=test_html) >+ self.assertTrue(test_info['manualtest'], 'test with CSS flag %s is not manual' % flag) >+ > def test_analyze_pixel_test_all_true(self): > """ Tests analyze_test() using a test that is neither a reftest or jstest with all=False """ >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
youennf
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186261
: 341895