Bug 906096 - Move InputMethod API behind a pref instead of build option. r=kanru, r=sicking
authorJan Jongboom <janjongboom@gmail.com>
Thu, 26 Sep 2013 03:38:41 +0800
changeset 149056 20fd078c8c25aa2808770604475a92fb0114da1a
parent 149055 08c868d1770a9c60b83dafe5c236ccd60b216630
child 149057 83f7bb56300bf6ffb09db1466064e831792ec888
push id25367
push userkwierso@gmail.com
push dateSat, 28 Sep 2013 02:36:01 +0000
treeherdermozilla-central@b3bb2171ff2b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskanru, sicking
bugs906096
milestone27.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 906096 - Move InputMethod API behind a pref instead of build option. r=kanru, r=sicking
b2g/app/b2g.js
b2g/components/B2GComponents.manifest
b2g/components/Keyboard.jsm
b2g/components/MozKeyboard.js
b2g/components/b2g.idl
b2g/components/moz.build
b2g/installer/package-manifest.in
browser/installer/package-manifest.in
dom/inputmethod/InputMethod.manifest
dom/inputmethod/Keyboard.jsm
dom/inputmethod/MozKeyboard.js
dom/inputmethod/moz.build
dom/inputmethod/nsIB2GKeyboard.idl
dom/moz.build
dom/webidl/InputMethod.webidl
dom/webidl/moz.build
modules/libpref/src/init/all.js
security/manager/ssl/tests/unit/test_signed_apps-marketplace.js
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -789,16 +789,19 @@ pref("dom.promise.enabled", false);
 pref("dom.inter-app-communication-api.enabled", true);
 #endif
 
 // Allow ADB to run for this many hours before disabling
 // (only applies when marionette is disabled)
 // 0 disables the timer.
 pref("b2g.adb.timeout-hours", 12);
 
+// InputMethod so we can do soft keyboards
+pref("dom.mozInputMethod.enabled", true);
+
 // Absolute path to the devtool unix domain socket file used
 // to communicate with a usb cable via adb forward
 pref("devtools.debugger.unix-domain-socket", "/data/local/debugger-socket");
 
 // enable Skia/GL (OpenGL-accelerated 2D drawing) for large enough 2d canvases,
 // falling back to Skia/software for smaller canvases
 pref("gfx.canvas.azure.backends", "skia");
 pref("gfx.canvas.azure.accelerated", true);
