Closed Bug 906432 Opened 7 years ago Closed 7 years ago

Make test_interfaces.html more comprehensive

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: emk, Assigned: emk)

References

Details

Attachments

(1 file)

- Enumerating Components.interfaces will not catch WebIDL interfaces. This patch uses Object.getOwnPropertyNames() instead.
- The patched test will watch not only additions but also removals.
Attachment #791827 - Flags: review?(bugs)
Assignee: nobody → VYV03354
Status: NEW → ASSIGNED
Any chance you could handle names that are exposed based on a pref, and not based on Nightly/Aurora/etc?
Maybe possible except for ParallelArray whose supprt is determined at the build time. There's no runtime pref to control the exposure of ParallelArray.
Niko, is there some way a JS test could tell if ParallelArray is supposed to be exposed on the global or not?
Flags: needinfo?(nmatsakis)
Cu.getJSTestingFunctions().getBuildConfiguration().parallelJS ?
Comment on attachment 791827 [details] [diff] [review]
Use getOwnPropertyNames() in test_interfaces.html

+  var isNightly = version.endsWith("a1");
+  var isRelease = !version.contains("a");
Somewhat creative way to detect nightly and release.

+    // An interfae name should start with an upper case character.
interface
Hmm, so we won't catch cases when someone for some odd reason adds an
interface which starts with a lowercase character. I guess that is ok for now.

And we can add support for prefs in a followup, I think.
Attachment #791827 - Flags: review?(bugs) → review+
I guess it depends what you mean. getbuildConfiguration().parallelJS will tell you whether ENABLE_PARALLEL_JS is defined, but that's not precisely the same as whether it is SUPPOSED to be defined. If the goal is to test the makefiles, I guess the best we can do is to duplicate the knowledge that -- currently -- ParallelJS is nightly only, and of course when that changes we'll just have to update the test.
Flags: needinfo?(nmatsakis)
(In reply to Olli Pettay [:smaug] from comment #6)
> +  var isNightly = version.endsWith("a1");
> +  var isRelease = !version.contains("a");
> Somewhat creative way to detect nightly and release.

Not so creative. I stole the same logic configure uses to define NIGHTLY_BUILD/RELEASE_BUILD macros.
https://mxr.mozilla.org/mozilla-central/source/configure.in?rev=6cef967999c4#3834

(In reply to Niko Matsakis [:nmatsakis] from comment #7)
> I guess it depends what you mean. getbuildConfiguration().parallelJS will
> tell you whether ENABLE_PARALLEL_JS is defined, but that's not precisely the
> same as whether it is SUPPOSED to be defined. If the goal is to test the
> makefiles, I guess the best we can do is to duplicate the knowledge that --
> currently -- ParallelJS is nightly only, and of course when that changes
> we'll just have to update the test.

Yup, and same for pref checks. If we mean to make sure that we don't ship experimental features by accident, we should check whether the test is running on nightly/release rather than checking the pref.
https://hg.mozilla.org/mozilla-central/rev/98bfce2cdf4e
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.