Closed Bug 911243 Opened 11 years ago Closed 11 years ago

Enable test_interfaces.html on B2G

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: emk, Assigned: emk)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch patch (obsolete) — Splinter Review
Try result:
https://tbpl.mozilla.org/?tree=Try&rev=bd4d68d02385
Attachment #797912 - Flags: review?(bugs)
Attachment #797912 - Flags: review?(bugs) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/b04073aaa278
Assignee: nobody → VYV03354
Status: NEW → ASSIGNED
Flags: in-testsuite+
Hm, Android doesn't contain "Mobile" in the user-agent string?
Attached patch patch v2Splinter Review
Android 4.0 Panda is using "Tablet" in the UA token.
Either "Tablet" or "Mobile" will always be defined on Android and B2G:
https://mxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/nsHttpHandler.cpp?rev=9d925d047ba5#683
Try result:
https://tbpl.mozilla.org/?tree=Try&rev=23413bdab693
Attachment #797912 - Attachment is obsolete: true
Attachment #798162 - Flags: review?(bugs)
Comment on attachment 798162 [details] [diff] [review]
patch v2

Review of attachment 798162 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/tests/mochitest/general/test_interfaces.html
@@ +602,5 @@
>  function createInterfaceMap(isXBLScope) {
>    var version = SpecialPowers.Cc["@mozilla.org/xre/app-info;1"].getService(SpecialPowers.Ci.nsIXULAppInfo).version;
>    var isNightly = version.endsWith("a1");
>    var isRelease = !version.contains("a");
> +  info(navigator.userAgent);

I assume you'll drop this before landing.

@@ +629,1 @@
>        interfaceMap[entry.name] = true;

Could this be written as 

interfaceMap[entry] =
  typeof(entry) === "string" ||
  (entry.xbl === isXBLScope &&
   entry.desktop === isDesktop &&
   entry.release === isRelease);

or something like that?
(In reply to :Ms2ger from comment #5)
> ::: dom/tests/mochitest/general/test_interfaces.html
> @@ +602,5 @@
> >  function createInterfaceMap(isXBLScope) {
> >    var version = SpecialPowers.Cc["@mozilla.org/xre/app-info;1"].getService(SpecialPowers.Ci.nsIXULAppInfo).version;
> >    var isNightly = version.endsWith("a1");
> >    var isRelease = !version.contains("a");
> > +  info(navigator.userAgent);
> 
> I assume you'll drop this before landing.

Sure.

> @@ +629,1 @@
> >        interfaceMap[entry.name] = true;
> 
> Could this be written as 
> 
> interfaceMap[entry] =
>   typeof(entry) === "string" ||
>   (entry.xbl === isXBLScope &&
>    entry.desktop === isDesktop &&
>    entry.release === isRelease);
> 
> or something like that?

No. De Morgan's laws don't hold here because both |undefined === true| and |undefined === false| will be evaluated to false. (I admit this code is a bit tricky.)
Attachment #798162 - Flags: review?(bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/aef6bbfe9db3
Status: ASSIGNED → RESOLVED
Closed: 11 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.

Attachment

General

Created:
Updated:
Size: