Bug 1482496 [wpt PR 12521] - [Gecko Bug 1482496] Support list values in wptmanifest conditionals, a=testonly
authorJames Graham <james@hoppipolla.co.uk>
Wed, 22 Aug 2018 13:25:24 +0000
changeset 490859 cf6017cb3dbee58e85e0ce695f95f3524b5d4322
parent 490858 1c9b6e275c9c860b222e497a08b4f0a064f0134b
child 490860 1d5305c4aa56e9b5d07acc940e40acaa47d3fd38
push id1815
push userffxbld-merge
push dateMon, 15 Oct 2018 10:40:45 +0000
treeherdermozilla-release@18d4c09e9378 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1482496, 12521
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1482496 [wpt PR 12521] - [Gecko Bug 1482496] Support list values in wptmanifest conditionals, a=testonly Automatic update from web-platform-testsSupport list values in wptmanifest conditionals We were previously considering the grammar for conditionals in wpt manifests to be something like: "if " expr ":" string This excluded the possibilty of complex values on the RHS. Here we change it to the more obvious (and intended) "if " expr ":" value Differential Revision: https://phabricator.services.mozilla.com/D3127 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1482496 gecko-commit: ae52877671adab5f4a00e7887c6806dc26aa7cfa gecko-integration-branch: autoland gecko-reviewers: ato -- Fix test failures -- wpt-commits: 77eb4118c5f7ba8b460b7df838fd03488072fbc1, 0b6cd235f8be14633260ff4a18202ec7edf0700e wpt-pr: 12521
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/tools/wptrunner/wptrunner/tests/test_wpttest.py
testing/web-platform/tests/tools/wptrunner/wptrunner/wptmanifest/tests/test_parser.py
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -643788,17 +643788,17 @@
    "556b2b7f3fa48212fbf9c2b0279793f2ec48bacb",
    "support"
   ],
   "tools/wptrunner/wptrunner/tests/test_update.py": [
    "5ab2f69fa58e5763fd2c6f3c3a562f44401f0592",
    "support"
   ],
   "tools/wptrunner/wptrunner/tests/test_wpttest.py": [
-   "827244cda3c5cc94d2bdb8becad1fe5c5253828b",
+   "5280e46a6b243326e2303bb554ada4a726bd7203",
    "support"
   ],
   "tools/wptrunner/wptrunner/update/__init__.py": [
    "9ff3e69f94efbf3e803a8a65c46d09c0269ca063",
    "support"
   ],
   "tools/wptrunner/wptrunner/update/base.py": [
    "547808e529330e3c10e61f50e7dcb80a838f2897",
@@ -643872,17 +643872,17 @@
    "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
    "support"
   ],
   "tools/wptrunner/wptrunner/wptmanifest/tests/test_conditional.py": [
    "9da1a0f180ca23e8cadb2c9b430e983ba75dbca0",
    "support"
   ],
   "tools/wptrunner/wptrunner/wptmanifest/tests/test_parser.py": [
-   "87ddfeed891742519c59b33aa0806f635c16a5cc",
+   "98b54dc11ea8a033b8ee626b5f8bb924759959cc",
    "support"
   ],
   "tools/wptrunner/wptrunner/wptmanifest/tests/test_serializer.py": [
    "f7c3ca24c709f1b462700de45decf0a51de8949a",
    "support"
   ],
   "tools/wptrunner/wptrunner/wptmanifest/tests/test_static.py": [
    "f63869636da79cdcdc961e137d4f044055d74de4",
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/tests/test_wpttest.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/tests/test_wpttest.py
@@ -20,16 +20,24 @@ tags: [b, c]
 
 test_0 = """\
 [0.html]
   prefs: [c:d]
   max-asserts: 3
   tags: [a, @Reset]
 """
 
+test_1 = """\
+[1.html]
+  prefs:
+    if os == 'win': [a:b, c:d]
+  expected:
+    if os == 'win': FAIL
+"""
+
 
 def test_metadata_inherit():
     tests = make_mock_manifest(("test", "a", 10), ("test", "a/b", 10),
                                ("test", "c", 10))
 
     inherit_metadata = [
         manifestexpected.static.compile(
             BytesIO(item),
@@ -48,16 +56,19 @@ def test_metadata_inherit():
     assert test_obj.min_assertion_count == 1
     assert test_obj.prefs == {"b": "c", "c": "d"}
     assert test_obj.tags == {"a", "dir:a"}
 
 
 def test_conditional():
     tests = make_mock_manifest(("test", "a", 10), ("test", "a/b", 10),
                                ("test", "c", 10))
-    test_metadata = manifestexpected.static.compile(BytesIO(test_0),
-                                                    {},
+
+    test_metadata = manifestexpected.static.compile(BytesIO(test_1),
+                                                    {"os": "win"},
                                                     data_cls_getter=manifestexpected.data_cls_getter,
                                                     test_path="a",
                                                     url_base="")
+
+    test = tests[1][2].pop()
     test_obj = wpttest.from_manifest(test, [], test_metadata.get_test(test.id))
     assert test_obj.prefs == {"a": "b", "c": "d"}
     assert test_obj.expected() == "FAIL"
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/wptmanifest/tests/test_parser.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/wptmanifest/tests/test_parser.py
@@ -71,20 +71,19 @@ key:
             ["DataNode", None,
              [["KeyValueNode", "key",
                [["ConditionalNode", None,
                  [["BinaryExpressionNode", None,
                    [["BinaryOperatorNode", "==", []],
                     ["VariableNode", "x", []],
                        ["NumberNode", "1", []]
                     ]],
-                     ["ListNode", None,
-                      [["ValueNode", "value1", []],
-                       ["ValueNode", "value2", []],
-                      ]],
+                  ["ListNode", None,
+                   [["ValueNode", "value1", []],
+                    ["ValueNode", "value2", []]]],
                   ]]]]]]
         )
 
     def test_expr_3(self):
         self.compare(
             """
 key:
   if x == 1: if b: value""",