Bug 1217187 - Modify navigator.hasFeature method to detect new
authorJuan Gomez <jgomez@mozilla.com>
Tue, 27 Oct 2015 13:40:41 +0800
changeset 269766 3acb49afffb780bf44607538de40c2cc68fea8ff
parent 269765 080fb640f419b9f98418be0613a582fe75a9e852
child 269767 62c2a87afdb715a6817258a3d2dde103c873c49d
push id29590
push userkwierso@gmail.com
push dateTue, 27 Oct 2015 21:12:14 +0000
treeherdermozilla-central@2b333a1d94e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1217187
milestone44.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 1217187 - Modify navigator.hasFeature method to detect new replaceable homescreen and add the unit test. r=ehsan
dom/base/Navigator.cpp
dom/base/test/test_getFeature_with_perm.html
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -1618,16 +1618,17 @@ Navigator::HasFeature(const nsAString& a
 
   // Hardcoded manifest features. Some are still b2g specific.
   const char manifestFeatures[][64] = {
     "manifest.origin"
   , "manifest.redirects"
 #ifdef MOZ_B2G
   , "manifest.chrome.navigation"
   , "manifest.precompile"
+  , "manifest.role.homescreen"
 #endif
   };
 
   nsAutoCString feature = NS_ConvertUTF16toUTF8(aName);
   for (uint32_t i = 0; i < MOZ_ARRAY_LENGTH(manifestFeatures); i++) {
     if (feature.Equals(manifestFeatures[i])) {
       p->MaybeResolve(true);
       return p.forget();
--- a/dom/base/test/test_getFeature_with_perm.html
+++ b/dom/base/test/test_getFeature_with_perm.html
@@ -121,16 +121,17 @@ SpecialPowers.pushPermissions([
   ok('hasFeature' in navigator, "navigator.hasFeature should exist");
   // B2G specific manifest features.
   // Touching navigator before pushPermissions makes it fail.
   if (!navigator.userAgent.includes("Android") &&
         /Mobile|Tablet/.test(navigator.userAgent)) {
     info("Adding B2G specific tests");
     tests.push(createManifestTest("manifest.chrome.navigation"));
     tests.push(createManifestTest("manifest.precompile"));
+    tests.push(createManifestTest("manifest.role.homescreen"));
   }
   runNextTest();
   ok(true, "Test DONE");
 });
 
 SimpleTest.waitForExplicitFinish();
 
 </script>