diff options
Diffstat (limited to 'third_party/WebIDL/tests/test_constructor.py')
-rw-r--r-- | third_party/WebIDL/tests/test_constructor.py | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/third_party/WebIDL/tests/test_constructor.py b/third_party/WebIDL/tests/test_constructor.py index de5d52f1412..1a08a828fd1 100644 --- a/third_party/WebIDL/tests/test_constructor.py +++ b/third_party/WebIDL/tests/test_constructor.py @@ -87,7 +87,7 @@ def WebIDLTest(parser, harness): ) sigpairs = zip(method.signatures(), signatures) - for (gotSignature, expectedSignature) in sigpairs: + for gotSignature, expectedSignature in sigpairs: (gotRetType, gotArgs) = gotSignature (expectedRetType, expectedArgs) = expectedSignature @@ -264,7 +264,7 @@ def WebIDLTest(parser, harness): parser.parse( """ interface TestFuncConstructor { - [Func="Document::IsWebAnimationsEnabled"] constructor(); + [Func="IsNotUAWidget"] constructor(); }; """ ) @@ -277,17 +277,19 @@ def WebIDLTest(parser, harness): "::TestFuncConstructor::constructor", "constructor", [("TestFuncConstructor (Wrapper)", [])], - func=["Document::IsWebAnimationsEnabled"], + func=["IsNotUAWidget"], ) parser = parser.reset() parser.parse( - """ - interface TestPrefChromeOnlySCFuncConstructor { - [ChromeOnly, Pref="dom.webidl.test1", SecureContext, Func="Document::IsWebAnimationsEnabled"] - constructor(); - }; - """ + ( + "\n" + " interface TestPrefChromeOnlySCFuncConstructor {\n" + ' [ChromeOnly, Pref="dom.webidl.test1", SecureContext, ' + 'Func="IsNotUAWidget"]\n' + " constructor();\n" + " };\n" + ) ) results = parser.finish() harness.check(len(results), 1, "Should be one production") @@ -298,7 +300,7 @@ def WebIDLTest(parser, harness): "::TestPrefChromeOnlySCFuncConstructor::constructor", "constructor", [("TestPrefChromeOnlySCFuncConstructor (Wrapper)", [])], - func=["Document::IsWebAnimationsEnabled"], + func=["IsNotUAWidget"], pref=["dom.webidl.test1"], chromeOnly=True, secureContext=True, @@ -336,7 +338,7 @@ def WebIDLTest(parser, harness): """ ) results = parser.finish() - except: + except WebIDL.WebIDLError: threw = True harness.ok(threw, "Can't have both a constructor and a ChromeOnly constructor") @@ -353,7 +355,7 @@ def WebIDLTest(parser, harness): """ ) results = parser.finish() - except: + except WebIDL.WebIDLError: threw = True harness.ok(threw, "HTMLConstructor should take no argument") @@ -370,7 +372,7 @@ def WebIDLTest(parser, harness): """ ) results = parser.finish() - except: + except WebIDL.WebIDLError: threw = True harness.ok(threw, "HTMLConstructor can't be used on a callback interface") @@ -388,7 +390,7 @@ def WebIDLTest(parser, harness): """ ) results = parser.finish() - except: + except WebIDL.WebIDLError: threw = True harness.ok(threw, "Can't have both a constructor and a HTMLConstructor") @@ -406,7 +408,7 @@ def WebIDLTest(parser, harness): """ ) results = parser.finish() - except: + except WebIDL.WebIDLError: threw = True harness.ok(threw, "Can't have both a throwing constructor and a HTMLConstructor") @@ -423,7 +425,7 @@ def WebIDLTest(parser, harness): """ ) results = parser.finish() - except: + except WebIDL.WebIDLError: threw = True harness.ok(threw, "Can't have both a HTMLConstructor and a constructor operation") @@ -441,7 +443,7 @@ def WebIDLTest(parser, harness): """ ) results = parser.finish() - except: + except WebIDL.WebIDLError: threw = True harness.ok( @@ -463,7 +465,7 @@ def WebIDLTest(parser, harness): """ ) results = parser.finish() - except: + except WebIDL.WebIDLError: threw = True harness.ok(threw, "Can't have both a ChromeOnly constructor and a HTMLConstructor") @@ -481,7 +483,7 @@ def WebIDLTest(parser, harness): """ ) results = parser.finish() - except: + except WebIDL.WebIDLError: threw = True harness.ok( @@ -502,7 +504,7 @@ def WebIDLTest(parser, harness): """ ) results = parser.finish() - except: + except WebIDL.WebIDLError: threw = True harness.ok( @@ -523,7 +525,7 @@ def WebIDLTest(parser, harness): """ ) results = parser.finish() - except: + except WebIDL.WebIDLError: threw = True harness.ok( @@ -544,7 +546,7 @@ def WebIDLTest(parser, harness): """ ) results = parser.finish() - except: + except WebIDL.WebIDLError: threw = True harness.ok( @@ -567,7 +569,7 @@ def WebIDLTest(parser, harness): """ ) results = parser.finish() - except: + except WebIDL.WebIDLError: threw = True harness.ok(threw, "Can't have a constructor operation on a partial interface") @@ -588,7 +590,7 @@ def WebIDLTest(parser, harness): """ ) results = parser.finish() - except: + except WebIDL.WebIDLError: threw = True harness.ok(threw, "Can't have a constructor operation on a mixin") |