Bug 1251042: Enable mochitests for extensions to run on Android. r=nalexander
authorMatthew Wein <mwein@mozilla.com>
Fri, 25 Mar 2016 19:52:19 -0700
changeset 290709 e1f49f739dfde973e064e2419e4a3dafd7f93d37
parent 290708 3357cb502d0c5a987083a3d0ea196d3d77fa12bd
child 290710 601ab3bdf31c3ee85e2183c2ec146164a1f6afa2
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1251042
milestone48.0a1
Bug 1251042: Enable mochitests for extensions to run on Android. r=nalexander MozReview-Commit-ID: FeI5bexmPg4
dom/tests/mochitest/notification/mochitest.ini
mobile/android/chrome/content/content.js
mobile/android/installer/package-manifest.in
toolkit/components/extensions/test/mochitest/chrome.ini
toolkit/components/extensions/test/mochitest/mochitest.ini
toolkit/components/passwordmgr/test/mochitest.ini
toolkit/components/passwordmgr/test/mochitest/mochitest.ini
--- a/dom/tests/mochitest/notification/mochitest.ini
+++ b/dom/tests/mochitest/notification/mochitest.ini
@@ -2,12 +2,13 @@
 
 support-files =
   MockServices.js
   NotificationTest.js
 
 [test_notification_basics.html]
 [test_notification_storage.html]
 [test_bug931307.html]
+skip-if = (os == 'android') # Bug 1258975 on android.
 [test_notification_resend.html]
 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
--- a/mobile/android/chrome/content/content.js
+++ b/mobile/android/chrome/content/content.js
@@ -1,15 +1,16 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
+Cu.import("resource://gre/modules/ExtensionContent.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "AboutReader", "resource://gre/modules/AboutReader.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode", "resource://gre/modules/ReaderMode.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "LoginManagerContent", "resource://gre/modules/LoginManagerContent.jsm");
 
 var dump = Cu.import("resource://gre/modules/AndroidLog.jsm", {}).AndroidLog.d.bind(null, "Content");
@@ -99,8 +100,14 @@ var AboutReaderListener = {
     }
   },
 };
 AboutReaderListener.init();
 
 addMessageListener("RemoteLogins:fillForm", function(message) {
   LoginManagerContent.receiveMessage(message, content);
 });
+
+ExtensionContent.init(this);
+addEventListener("unload", () => {
+  ExtensionContent.uninit(this);
+});
+
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -305,16 +305,18 @@
 @BINPATH@/components/nsLoginInfo.js
 @BINPATH@/components/nsLoginManager.js
 @BINPATH@/components/nsLoginManagerPrompter.js
 @BINPATH@/components/storage-mozStorage.js
 @BINPATH@/components/crypto-SDR.js
 @BINPATH@/components/NetworkGeolocationProvider.manifest
 @BINPATH@/components/NetworkGeolocationProvider.js
 @BINPATH@/components/extensions.manifest
+@BINPATH@/components/utils.manifest
+@BINPATH@/components/simpleServices.js
 @BINPATH@/components/addonManager.js
 @BINPATH@/components/amContentHandler.js
 @BINPATH@/components/amInstallTrigger.js
 @BINPATH@/components/amWebInstallListener.js
 @BINPATH@/components/nsBlocklistService.js
 #ifndef RELEASE_BUILD
 @BINPATH@/components/TabSource.js
 #endif
--- a/toolkit/components/extensions/test/mochitest/chrome.ini
+++ b/toolkit/components/extensions/test/mochitest/chrome.ini
@@ -1,14 +1,14 @@
 [DEFAULT]
-skip-if = os == 'android'
 support-files =
   file_download.html
   file_download.txt
   interruptible.sjs
   file_sample.html
 
 [test_chrome_ext_downloads_download.html]
 [test_chrome_ext_downloads_misc.html]
 skip-if = 1 # Currently causes too many intermittent failures.
 [test_chrome_ext_downloads_search.html]
 [test_chrome_ext_eventpage_warning.html]
 [test_chrome_ext_contentscript_unrecognizedprop_warning.html]
+skip-if = (os == 'android') # browser.tabs is undefined. Bug 1258975 on android.
--- a/toolkit/components/extensions/test/mochitest/mochitest.ini
+++ b/toolkit/components/extensions/test/mochitest/mochitest.ini
@@ -1,10 +1,10 @@
 [DEFAULT]
-skip-if = os == 'android' || buildapp == 'mulet'
+skip-if = buildapp == 'mulet' || asan
 support-files =
   head.js
   file_WebRequest_page1.html
   file_WebRequest_page2.html
   file_WebNavigation_page1.html
   file_WebNavigation_page2.html
   file_WebNavigation_page3.html
   file_image_good.png
@@ -39,40 +39,42 @@ skip-if = buildapp == 'b2g' # runat != d
 [test_ext_generate.html]
 [test_ext_idle.html]
 [test_ext_localStorage.html]
 [test_ext_onmessage_removelistener.html]
 [test_ext_notifications.html]
 [test_ext_permission_xhr.html]
 skip-if = buildapp == 'b2g' # JavaScript error: jar:remoteopenfile:///data/local/tmp/generated-extension.xpi!/content.js, line 46: NS_ERROR_ILLEGAL_VALUE:
 [test_ext_runtime_connect.html]
-skip-if = buildapp == 'b2g' # port.sender.tab is undefined on b2g.
+skip-if = (os == 'android' || buildapp == 'b2g') # port.sender.tab is undefined on b2g. Bug 1258975 on android.
 [test_ext_runtime_connect2.html]