--- a/b2g/components/B2GComponents.manifest
+++ b/b2g/components/B2GComponents.manifest
@@ -10,24 +10,16 @@ component {8c719f03-afe0-4aac-91ff-6c215
 contract @mozilla.org/content-permission/prompt;1 {8c719f03-afe0-4aac-91ff-6c215895d467}
 
 #ifdef MOZ_UPDATER
 # UpdatePrompt.js
 component {88b3eb21-d072-4e3b-886d-f89d8c49fe59} UpdatePrompt.js
 contract @mozilla.org/updates/update-prompt;1 {88b3eb21-d072-4e3b-886d-f89d8c49fe59}
 #endif
 
-# MozKeyboard.js
-component {397a7fdf-2254-47be-b74e-76625a1a66d5} MozKeyboard.js
-contract @mozilla.org/b2g-keyboard;1 {397a7fdf-2254-47be-b74e-76625a1a66d5}
-category JavaScript-navigator-property mozKeyboard @mozilla.org/b2g-keyboard;1
-
-component {4607330d-e7d2-40a4-9eb8-43967eae0142} MozKeyboard.js
-contract @mozilla.org/b2g-inputmethod;1 {4607330d-e7d2-40a4-9eb8-43967eae0142}
-
 # DirectoryProvider.js
 component {9181eb7c-6f87-11e1-90b1-4f59d80dd2e5} DirectoryProvider.js
 contract @mozilla.org/browser/directory-provider;1 {9181eb7c-6f87-11e1-90b1-4f59d80dd2e5}
 category xpcom-directory-providers browser-directory-provider @mozilla.org/browser/directory-provider;1
 
 # ActivitiesGlue.js
 component {70a83123-7467-4389-a309-3e81c74ad002} ActivitiesGlue.js
 contract @mozilla.org/dom/activities/ui-glue;1 {70a83123-7467-4389-a309-3e81c74ad002}
--- a/b2g/components/b2g.idl
+++ b/b2g/components/b2g.idl
@@ -1,80 +1,12 @@
 /* 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/. */
 
 #include "domstubs.idl"
 
-interface nsIDOMDOMRequest;
-
 [scriptable, uuid(3615a616-571d-4194-bf54-ccf546067b14)]
 interface nsIB2GCameraContent : nsISupports
 {
   /* temporary solution, waiting for getUserMedia */
   DOMString getCameraURI([optional] in jsval options);
 };
-
-[scriptable, uuid(40ad96b2-9efa-41fb-84c7-fbcec9b153f0)]
-interface nsIB2GKeyboard : nsISupports
-{
-  void sendKey(in long keyCode, in long charCode);
-
-  // Select the <select> option specified by index.
-  // If this method is called on a <select> that support multiple
-  // selection, then the option specified by index will be added to
-  // the selection.
-  // If this method is called for a select that does not support multiple
-  // selection the previous element will be unselected.
-  void setSelectedOption(in jsval index);
-
-  // Select the <select> options specified by indexes. All other options
-  // will be deselected.
-  // If this method is called for a <select> that does not support multiple
-  // selection, then the last index specified in indexes will be selected.
-  void setSelectedOptions(in jsval indexes);
-
-  // Set the value on the currently focused element. This has to be used
-  // for special situations where the value had to be chosen amongst a
-  // list (type=month) or a widget (type=date, time, etc.).
-  // If the value passed in parameter isn't valid (in the term of HTML5
-  // Forms Validation), the value will simply be ignored by the element.
-  void setValue(in jsval value);
-
-  void removeFocus();
-
-  attribute nsIDOMEventListener onfocuschange;
-
-  // Fires when user moves the cursor, changes the selection, or alters the
-  // composing text length
-  attribute nsIDOMEventListener onselectionchange;
-
-  // The start position of the selection.
-  readonly attribute long selectionStart;
-
-  // The stop position of the selection.
-  readonly attribute long selectionEnd;
-
-  /*
-   * Set the selection range of the the editable text.
-   *
-   * @param start The beginning of the selected text.
-   * @param end The end of the selected text.
-   *
-   * Note that the start position should be less or equal to the end position.
-   * To move the cursor, set the start and end position to the same value.
-   */
-  void setSelectionRange(in long start, in long end);
-
-  /*
-   * Replace text around the beginning of the current selection range of the
-   * editable text.
-   *
-   * @param text The string to be replaced with.
-   * @param beforeLength The number of characters to be deleted before the
-   * beginning of the current selection range. Defaults to 0.
-   * @param afterLength The number of characters to be deleted after the
-   * beginning of the current selection range. Defaults to 0.
-   */
-  void replaceSurroundingText(in DOMString text,
-                              [optional] in long beforeLength,
-                              [optional] in long afterLength);
-};
--- a/b2g/components/moz.build
+++ b/b2g/components/moz.build
@@ -15,17 +15,16 @@ MODULE = 'B2GComponents'
 EXTRA_COMPONENTS += [
     'ActivitiesGlue.js',
     'AlertsService.js',
     'B2GAboutRedirector.js',
     'ContentHandler.js',
     'ContentPermissionPrompt.js',
     'FilePicker.js',
     'MailtoProtocolHandler.js',
-    'MozKeyboard.js',
     'PaymentGlue.js',
     'ProcessGlobal.js',
     'SmsProtocolHandler.js',
     'TelProtocolHandler.js',
     'WebappsUpdateTimer.js',
     'YoutubeProtocolHandler.js',
 ]
 
@@ -37,13 +36,12 @@ EXTRA_PP_COMPONENTS += [
 
 if CONFIG['MOZ_UPDATER']:
     EXTRA_PP_COMPONENTS += [
         'UpdatePrompt.js',
     ]
 
 EXTRA_JS_MODULES += [
     'ErrorPage.jsm',
-    'Keyboard.jsm',
     'SignInToWebsite.jsm',
     'TelURIParser.jsm',
     'WebappsUpdater.jsm',
 ]
--- a/b2g/installer/package-manifest.in
+++ b/b2g/installer/package-manifest.in
@@ -185,16 +185,17 @@
 @BINPATH@/components/dom_events.xpt
 @BINPATH@/components/dom_file.xpt
 @BINPATH@/components/dom_geolocation.xpt
 @BINPATH@/components/dom_media.xpt
 @BINPATH@/components/dom_network.xpt
 @BINPATH@/components/dom_notification.xpt
 @BINPATH@/components/dom_html.xpt
 @BINPATH@/components/dom_indexeddb.xpt
+@BINPATH@/components/dom_inputmethod.xpt
 @BINPATH@/components/dom_offline.xpt
 @BINPATH@/components/dom_payment.xpt
 @BINPATH@/components/dom_json.xpt
 @BINPATH@/components/dom_messages.xpt
 @BINPATH@/components/dom_power.xpt
 @BINPATH@/components/dom_quota.xpt
 @BINPATH@/components/dom_range.xpt
 @BINPATH@/components/dom_settings.xpt
@@ -542,16 +543,20 @@
 @BINPATH@/components/AppProtocolHandler.js
 @BINPATH@/components/AppProtocolHandler.manifest
 
 @BINPATH@/components/Payment.js
 @BINPATH@/components/PaymentFlowInfo.js
 @BINPATH@/components/PaymentRequestInfo.js
 @BINPATH@/components/Payment.manifest
 
+; InputMethod API
+@BINPATH@/components/MozKeyboard.js
+@BINPATH@/components/InputMethod.manifest
+
 ; Modules
 @BINPATH@/modules/*
 
 ; Safe Browsing
 @BINPATH@/components/nsURLClassifier.manifest
 @BINPATH@/components/nsUrlClassifierHashCompleter.js
 @BINPATH@/components/nsUrlClassifierListManager.js
 @BINPATH@/components/nsUrlClassifierLib.js
@@ -743,17 +748,16 @@ bin/components/@DLL_PREFIX@nkgnomevfs@DL
 @BINPATH@/components/marionettecomponent.js
 #endif
 @BINPATH@/components/AlertsService.js
 @BINPATH@/components/ContentPermissionPrompt.js
 #ifdef MOZ_UPDATER
 @BINPATH@/components/UpdatePrompt.js
 #endif
 @BINPATH@/components/WebappsUpdateTimer.js
-@BINPATH@/components/MozKeyboard.js
 @BINPATH@/components/DirectoryProvider.js
 @BINPATH@/components/ActivitiesGlue.js
 @BINPATH@/components/ProcessGlobal.js
 @BINPATH@/components/ContentHandler.js
 @BINPATH@/components/PaymentGlue.js
 @BINPATH@/components/YoutubeProtocolHandler.js
 @BINPATH@/components/RecoveryService.js
 @BINPATH@/components/MailtoProtocolHandler.js
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -195,16 +195,17 @@
 @BINPATH@/components/dom_events.xpt
 @BINPATH@/components/dom_file.xpt
 @BINPATH@/components/dom_geolocation.xpt
 @BINPATH@/components/dom_media.xpt
 @BINPATH@/components/dom_network.xpt
 @BINPATH@/components/dom_notification.xpt
 @BINPATH@/components/dom_html.xpt
 @BINPATH@/components/dom_indexeddb.xpt
+@BINPATH@/components/dom_inputmethod.xpt
 @BINPATH@/components/dom_offline.xpt
 @BINPATH@/components/dom_json.xpt
 @BINPATH@/components/dom_power.xpt
 @BINPATH@/components/dom_quota.xpt
 @BINPATH@/components/dom_range.xpt
 @BINPATH@/components/dom_settings.xpt
 @BINPATH@/components/dom_permissionsettings.xpt
 @BINPATH@/components/dom_sidebar.xpt
@@ -551,16 +552,20 @@
 @BINPATH@/chrome/marionette.manifest
 @BINPATH@/components/MarionetteComponents.manifest
 @BINPATH@/components/marionettecomponent.js
 
 #ifdef MOZ_WEBSPEECH
 @BINPATH@/components/dom_webspeechsynth.xpt
 #endif
 
+; InputMethod API
+@BINPATH@/components/MozKeyboard.js
+@BINPATH@/components/InputMethod.manifest
+
 ; Modules
 @BINPATH@/browser/modules/*
 @BINPATH@/modules/*
 
 ; Safe Browsing
 #ifdef MOZ_URL_CLASSIFIER
 @BINPATH@/components/nsURLClassifier.manifest
 @BINPATH@/components/nsUrlClassifierHashCompleter.js
new file mode 100644
--- /dev/null
+++ b/dom/inputmethod/InputMethod.manifest
@@ -0,0 +1,6 @@
+component {397a7fdf-2254-47be-b74e-76625a1a66d5} MozKeyboard.js
+contract @mozilla.org/b2g-keyboard;1 {397a7fdf-2254-47be-b74e-76625a1a66d5}
+category JavaScript-navigator-property mozKeyboard @mozilla.org/b2g-keyboard;1
+
+component {4607330d-e7d2-40a4-9eb8-43967eae0142} MozKeyboard.js
+contract @mozilla.org/b2g-inputmethod;1 {4607330d-e7d2-40a4-9eb8-43967eae0142}
rename from b2g/components/Keyboard.jsm
rename to dom/inputmethod/Keyboard.jsm
rename from b2g/components/MozKeyboard.js
rename to dom/inputmethod/MozKeyboard.js
--- a/b2g/components/MozKeyboard.js
+++ b/dom/inputmethod/MozKeyboard.js
@@ -326,17 +326,17 @@ MozInputMethod.prototype = {
     // Don't bypass the permission check if not in testing mode.
     if (!isTesting) {
       let principal = win.document.nodePrincipal;
       let perm = Services.perms
                  .testExactPermissionFromPrincipal(principal, "keyboard");
       if (perm != Ci.nsIPermissionManager.ALLOW_ACTION) {
         dump("No permission to use the keyboard API for " +
              principal.origin + "\n");
-        return null;
+        return;
       }
     }
 
     this._window = win;
     this._mgmt = new MozInputMethodManager(win);
     this.innerWindowID = win.QueryInterface(Ci.nsIInterfaceRequestor)
                             .getInterface(Ci.nsIDOMWindowUtils)
                             .currentInnerWindowID;
new file mode 100644
--- /dev/null
+++ b/dom/inputmethod/moz.build
@@ -0,0 +1,26 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# 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/.
+
+XPIDL_SOURCES += [
+    'nsIB2GKeyboard.idl',
+]
+
+XPIDL_MODULE = 'dom_inputmethod'
+
+MODULE = 'dom'
+
+EXTRA_COMPONENTS += [
+    'InputMethod.manifest',
+    'MozKeyboard.js',
+]
+
+EXTRA_JS_MODULES += [
+    'Keyboard.jsm',
+]
+
+FAIL_ON_WARNINGS = True
+
+LIBXUL_LIBRARY = True
new file mode 100644
--- /dev/null
+++ b/dom/inputmethod/nsIB2GKeyboard.idl
@@ -0,0 +1,71 @@
+/* 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/. */
+
+#include "domstubs.idl"
+
+[scriptable, uuid(40ad96b2-9efa-41fb-84c7-fbcec9b153f0)]
+interface nsIB2GKeyboard : nsISupports
+{
+  void sendKey(in long keyCode, in long charCode);
+
+  // Select the <select> option specified by index.
+  // If this method is called on a <select> that support multiple
+  // selection, then the option specified by index will be added to
+  // the selection.
+  // If this method is called for a select that does not support multiple
+  // selection the previous element will be unselected.
+  void setSelectedOption(in jsval index);
+
+  // Select the <select> options specified by indexes. All other options
+  // will be deselected.
+  // If this method is called for a <select> that does not support multiple
+  // selection, then the last index specified in indexes will be selected.
+  void setSelectedOptions(in jsval indexes);
+
+  // Set the value on the currently focused element. This has to be used
+  // for special situations where the value had to be chosen amongst a
+  // list (type=month) or a widget (type=date, time, etc.).
+  // If the value passed in parameter isn't valid (in the term of HTML5
+  // Forms Validation), the value will simply be ignored by the element.
+  void setValue(in jsval value);
+
+  void removeFocus();
+
+  attribute nsIDOMEventListener onfocuschange;
+
+  // Fires when user moves the cursor, changes the selection, or alters the
+  // composing text length
+  attribute nsIDOMEventListener onselectionchange;
+
+  // The start position of the selection.
+  readonly attribute long selectionStart;
+
+  // The stop position of the selection.
+  readonly attribute long selectionEnd;
+
+  /*
+   * Set the selection range of the the editable text.
+   *
+   * @param start The beginning of the selected text.
+   * @param end The end of the selected text.
+   *
+   * Note that the start position should be less or equal to the end position.
+   * To move the cursor, set the start and end position to the same value.
+   */
+  void setSelectionRange(in long start, in long end);
+
+  /*
+   * Replace text around the beginning of the current selection range of the
+   * editable text.
+   *
+   * @param text The string to be replaced with.
+   * @param beforeLength The number of characters to be deleted before the
+   * beginning of the current selection range. Defaults to 0.
+   * @param afterLength The number of characters to be deleted after the
+   * beginning of the current selection range. Defaults to 0.
+   */
+  void replaceSurroundingText(in DOMString text,
+                              [optional] in long beforeLength,
+                              [optional] in long afterLength);
+};
--- a/dom/moz.build
+++ b/dom/moz.build
@@ -69,16 +69,17 @@ PARALLEL_DIRS += [
     'ipc',
     'identity',
     'workers',
     'camera',
     'audiochannel',
     'promise',
     'wappush',
     'telephony',
+    'inputmethod',
     'webidl',
 ]
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     PARALLEL_DIRS += ['plugins/ipc/hangui']
 
 if CONFIG['MOZ_B2G_RIL']:
     PARALLEL_DIRS += [
--- a/dom/webidl/InputMethod.webidl
+++ b/dom/webidl/InputMethod.webidl
@@ -1,16 +1,17 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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/.
  */
 
 [JSImplementation="@mozilla.org/b2g-inputmethod;1",
- NavigatorProperty="mozInputMethod"]
+ NavigatorProperty="mozInputMethod",
+ Pref="dom.mozInputMethod.enabled"]
 interface MozInputMethod : EventTarget {
   // Input Method Manager contain a few global methods expose to apps
   readonly attribute MozInputMethodManager mgmt;
 
   // Fired when the input context changes, include changes from and to null.
   // The new InputContext instance will be available in the event
   // object under |inputcontext| property.  When it changes to null it
   // means the app (the user of this API) no longer has the control of
@@ -26,17 +27,18 @@ interface MozInputMethod : EventTarget {
 
   [ChromeOnly]
   // Activate or decactive current input method window.
   void setActive(boolean isActive);
 };
 
 // Manages the list of IMEs, enables/disables IME and switches to an
 // IME.
-[JSImplementation="@mozilla.org/b2g-imm;1"]
+[JSImplementation="@mozilla.org/b2g-imm;1",
+ Pref="dom.mozInputMethod.enabled"]
 interface MozInputMethodManager {
   // Ask the OS to show a list of available IMEs for users to switch from.
   // OS should ignore this request if the app is currently not the active one.
   void showAll();
 
   // Ask the OS to switch away from the current active Keyboard app.
   // OS should ignore this request if the app is currently not the active one.
   void next();
@@ -54,17 +56,18 @@ interface MozInputMethodManager {
   // this method w/o a input context.
   void hide();
 };
 
 // The input context, which consists of attributes and information of current input field.
 // It also hosts the methods available to the keyboard app to mutate the input field represented.
 // An "input context" gets void when the app is no longer allowed to interact with the text field,
 // e.g., the text field does no longer exist, the app is being switched to background, and etc.
-[JSImplementation="@mozilla.org/b2g-inputcontext;1"]
+[JSImplementation="@mozilla.org/b2g-inputcontext;1",
+ Pref="dom.mozInputMethod.enabled"]
 interface MozInputContext: EventTarget {
    // The tag name of input field, which is enum of "input", "textarea", or "contenteditable"
    readonly attribute DOMString? type;
    // The type of the input field, which is enum of text, number, password, url, search, email, and so on.
    // See http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#states-of-the-type-attribute
    readonly attribute DOMString? inputType;
    /*
     * The inputmode string, representing the input mode.
@@ -81,16 +84,20 @@ interface MozInputContext: EventTarget {
     * Get the whole text content of the input field.
     * @return DOMString
     */
    Promise getText(optional long offset, optional long length);
    // The start and stop position of the selection.
    readonly attribute long selectionStart;
    readonly attribute long selectionEnd;
 
+   // The start and stop position of the selection.
+   readonly attribute DOMString? textBeforeCursor;
+   readonly attribute DOMString? textAfterCursor;
+
     /*
      * Set the selection range of the the editable text.
      * Note: This method cannot be used to move the cursor during composition. Calling this
      * method will cancel composition.
      * @param start The beginning of the selected text.
      * @param length The length of the selected text.
      *
      * Note that the start position should be less or equal to the end position.
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -181,16 +181,17 @@ WEBIDL_FILES = [
     'IDBIndex.webidl',
     'IDBObjectStore.webidl',
     'IDBOpenDBRequest.webidl',
     'IDBRequest.webidl',
     'IDBTransaction.webidl',
     'IDBVersionChangeEvent.webidl',
     'ImageData.webidl',
     'ImageDocument.webidl',
+    'InputMethod.webidl',
     'InspectorUtils.webidl',
     'InterAppConnection.webidl',
     'InterAppConnectionRequest.webidl',
     'InterAppMessageEvent.webidl',
     'InterAppMessagePort.webidl',
     'KeyboardEvent.webidl',
     'KeyEvent.webidl',
     'LegacyQueryInterface.webidl',
@@ -527,21 +528,16 @@ if CONFIG['ENABLE_TESTS']:
         'TestTypedef.webidl',
     ]
     PREPROCESSED_TEST_WEBIDL_FILES += [
         'TestCodeGen.webidl',
         'TestExampleGen.webidl',
         'TestJSImplGen.webidl',
     ]
 
-if CONFIG['MOZ_B2G']:
-    WEBIDL_FILES += [
-        'InputMethod.webidl',
-    ]
-
 GENERATED_EVENTS_WEBIDL_FILES = [
     'BlobEvent.webidl',
     'DeviceLightEvent.webidl',
     'DeviceProximityEvent.webidl',
     'MediaStreamEvent.webidl',
     'RTCDataChannelEvent.webidl',
     'RTCPeerConnectionIceEvent.webidl',
     'UserProximityEvent.webidl',
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -4419,16 +4419,19 @@ pref("captivedetect.maxRetryCount", 5);
 #endif
 
 #ifdef RELEASE_BUILD
 pref("dom.forms.inputmode", false);
 #else
 pref("dom.forms.inputmode", true);
 #endif
 
+// InputMethods for soft keyboards in B2G
+pref("dom.mozInputMethod.enabled", false);
+
 // Telephony API
 pref("dom.telephony.enabled", false);
 
 // DOM Inter-App Communication API.
 pref("dom.inter-app-communication-api.enabled", false);
 
 // The tables used for Safebrowsing phishing and malware checks.
 pref("urlclassifier.malware_table", "goog-malware-shavar");
--- a/security/manager/ssl/tests/unit/test_signed_apps-marketplace.js
+++ b/security/manager/ssl/tests/unit/test_signed_apps-marketplace.js
@@ -1,11 +1,12 @@
 "use strict";
 
-const isB2G = ("@mozilla.org/b2g-keyboard;1" in Components.classes);
+const isB2G = ("@mozilla.org/b2g-process-global;1" in Cc);
+
 
 do_get_profile(); // must be called before getting nsIX509CertDB
 const certdb = Cc["@mozilla.org/security/x509certdb;1"].getService(Ci.nsIX509CertDB);
 
 function run_test() {
   run_next_test();
 }