Bug 792594 - Workaround for import error on mochitest b2g. r=gwagner
authorMartijn Wargers <martijn.martijn@gmail.com>
Tue, 16 Oct 2012 21:34:00 -0400
changeset 110622 0fb868c93955e29ccbfa5df29fba4ebdf21d5bf9
parent 110621 0fc318454f2b41430eb7194c1d56239822b34453
child 110623 6c1d11cdda0addcef124c9cdcea2ded667d249a1
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersgwagner
bugs792594
milestone19.0a1
Bug 792594 - Workaround for import error on mochitest b2g. r=gwagner
dom/contacts/tests/test_contacts_basics.html
dom/contacts/tests/test_contacts_blobs.html
--- a/dom/contacts/tests/test_contacts_basics.html
+++ b/dom/contacts/tests/test_contacts_basics.html
@@ -16,20 +16,24 @@ https://bugzilla.mozilla.org/show_bug.cg
 <div id="content" style="display: none">
 
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 "use strict";
 
-var comp = SpecialPowers.wrap(SpecialPowers.Components);
-comp.utils.import("resource://gre/modules/ContactService.jsm");
-comp.utils.import("resource://gre/modules/PermissionPromptHelper.jsm");
-SpecialPowers.setBoolPref("dom.mozContacts.enabled", true);
+// this shouldn't be necessary when bug 792594 is fixed
+if (!SpecialPowers.getBoolPref("dom.mozContacts.enabled")) {
+  var comp = SpecialPowers.wrap(SpecialPowers.Components);
+  comp.utils.import("resource://gre/modules/ContactService.jsm");
+  comp.utils.import("resource://gre/modules/PermissionPromptHelper.jsm");
+  SpecialPowers.setBoolPref("dom.mozContacts.enabled", true);
+}
+    
 SpecialPowers.addPermission("contacts", true, document);
 
 // For Sorting
 var c1 = {
   name: "a",
   familyName: ["a"],
   givenName: ["a"],
 };
--- a/dom/contacts/tests/test_contacts_blobs.html
+++ b/dom/contacts/tests/test_contacts_blobs.html
@@ -16,20 +16,24 @@ https://bugzilla.mozilla.org/show_bug.cg
 <div id="content" style="display: none">
 
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 "use strict";
 
-var comp = SpecialPowers.wrap(SpecialPowers.Components);
-comp.utils.import("resource://gre/modules/ContactService.jsm");
-comp.utils.import("resource://gre/modules/PermissionPromptHelper.jsm");
-SpecialPowers.setBoolPref("dom.mozContacts.enabled", true);
+// this shouldn't be necessary when bug 792594 is fixed
+if (!SpecialPowers.getBoolPref("dom.mozContacts.enabled")) {
+  var comp = SpecialPowers.wrap(SpecialPowers.Components);
+  comp.utils.import("resource://gre/modules/ContactService.jsm");
+  comp.utils.import("resource://gre/modules/PermissionPromptHelper.jsm");
+  SpecialPowers.setBoolPref("dom.mozContacts.enabled", true);
+}
+
 SpecialPowers.addPermission("contacts", true, document);
 
 var utils = SpecialPowers.getDOMWindowUtils(window);
 
 function getView(size)
 {
  var buffer = new ArrayBuffer(size);
  var view = new Uint8Array(buffer);