-skip-if = buildapp == 'b2g' # port.sender.tab is undefined on b2g.
+skip-if = (os == 'android' || buildapp == 'b2g') # port.sender.tab is undefined on b2g. Bug 1258975 on android.
 [test_ext_runtime_disconnect.html]
 [test_ext_runtime_getPlatformInfo.html]
 [test_ext_runtime_sendMessage.html]
 [test_ext_sandbox_var.html]
 [test_ext_sendmessage_reply.html]
-skip-if = buildapp == 'b2g' # sender.tab is undefined on b2g.
+skip-if = (os == 'android' || buildapp == 'b2g') # sender.tab is undefined on b2g. Bug 1258975 on android.
 [test_ext_sendmessage_reply2.html]
-skip-if = buildapp == 'b2g' # sender.tab is undefined on b2g.
+skip-if = (os == 'android' || buildapp == 'b2g') # sender.tab is undefined on b2g. Bug 1258975 on android.
 [test_ext_sendmessage_doublereply.html]
-skip-if = buildapp == 'b2g' # sender.tab is undefined on b2g.
+skip-if = (os == 'android' || buildapp == 'b2g') # sender.tab is undefined on b2g. Bug 1258975 on android.
 [test_ext_storage.html]
 [test_ext_background_runtime_connect_params.html]
 [test_ext_cookies.html]
 [test_ext_cookies_permissions.html]
 skip-if = e10s || buildapp == 'b2g' # Uses cookie service via SpecialPowers.Services, which does not support e10s.
 [test_ext_bookmarks.html]
-skip-if = buildapp == 'b2g' # unimplemented api.
+skip-if = (os == 'android' || buildapp == 'b2g') # unimplemented api. Bug 1258975 on android.
 [test_ext_alarms.html]
 [test_ext_background_window_properties.html]
 [test_ext_background_sub_windows.html]
 [test_ext_background_api_injection.html]
 [test_ext_jsversion.html]
 skip-if = e10s || buildapp == 'b2g' # Uses a console monitor which doesn't work from a content process. The code being tested doesn't run in a tab content process in any case.
 [test_ext_i18n.html]
+skip-if = (os == 'android') # Bug 1258975 on android.
 [test_ext_web_accessible_resources.html]
+skip-if = (os == 'android') # Bug 1258975 on android.
 [test_ext_webrequest.html]
-skip-if = buildapp == 'b2g' # webrequest api uninplemented (bug 1199504)
+skip-if = (os == 'android' || buildapp == 'b2g') # webrequest api uninplemented (bug 1199504). Bug 1258975 on android.
 [test_ext_webnavigation.html]
-skip-if = buildapp == 'b2g' # needs TabManager which is not yet implemented
+skip-if = (os == 'android' || buildapp == 'b2g') # needs TabManager which is not yet implemented. Bug 1258975 on android.
--- a/toolkit/components/passwordmgr/test/mochitest.ini
+++ b/toolkit/components/passwordmgr/test/mochitest.ini
@@ -14,25 +14,25 @@ support-files =
   subtst_privbrowsing_1.html
   subtst_privbrowsing_2.html
   subtst_privbrowsing_3.html
   subtst_privbrowsing_4.html
   subtst_prompt_async.html
 
 [test_basic_form_2pw_2.html]
 [test_basic_form_autocomplete.html]
-skip-if = toolkit == 'android'
+skip-if = toolkit == 'android' # Bug 1258975 on android.
 [test_bug_627616.html]
-skip-if = toolkit == 'android' #TIMED_OUT
+skip-if = toolkit == 'android' # Bug 1258975 on android.
 [test_master_password.html]
-skip-if = toolkit == 'android' #TIMED_OUT
+skip-if = toolkit == 'android' # Bug 1258975 on android.
 [test_master_password_cleanup.html]
-skip-if = toolkit == 'android'
+skip-if = toolkit == 'android' # Bug 1258975 on android.
 [test_notifications_popup.html]
-skip-if = true || os == "linux" || toolkit == 'android' # bug 934057
+skip-if = true || os == "linux" || toolkit == 'android' # bug 934057. Bug 1258975 on android.
 [test_prompt.html]
-skip-if = os == "linux" || toolkit == 'android' #TIMED_OUT
+skip-if = os == "linux" || toolkit == 'android' # Bug 1258975 on android.
 [test_prompt_async.html]
-skip-if = toolkit == 'android' #TIMED_OUT
+skip-if = toolkit == 'android' # Bug 1258975 on android.
 [test_xhr.html]
-skip-if = toolkit == 'android' #TIMED_OUT
+skip-if = toolkit == 'android' # Bug 1258975 on android.
 [test_xml_load.html]
-skip-if = toolkit == 'android' #TIMED_OUT
+skip-if = toolkit == 'android' # Bug 1258975 on android.
\ No newline at end of file
--- a/toolkit/components/passwordmgr/test/mochitest/mochitest.ini
+++ b/toolkit/components/passwordmgr/test/mochitest/mochitest.ini
@@ -25,9 +25,10 @@ skip-if = toolkit == 'android' # autocom
 [test_form_action_javascript.html]
 [test_formless_autofill.html]
 skip-if = toolkit == 'android' # Bug 1259768
 [test_input_events.html]
 [test_input_events_for_identical_values.html]
 [test_maxlength.html]
 [test_passwords_in_type_password.html]
 [test_recipe_login_fields.html]
-[test_xhr_2.html]
+skip-if = (toolkit == 'android') # Bug 1258975 on android.
+[test_xhr_2.html]
\ No newline at end of file