Bug 1359269 - Part 3: Add a codegen test; r=bzbarsky
☠☠ backed out by 0c70617150d9 ☠ ☠
authorManish Goregaokar <manishearth@gmail.com>
Sat, 02 Mar 2019 01:23:12 +0000
changeset 519943 7fd8a3c1f827da2987586dfee361c1dd528fd009
parent 519942 c3f37539cb314566aef560602fecf68fe2de1602
child 519944 7705b1ebb154a5b9ec4eff507043bc9880d49bd3
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs1359269
milestone67.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 1359269 - Part 3: Add a codegen test; r=bzbarsky Depends on D19734 Differential Revision: https://phabricator.services.mozilla.com/D19735
dom/bindings/Bindings.conf
dom/bindings/test/TestBindingHeader.h
dom/bindings/test/TestCodeGen.webidl
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -1823,16 +1823,21 @@ DOMInterfaces = {
         'headerFile': 'TestBindingHeader.h',
         'register': False,
         },
 
 'TestCEReactionsInterface' : {
         'headerFile': 'TestBindingHeader.h',
         'register': False,
         },
+
+'TestAttributesOnTypes' : {
+        'headerFile': 'TestBindingHeader.h',
+        'register': False,
+        },
 }
 
 # These are temporary, until they've been converted to use new DOM bindings
 def addExternalIface(iface, nativeType=None, headerFile=None,
                      notflattened=False):
     if iface in DOMInterfaces:
         raise Exception('Interface declared both as WebIDL and External interface')
     domInterface = {
--- a/dom/bindings/test/TestBindingHeader.h
+++ b/dom/bindings/test/TestBindingHeader.h
@@ -1578,12 +1578,24 @@ class TestCEReactionsInterface : public 
   int32_t IndexedGetter(uint32_t, bool&);
   void IndexedSetter(uint32_t, int32_t);
   void NamedDeleter(const nsAString&, bool&);
   void NamedGetter(const nsAString&, bool&, nsString&);
   void NamedSetter(const nsAString&, const nsAString&);
   void GetSupportedNames(nsTArray<nsString>&);
 };
 
+class TestAttributesOnTypes : public nsISupports, public nsWrapperCache {
+ public:
+  NS_DECL_ISUPPORTS
+
+  // We need a GetParentObject and GetDocGroup to make binding codegen happy
+  virtual nsISupports* GetParentObject();
+
+  void Foo(uint8_t arg);
+  void Bar(uint8_t arg);
+  void Baz(const nsAString& arg);
+};
+
 }  // namespace dom
 }  // namespace mozilla
 
 #endif /* TestBindingHeader_h */
--- a/dom/bindings/test/TestCodeGen.webidl
+++ b/dom/bindings/test/TestCodeGen.webidl
@@ -1310,8 +1310,18 @@ interface TestHTMLConstructorInterface {
 interface TestCEReactionsInterface {
   [CEReactions] setter void (unsigned long index, long item);
   [CEReactions] setter void (DOMString name, DOMString item);
   [CEReactions] deleter void (DOMString name);
   getter long item(unsigned long index);
   getter DOMString (DOMString name);
   readonly attribute unsigned long length;
 };
+
+typedef [EnforceRange] octet OctetRange;
+typedef [Clamp] octet OctetClamp;
+typedef [TreatNullAs=EmptyString] DOMString NullEmptyString;
+
+interface TestAttributesOnTypes {
+  void foo(OctetClamp thingy);
+  void bar(OctetRange thingy);
+  void baz(NullEmptyString thingy);
+};