Bug 1274049. Make sure we actually codegen our various test callbacks in bindings codegen tests. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 19 May 2016 13:48:11 -0400
changeset 298162 64031b8696dfb6230ed0e16f149694014ee98e83
parent 298161 b4d88aafa06c679ac772bba4cdbb4cc8f4e51454
child 298163 3d201ae294f8adb86423b2506c6d38854498a097
push id77049
push userbzbarsky@mozilla.com
push dateThu, 19 May 2016 17:48:25 +0000
treeherdermozilla-inbound@64031b8696df [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs1274049
milestone49.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 1274049. Make sure we actually codegen our various test callbacks in bindings codegen tests. r=peterv
dom/bindings/test/TestBindingHeader.h
dom/bindings/test/TestCodeGen.webidl
--- a/dom/bindings/test/TestBindingHeader.h
+++ b/dom/bindings/test/TestBindingHeader.h
@@ -535,16 +535,42 @@ public:
   void PassNullableTreatAsNullCallback(TestTreatAsNullCallback*);
   void PassOptionalNullableTreatAsNullCallback(const Optional<RefPtr<TestTreatAsNullCallback> >&);
   void PassOptionalNullableTreatAsNullCallbackWithDefaultValue(TestTreatAsNullCallback*);
   void SetTreatAsNullCallback(TestTreatAsNullCallback&);
   already_AddRefed<TestTreatAsNullCallback> TreatAsNullCallback();
   void SetNullableTreatAsNullCallback(TestTreatAsNullCallback*);
   already_AddRefed<TestTreatAsNullCallback> GetNullableTreatAsNullCallback();
 
+  void ForceCallbackGeneration(TestIntegerReturn&,
+                               TestNullableIntegerReturn&,
+                               TestBooleanReturn&,
+                               TestFloatReturn&,
+                               TestStringReturn&,
+                               TestEnumReturn&,
+                               TestInterfaceReturn&,
+                               TestNullableInterfaceReturn&,
+                               TestExternalInterfaceReturn&,
+                               TestNullableExternalInterfaceReturn&,
+                               TestCallbackInterfaceReturn&,
+                               TestNullableCallbackInterfaceReturn&,
+                               TestCallbackReturn&,
+                               TestNullableCallbackReturn&,
+                               TestObjectReturn&,
+                               TestNullableObjectReturn&,
+                               TestTypedArrayReturn&,
+                               TestNullableTypedArrayReturn&,
+                               TestSequenceReturn&,
+                               TestNullableSequenceReturn&,
+                               TestIntegerArguments&,
+                               TestInterfaceArguments&,
+                               TestStringEnumArguments&,
+                               TestObjectArguments&,
+                               TestOptionalArguments&);
+
   // Any types
   void PassAny(JSContext*, JS::Handle<JS::Value>);
   void PassVariadicAny(JSContext*, const Sequence<JS::Value>&);
   void PassOptionalAny(JSContext*, JS::Handle<JS::Value>);
   void PassAnyDefaultNull(JSContext*, JS::Handle<JS::Value>);
   void PassSequenceOfAny(JSContext*, const Sequence<JS::Value>&);
   void PassNullableSequenceOfAny(JSContext*, const Nullable<Sequence<JS::Value> >&);
   void PassOptionalSequenceOfAny(JSContext*, const Optional<Sequence<JS::Value> >&);
--- a/dom/bindings/test/TestCodeGen.webidl
+++ b/dom/bindings/test/TestCodeGen.webidl
@@ -112,16 +112,18 @@ callback TestStringEnumArguments = void(
 callback TestObjectArguments = void(object anObj, object? anotherObj,
                                     ArrayBuffer buf, ArrayBuffer? buf2);
 callback TestOptionalArguments = void(optional DOMString aString,
                                       optional object something,
                                       optional sequence<TestInterface> aSeq,
                                       optional TestInterface? anInterface,
                                       optional TestInterface anotherInterface,
                                       optional long aLong);
+// If you add a new test callback, add it to the forceCallbackGeneration
+// method on TestInterface so it actually gets tested.
 
 TestInterface implements ImplementedInterface;
 
 // This interface is only for use in the constructor below
 interface OnlyForUseInConstructor {
 };
 
 [Constructor,
@@ -514,16 +516,43 @@ interface TestInterface {
   TestCallback receiveCallback();
   TestCallback? receiveNullableCallback();
   void passNullableTreatAsNullCallback(TestTreatAsNullCallback? arg);
   void passOptionalNullableTreatAsNullCallback(optional TestTreatAsNullCallback? arg);
   void passOptionalNullableTreatAsNullCallbackWithDefaultValue(optional TestTreatAsNullCallback? arg = null);
   attribute TestTreatAsNullCallback treatAsNullCallback;
   attribute TestTreatAsNullCallback? nullableTreatAsNullCallback;
 
+  // Force code generation of the various test callbacks we have.
+  void forceCallbackGeneration(TestIntegerReturn arg1,
+                               TestNullableIntegerReturn arg2,
+                               TestBooleanReturn arg3,
+                               TestFloatReturn arg4,
+                               TestStringReturn arg5,
+                               TestEnumReturn arg6,
+                               TestInterfaceReturn arg7,
+                               TestNullableInterfaceReturn arg8,
+                               TestExternalInterfaceReturn arg9,
+                               TestNullableExternalInterfaceReturn arg10,
+                               TestCallbackInterfaceReturn arg11,
+                               TestNullableCallbackInterfaceReturn arg12,
+                               TestCallbackReturn arg13,
+                               TestNullableCallbackReturn arg14,
+                               TestObjectReturn arg15,
+                               TestNullableObjectReturn arg16,
+                               TestTypedArrayReturn arg17,
+                               TestNullableTypedArrayReturn arg18,
+                               TestSequenceReturn arg19,
+                               TestNullableSequenceReturn arg20,
+                               TestIntegerArguments arg21,
+                               TestInterfaceArguments arg22,
+                               TestStringEnumArguments arg23,
+                               TestObjectArguments arg24,
+                               TestOptionalArguments arg25);
+
   // Any types
   void passAny(any arg);
   void passVariadicAny(any... arg);
   void passOptionalAny(optional any arg);
   void passAnyDefaultNull(optional any arg = null);
   void passSequenceOfAny(sequence<any> arg);
   void passNullableSequenceOfAny(sequence<any>? arg);
   void passOptionalSequenceOfAny(optional sequence<any> arg);