Bug 1238576 - disable mozApps API on desktop/Android; r=ehsan,ochameau,bz,mcmanus,jmaher,marco

This commit is contained in:
Myk Melez 2016-02-08 11:24:22 -08:00
Родитель 33ea2e8a9e
Коммит a6aff185d2
33 изменённых файлов: 75 добавлений и 66 удалений

Просмотреть файл

@ -1,8 +1,7 @@
[DEFAULT]
skip-if = (buildapp != 'b2g' && buildapp != 'mulet')
support-files =
debugger-protocol-helper.js
redirect.sjs
[test_webapps_actor.html]
# The mochitest doesn't work on fennec yet
skip-if = toolkit == 'android'

Просмотреть файл

@ -1,5 +1,5 @@
[DEFAULT]
skip-if = e10s || os == 'android'
skip-if = (buildapp != 'b2g' && buildapp != 'mulet')
support-files =
common.js
system.webapp

Просмотреть файл

@ -1,5 +1,5 @@
[DEFAULT]
skip-if = buildapp == 'b2g' || os == 'android'
skip-if = buildapp != 'mulet'
support-files =
apps/*
asmjs/*

Просмотреть файл

@ -1,4 +1,5 @@
[DEFAULT]
skip-if = buildapp != 'b2g' && buildapp != 'mulet'
support-files =
addons/application.zip
addons/invalid.webapp

Просмотреть файл

@ -19,13 +19,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=985827
var y = navigator.mozContacts;
is(x, y, "Should have gotten the same mozContacts object again");
// Test Javascript-navigator-property objects
x = navigator.mozApps;
is(typeof x, "object", "Should have a mozApps object");
delete navigator.mozApps;
y = navigator.mozApps;
is(x, y, "Should have gotten the same mozApps object again");
</script>
</head>
<body>

Просмотреть файл

@ -32,11 +32,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=985827
is(nav.mozContacts, nav.mozContacts,
"Should have gotten the same mozContacts object again");
// Test Javascript-navigator-property objects
is(typeof nav.mozApps, "object", "Should have a mozApps object");
is(nav.mozApps, nav.mozApps,
"Should have gotten the same mozApps object again");
SimpleTest.finish();
});
]]>

Просмотреть файл

@ -26,19 +26,19 @@ function test()
is(nav.foopy, undefined, "We should have an Xray now");
is(nav.wrappedJSObject.foopy, 5, "We should have the right navigator object");
var props = Object.getOwnPropertyNames(nav);
isnot(props.indexOf("mozApps"), -1,
"Should enumerate a mozApps property on navigator xray");
isnot(props.indexOf("mozContacts"), -1,
"Should enumerate a mozContacts property on navigator xray");
var nav = document.getElementById("t2").contentWindow.navigator;
is(nav.foopy, undefined, "We should have an Xray now again");
is(nav.wrappedJSObject.foopy, 5, "We should have the right navigator object again");
var found = false;
for (var name in nav) {
if (name == "mozApps") {
if (name == "mozContacts") {
found = true;
}
}
ok(found, "Should enumerate a mozApps property on navigator xray via for...in");
ok(found, "Should enumerate a mozContacts property on navigator xray via for...in");
SimpleTest.finish();
}

Просмотреть файл

@ -15,17 +15,17 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=707564
addLoadEvent(function() {
var props = Object.getOwnPropertyNames(frames[0].navigator);
isnot(props.indexOf("mozApps"), -1,
"Should enumerate a mozApps property on navigator");
isnot(props.indexOf("mozContacts"), -1,
"Should enumerate a mozContacts property on navigator");
// Now enumerate a different navigator object
var found = false;
for (var name in frames[1].navigator) {
if (name == "mozApps") {
if (name == "mozContacts") {
found = true;
}
}
ok(found, "Should enumerate a mozApps property on navigator via for...in");
ok(found, "Should enumerate a mozContacts property on navigator via for...in");
SimpleTest.finish();
});
</script>

Просмотреть файл

@ -20,7 +20,7 @@ support-files =
[test_broadcastchannel_worker.html]
[test_broadcastchannel_worker_alive.html]
[test_broadcastchannel_mozbrowser.html]
skip-if = buildapp == 'b2g'
skip-if = buildapp != 'mulet'
[test_broadcastchannel_mozbrowser2.html]
skip-if = buildapp == 'b2g'
skip-if = buildapp != 'mulet'
[test_bfcache.html]

Просмотреть файл

@ -1,5 +1,5 @@
[DEFAULT]
skip-if = buildapp == 'mulet' || (buildapp == 'b2g' && (toolkit != 'gonk' || debug))
skip-if = (buildapp != 'b2g' && buildapp != 'mulet') || (buildapp == 'b2g' && (toolkit != 'gonk' || debug))
support-files =
audio.ogg
@ -15,4 +15,4 @@ support-files =
[test_browserElement_MultipleAudioChannels.html]
tags = audiochannel
[test_browserElement_NotifyChannel.html]
tags = audiochannel
tags = audiochannel

Просмотреть файл

@ -24,9 +24,9 @@ skip-if = toolkit=='gonk' || (toolkit == 'gonk' && !debug)
[test_browserElement_oop_Alert.html]
[test_browserElement_oop_AlertInFrame.html]
[test_browserElement_oop_AllowEmbedAppsInNestedOOIframe.html]
skip-if = toolkit=='gonk'
skip-if = toolkit == 'gonk' || buildapp != 'b2g'
[test_browserElement_oop_AppFramePermission.html]
skip-if = (toolkit == 'gonk' && !debug)
skip-if = (toolkit == 'gonk' && !debug) || buildapp != 'b2g'
[test_browserElement_oop_AppWindowNamespace.html]
skip-if = (toolkit == 'gonk' && !debug)
[test_browserElement_oop_AudioChannelMutedByDefault.html]
@ -44,6 +44,7 @@ skip-if = (toolkit == 'gonk' && !debug)
[test_browserElement_oop_DOMRequestError.html]
[test_browserElement_oop_DataURI.html]
[test_browserElement_oop_DisallowEmbedAppsInOOP.html]
skip-if = buildapp != 'b2g'
[test_browserElement_oop_DocumentFirstPaint.html]
[test_browserElement_oop_Download.html]
disabled = bug 1022281

Просмотреть файл

@ -1,5 +1,5 @@
[DEFAULT]
skip-if = buildapp == 'mulet' || (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) || e10s
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) || e10s
support-files =
audio.ogg
../../../dom/media/test/short-video.ogv
@ -166,7 +166,7 @@ tags = audiochannel
skip-if = buildapp == 'b2g'
[test_browserElement_inproc_AlertInFrame.html]
[test_browserElement_inproc_AppFramePermission.html]
skip-if = toolkit == 'android' || buildapp == 'b2g'
skip-if = toolkit == 'android' || buildapp != 'mulet'
[test_browserElement_inproc_AppWindowNamespace.html]
skip-if = toolkit == 'android' || buildapp == 'b2g' # android(TIMED_OUT, bug 783509) androidx86(TIMED_OUT, bug 783509)
[test_browserElement_inproc_AudioChannelMutedByDefault.html]
@ -192,7 +192,7 @@ skip-if = (os == "android") # Disabled on Android, see bug 1230421
[test_browserElement_inproc_DOMRequestError.html]
[test_browserElement_inproc_DataURI.html]
[test_browserElement_inproc_DisallowEmbedAppsInOOP.html]
skip-if = os == "android" || toolkit == 'gonk' # embed-apps doesn't work in the mochitest app
skip-if = os == "android" || toolkit == 'gonk' || buildapp != 'mulet' # embed-apps doesn't work in the mochitest app
[test_browserElement_inproc_DocumentFirstPaint.html]
[test_browserElement_inproc_Download.html]
disabled = bug 1022281
@ -232,7 +232,7 @@ skip-if = (toolkit == 'gonk' && !debug)
# Disabled on B2G Emulator because permission cannot be asserted in content process,
# need to fix either bug 1094055 or bug 1020135.
[test_browserElement_inproc_Proxy.html]
skip-if = (toolkit == 'gonk')
skip-if = toolkit == 'gonk' || buildapp == 'mulet'
[test_browserElement_inproc_PurgeHistory.html]
[test_browserElement_inproc_ReloadPostRequest.html]
[test_browserElement_inproc_RemoveBrowserElement.html]

2
dom/cache/test/mochitest/mochitest.ini поставляемый
Просмотреть файл

@ -43,7 +43,7 @@ skip-if = e10s && debug && os == 'win'
[test_cache_restart.html]
[test_cache_shrink.html]
[test_cache_clear_on_app_uninstall.html]
skip-if = e10s || buildapp == 'b2g' # bug 1178685
skip-if = buildapp != 'mulet' || e10s # bug 1178685
[test_cache_orphaned_cache.html]
[test_cache_orphaned_body.html]
[test_cache_untrusted.html]

Просмотреть файл

@ -1,5 +1,5 @@
[DEFAULT]
skip-if = e10s
skip-if = (buildapp != 'b2g' && buildapp != 'mulet')
support-files =
file_app_install.html
file_readonly.html

Просмотреть файл

@ -361,14 +361,14 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
[test_webapp_clearBrowserData_inproc_inproc.html]
# The clearBrowserData tests are only supposed to run in the main process.
# They currently time out on android.
skip-if = buildapp == 'b2g' || e10s || toolkit == 'android'
skip-if = buildapp != 'mulet'
[test_webapp_clearBrowserData_inproc_oop.html]
# The clearBrowserData tests are only supposed to run in the main process.
# They currently time out on android.
skip-if = buildapp == 'b2g' || e10s || toolkit == 'android'
skip-if = buildapp != 'mulet'
[test_webapp_clearBrowserData_oop_inproc.html]
# The clearBrowserData tests are only supposed to run in the main process.
# They currently time out on android.
skip-if = buildapp == 'b2g' || e10s || toolkit == 'android'
skip-if = buildapp != 'mulet'
[test_serviceworker.html]
skip-if = buildapp == 'b2g'

Просмотреть файл

@ -22,11 +22,11 @@ skip-if = toolkit == 'cocoa' # disabled due to hangs, see changeset 6852e7c47edf
[test_CrashService_crash.html]
skip-if = !(crashreporter && !e10s && (toolkit == 'gtk2' || toolkit == 'gtk3' || toolkit == 'cocoa' || toolkit == 'windows') && (buildapp != 'b2g' || toolkit == 'gonk') && (buildapp != 'mulet')) # TC: Bug 1144079 - Re-enable Mulet mochitests and reftests taskcluster-specific disables.
[test_permission_for_in_process_app.html]
skip-if = e10s || os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app
skip-if = e10s || (buildapp != 'b2g' && buildapp != 'mulet') || os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app
support-files =
test_permission_helper.js
[test_permission_for_oop_app.html]
skip-if = buildapp == 'mulet' || os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app
skip-if = (buildapp != 'b2g' && buildapp != 'mulet') || os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app
support-files =
file_app.sjs
file_app.template.webapp
@ -34,7 +34,7 @@ support-files =
test_permission_embed.html
test_permission_framescript.js
[test_permission_for_nested_oop_app.html]
skip-if = os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app
skip-if = (buildapp != 'b2g' && buildapp != 'mulet') || os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app
support-files =
file_app.sjs
file_app.template.webapp
@ -42,7 +42,7 @@ support-files =
test_permission_embed.html
test_permission_framescript.js
[test_permission_for_two_oop_apps.html]
skip-if = buildapp == 'mulet' || os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app
skip-if = (buildapp != 'b2g' && buildapp != 'mulet') || os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app
support-files =
file_app.sjs
file_app.template.webapp
@ -50,7 +50,7 @@ support-files =
test_permission_embed.html
test_permission_framescript.js
[test_permission_when_oop_app_crashes.html]
skip-if = buildapp == 'mulet' || os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app
skip-if = buildapp != 'b2g' || os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app
support-files =
file_app.sjs
file_app.template.webapp

Просмотреть файл

@ -78,7 +78,7 @@ load 1080986.html
load 1122218.html
load 1127188.html
load 1157994.html
load 1158427.html
skip-if(!B2G) load 1158427.html
load 1185176.html
load 1185192.html
load 1228484.html

Просмотреть файл

@ -1,5 +1,5 @@
[DEFAULT]
skip-if = (buildapp != "browser") || e10s
skip-if = e10s
support-files =
file_hasPendingMessage.html
invalid_manifest.webapp
@ -8,4 +8,6 @@ support-files =
manifest.webapp^headers^
[test_hasPendingMessage.html]
skip-if = buildapp != "browser"
[test_sysmsg_registration.html]
skip-if = buildapp != 'mulet'

Просмотреть файл

@ -19,6 +19,7 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # b2g(https not work
[test_tcp-socket.html]
[test_udp-socket.html]
[test_webapps-manage.html]
skip-if = buildapp != 'b2g' && buildapp != 'mulet'
[test_camera.html]
disabled = disabled until bug 859593 is fixed
[test_keyboard.html]

Просмотреть файл

@ -14,7 +14,7 @@ skip-if = os == "android" || toolkit == "gonk"
[test_basic.html]
skip-if = os == "android" || toolkit == "gonk"
[test_basic_app.html]
skip-if = os == "android" || buildapp == 'b2g' || e10s # mozapps
skip-if = buildapp != 'mulet' || e10s # mozapps
[test_wakeUp.html]
run-if = buildapp == 'b2g' && toolkit == 'gonk'
[test_runNow.html]

Просмотреть файл

@ -187,6 +187,7 @@ skip-if = buildapp == 'b2g' #no ssl support
[test_ignore_unsafe_inline.html]
[test_self_none_as_hostname_confusion.html]
[test_bug949549.html]
skip-if = buildapp != 'b2g' && buildapp != 'mulet'
[test_path_matching.html]
[test_path_matching_redirect.html]
[test_report_uri_missing_in_report_only_header.html]

Просмотреть файл

@ -25,7 +25,7 @@ skip-if = buildapp == 'b2g' # Bug 1137683
[test_headers_mainthread.html]
skip-if = (e10s && debug && os == 'win')
[test_fetch_app_protocol.html]
skip-if = (e10s && debug && os == 'win')
skip-if = (buildapp != 'b2g' && buildapp != 'mulet')
[test_fetch_basic.html]
skip-if = (e10s && debug && os == 'win')
[test_fetch_basic_sw_reroute.html]

Просмотреть файл

@ -5,7 +5,9 @@ support-files =
page_blank.html
[test_app_uninstall.html]
skip-if = buildapp != 'mulet'
[test_clear_browser_data.html]
skip-if = buildapp != 'mulet'
[test_localStorageBasePrivateBrowsing_perwindowpb.html]
skip-if = true # bug 1156725
[test_localStorageFromChrome.xhtml]

Просмотреть файл

@ -152,7 +152,7 @@ function browserLoadEvent() {
setupStorage(gBrowserStorage.localStorage);
setupStorage(gBrowserStorage.sessionStorage);
navigator.mozApps.mgmt.getNotInstalled().onsuccess = function() {
navigator.mozApps.mgmt.getAll().onsuccess = function() {
for (i in this.result) {
var app = this.result[i];
if (app.manifestURL == gManifestURL) {

Просмотреть файл

@ -8,6 +8,6 @@ support-files =
[test_notification_storage.html]
[test_bug931307.html]
[test_notification_resend.html]
skip-if = e10s # On e10s, faking the app seems to be failing
skip-if = (buildapp != 'b2g' && buildapp != 'mulet') || e10s # On e10s, faking the app seems to be failing
[test_notification_noresend.html]
skip-if = (toolkit == 'gonk') # Mochitest on Gonk registers an app manifest that messes with the logic

Просмотреть файл

@ -29,7 +29,6 @@ WEBIDL_FILES = [
'AnonymousContent.webidl',
'AppInfo.webidl',
'AppNotificationServiceOptions.webidl',
'Apps.webidl',
'APZTestData.webidl',
'ArchiveReader.webidl',
'ArchiveRequest.webidl',
@ -673,7 +672,6 @@ WEBIDL_FILES += [
'DeviceStorageChangeEvent.webidl',
'DOMTransactionEvent.webidl',
'HashChangeEvent.webidl',
'MozApplicationEvent.webidl',
'MozSettingsEvent.webidl',
'PageTransitionEvent.webidl',
'PopStateEvent.webidl',
@ -796,7 +794,6 @@ GENERATED_EVENTS_WEBIDL_FILES = [
'IccChangeEvent.webidl',
'ImageCaptureErrorEvent.webidl',
'MediaStreamEvent.webidl',
'MozApplicationEvent.webidl',
'MozCellBroadcastEvent.webidl',
'MozClirModeEvent.webidl',
'MozContactChangeEvent.webidl',
@ -920,5 +917,10 @@ if CONFIG['MOZ_PAY']:
if CONFIG['MOZ_B2G']:
WEBIDL_FILES += [
'Identity.webidl'
'Apps.webidl',
'Identity.webidl',
'MozApplicationEvent.webidl'
]
GENERATED_EVENTS_WEBIDL_FILES += [
'MozApplicationEvent.webidl'
]

Просмотреть файл

@ -3,5 +3,8 @@ skip-if = buildapp == 'b2g' || os == 'android'
support-files = channel_utils.js
[test_app_uninstall_cookies.html]
skip-if = buildapp != 'mulet'
[test_app_uninstall_permissions.html]
skip-if = buildapp != 'mulet'
[test_permissionmanager_app_isolation.html]

Просмотреть файл

@ -151,8 +151,7 @@ function checkCookie() {
gCurrentCookiesCount = getCookiesCount() - appCookiesCount;
// Not installed means not installed as native app.
navigator.mozApps.mgmt.getNotInstalled().onsuccess = function() {
navigator.mozApps.mgmt.getAll().onsuccess = function() {
for (i in this.result) {
var app = this.result[i];
if (app.manifestURL == gManifestURL) {

Просмотреть файл

@ -60,12 +60,17 @@ SimpleTest.registerCleanupFunction(() =>
var gManifestURL = "http://www.example.com/chrome/dom/apps/tests/apps/basic.webapp";
// Get the permission count before installing the app so we can compare it to
// the permission count after uninstalling the app.
var currentPermissionCount = getPermissionCountForApp(-1);
function onInstall() {
var testAppId = appsService.getAppLocalIdByManifestURL(gManifestURL);
is(getPermissionCountForApp(testAppId), 0, "App should have no permission");
var currentPermissionCount = getPermissionCountForApp(-1);
// PermissionsManager.installPermissions gets run during the install process,
// and it adds the "indexedDB" permission by default, so the app should have
// that permission.
is(getPermissionCountForApp(testAppId), 1, "App should have 1 permission");
var attrs = {appId: testAppId};
var principal = secMan.createCodebasePrincipal(ioService.newURI("http://www.example.com", null, null),
@ -85,10 +90,9 @@ function onInstall() {
attrs);
permManager.addFromPrincipal(principal, "foobar", Ci.nsIPermissionManager.ALLOW_ACTION);
is(getPermissionCountForApp(testAppId), 5, "App should have 5 permissions");
is(getPermissionCountForApp(testAppId), 6, "App should have 6 permissions");
// Not installed means not installed as native app.
navigator.mozApps.mgmt.getNotInstalled().onsuccess = function() {
navigator.mozApps.mgmt.getAll().onsuccess = function() {
for (i in this.result) {
var app = this.result[i];
if (app.manifestURL == gManifestURL) {

Просмотреть файл

@ -30,7 +30,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=853283
var sb = new Cu.Sandbox(window);
sb.iwin = iwin;
sb.ok = ok;
Cu.evalInSandbox('try {iwin.navigator.mozApps; ok(true, "Didnt throw"); } catch (e) { ok(false, "Threw: " + e);}', sb);
Cu.evalInSandbox('try {iwin.navigator.mozContacts; ok(true, "Didnt throw"); } catch (e) { ok(false, "Threw: " + e);}', sb);
SimpleTest.finish();
}

Просмотреть файл

@ -34,6 +34,7 @@ skip-if = e10s || buildapp != 'browser'
[test_signed_to_signed_web_packaged_app.html]
skip-if = e10s || buildapp != 'browser' || os != 'linux'
[test_web_packaged_app.html]
skip-if = buildapp != 'mulet'
[test_loadinfo_redirectchain.html]
skip-if = buildapp == 'b2g' #no ssl support
[test_idn_redirect.html]

Просмотреть файл

@ -1,5 +1,5 @@
[DEFAULT]
skip-if = buildapp == 'mulet' || buildapp == 'b2g'
skip-if = buildapp == 'b2g'
[test_TestsRunningAfterSimpleTestFinish.html]
skip-if = true #depends on fix for bug 1048446
[test_add_task.html]
@ -19,6 +19,7 @@ support-files = file_SpecialPowersFrame1.html
support-files =
specialPowers_framescript.js
[test_SpecialPowersPushAppPermissions.html]
skip-if = buildapp != 'mulet'
support-files =
file_app.sjs
file_app.template.webapp
@ -33,7 +34,7 @@ skip-if = toolkit == 'android' || e10s #No test app installed
[test_sanity_cleanup.html]
[test_sanity_cleanup2.html]
[test_sanityEventUtils.html]
skip-if = toolkit == 'android' #bug 688052
skip-if = buildapp == 'mulet' || toolkit == 'android' #bug 688052
[test_sanitySimpletest.html]
skip-if = toolkit == 'android' #bug 688052
[test_sanity_manifest.html]

Просмотреть файл

@ -1,5 +1,9 @@
[DEFAULT]
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || os == 'android' || os == "mac" && os_version == "10.6" # see bug 993690
# Disable these tests because this code depends on mozApps, which is no longer
# enabled on the platforms this code supports (desktop, Android), so this code
# is no longer used on any platform (and will be removed by bug 1245199).
#skip-if = buildapp == 'mulet' || buildapp == 'b2g' || os == 'android' || os == "mac" && os_version == "10.6" # see bug 993690
skip-if = true
support-files =
head.js
app.sjs