Bug 1359269 - Part 3: Add a codegen test; r=bzbarsky
authorManish Goregaokar <manishearth@gmail.com>
Sat, 02 Mar 2019 04:21:24 +0000
changeset 519956 ee5af9ad9e458273f389e6952dd74ec81ab72036
parent 519955 87d4c51be96fbcac944f48e440b0f57e845f7658
child 519957 3fccace0ea88508058cd36e13a9cff92ed7866a3
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);
+};