Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / dom / bindings / parser / tests / test_usvstring.py
blobeffede391cb4808ccf2218cd213b4d6aad02ab9a
1 # -*- coding: UTF-8 -*-
3 import WebIDL
6 def WebIDLTest(parser, harness):
7 parser.parse(
8 """
9 interface TestUSVString {
10 attribute USVString svs;
12 """
15 results = parser.finish()
17 harness.check(len(results), 1, "Should be one production")
18 harness.ok(isinstance(results[0], WebIDL.IDLInterface), "Should be an IDLInterface")
19 iface = results[0]
20 harness.check(
21 iface.identifier.QName(), "::TestUSVString", "Interface has the right QName"
23 harness.check(
24 iface.identifier.name, "TestUSVString", "Interface has the right name"
26 harness.check(iface.parent, None, "Interface has no parent")
28 members = iface.members
29 harness.check(len(members), 1, "Should be one member")
31 attr = members[0]
32 harness.ok(isinstance(attr, WebIDL.IDLAttribute), "Should be an IDLAttribute")
33 harness.check(
34 attr.identifier.QName(), "::TestUSVString::svs", "Attr has correct QName"
36 harness.check(attr.identifier.name, "svs", "Attr has correct name")
37 harness.check(str(attr.type), "USVString", "Attr type is the correct name")
38 harness.ok(attr.type.isUSVString(), "Should be USVString type")
39 harness.ok(attr.type.isString(), "Should be String collective type")
40 harness.ok(not attr.type.isDOMString(), "Should be not be DOMString type")