diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index 387d971edb03..f626fc625b8f 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -1515,25 +1515,6 @@ Navigator::GetFeature(const nsAString& aName) return p.forget(); } // hardware.memory #endif - - // Hardcoded manifest features. Some are still b2g specific. - const char manifestFeatures[][64] = { - "manifest.origin" - , "manifest.redirects" -#ifdef MOZ_B2G - , "manifest.chrome.navigation" - , "manifest.precompile" -#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(); - } - } - // resolve with because the feature name is not supported p->MaybeResolve(JS::UndefinedHandleValue); diff --git a/dom/base/test/test_getFeature_with_perm.html b/dom/base/test/test_getFeature_with_perm.html index f418168b9714..9501c02d3aee 100644 --- a/dom/base/test/test_getFeature_with_perm.html +++ b/dom/base/test/test_getFeature_with_perm.html @@ -38,7 +38,7 @@ function testSupported() { ok(typeof mem === 'undefined', "hardware.memory is not support on this platform"); } - runNextTest(); + SimpleTest.finish(); },function(mem) { ok(false, "The Promise should not be rejected"); @@ -49,57 +49,17 @@ function testNotSupported() { var tv; navigator.getFeature("hardware.tv").then(function(tv) { ok(typeof tv === 'undefined', "Resolve the Promise with undefined value (hardware.tv)"); - runNextTest(); + testSupported(); },function(tv) { ok(false, "The Promise should not be rejected") }); } -function createManifestTest(aFeature) { - return function() { - var res; - navigator.getFeature(aFeature).then(function(res) { - info("Got " + res + " for " + aFeature); - ok(res === true, "Resolve the Promise with 'true' for " + aFeature); - runNextTest(); - },function(tv) { - ok(false, "The Promise should not be rejected") - }); - } -} - -var currentTest = -1; -var tests = [ - testNotSupported, - testSupported, - createManifestTest("manifest.origin"), - createManifestTest("manifest.redirects") -]; - -function runNextTest() { - currentTest++; - if (currentTest <= tests.length) { - tests[currentTest](); - } else { - SimpleTest.finish(); - } -} - -info("About to run " + tests.length + " tests"); - SpecialPowers.pushPermissions([ {type: "feature-detection", allow: 1, context: document} ], function() { ok('getFeature' in navigator, "navigator.getFeature should exist"); - // B2G specific manifest features. - // Touching navigator before pushPermissions makes it fail. - if (!navigator.userAgent.contains("Android") && - /Mobile|Tablet/.test(navigator.userAgent)) { - info("Adding B2G specific tests"); - tests.push(createManifestTest("manifest.chrome.navigation")); - tests.push(createManifestTest("manifest.precompile")); - } - runNextTest(); + testNotSupported(); ok(true, "Test DONE"); });