From 5c841d4bbb6ab7698fe9db7b3d529629922f22cc Mon Sep 17 00:00:00 2001 From: Wes Kocher Date: Mon, 30 Mar 2015 18:00:09 -0700 Subject: [PATCH] Backed out changeset b5e71f873231 (bug 1148990) --- services/common/moz.build | 25 ++------ .../common/tests/unit/test_load_modules.js | 59 ++++--------------- services/common/tests/unit/xpcshell.ini | 11 ---- 3 files changed, 19 insertions(+), 76 deletions(-) diff --git a/services/common/moz.build b/services/common/moz.build index 89c7938a0b9..41c855d1e2a 100644 --- a/services/common/moz.build +++ b/services/common/moz.build @@ -14,38 +14,25 @@ EXTRA_COMPONENTS += [ ] EXTRA_JS_MODULES['services-common'] += [ + 'hawkclient.js', + 'hawkrequest.js', 'logmanager.js', 'stringbundle.js', + 'tokenserverclient.js', 'utils.js', ] -if CONFIG['OS_TARGET'] != 'Android': - EXTRA_JS_MODULES['services-common'] += [ - 'hawkclient.js', - 'hawkrequest.js', - 'tokenserverclient.js', - ] - - TESTING_JS_MODULES.services.common += [ - 'modules-testing/storageserver.js', - ] - - if CONFIG['MOZ_SERVICES_HEALTHREPORT']: - EXTRA_PP_JS_MODULES['services-common'] += [ - 'bagheeraclient.js', - ] - TESTING_JS_MODULES.services.common += [ - 'modules-testing/bagheeraserver.js', - ] - EXTRA_PP_JS_MODULES['services-common'] += [ 'async.js', + 'bagheeraclient.js', 'observers.js', 'rest.js', ] TESTING_JS_MODULES.services.common += [ + 'modules-testing/bagheeraserver.js', 'modules-testing/logging.js', + 'modules-testing/storageserver.js', 'modules-testing/utils.js', ] diff --git a/services/common/tests/unit/test_load_modules.js b/services/common/tests/unit/test_load_modules.js index 9abdbf4c1e2..a84eac31d3a 100644 --- a/services/common/tests/unit/test_load_modules.js +++ b/services/common/tests/unit/test_load_modules.js @@ -1,63 +1,30 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -Components.utils.import("resource://gre/modules/AppConstants.jsm"); - -const MODULE_BASE = "resource://services-common/"; -const shared_modules = [ +const modules = [ "async.js", + "bagheeraclient.js", "logmanager.js", "rest.js", "stringbundle.js", + "tokenserverclient.js", "utils.js", ]; -const non_android_modules = [ - "bagheeraclient.js", - "tokenserverclient.js", -]; - -const TEST_BASE = "resource://testing-common/services/common/"; -const shared_test_modules = [ - "logging.js", -]; - -const non_android_test_modules = [ +const test_modules = [ "bagheeraserver.js", + "logging.js", "storageserver.js", ]; -function expectImportsToSucceed(mm, base=MODULE_BASE) { - for each (let m in mm) { - let resource = base + m; +function run_test() { + for each (let m in modules) { + let resource = "resource://services-common/" + m; + Components.utils.import(resource, {}); + } + + for each (let m in test_modules) { + let resource = "resource://testing-common/services/common/" + m; Components.utils.import(resource, {}); } } - -function expectImportsToFail(mm, base=MODULE_BASE) { - for each (let m in mm) { - let resource = base + m; - let succeeded = false; - try { - Components.utils.import(resource, {}); - succeeded = true; - } catch (e) {} - - if (succeeded) { - throw "Importing " + m + " should have failed!"; - } - } -} - -function run_test() { - expectImportsToSucceed(shared_modules); - expectImportsToSucceed(shared_test_modules, base=TEST_BASE); - - if (AppConstants.platform != "android") { - expectImportsToSucceed(non_android_modules); - expectImportsToSucceed(non_android_test_modules, base=TEST_BASE); - } else { - expectImportsToFail(non_android_modules); - expectImportsToFail(non_android_test_modules, base=TEST_BASE); - } -} diff --git a/services/common/tests/unit/xpcshell.ini b/services/common/tests/unit/xpcshell.ini index 1b094369c91..083ec60a6a0 100644 --- a/services/common/tests/unit/xpcshell.ini +++ b/services/common/tests/unit/xpcshell.ini @@ -25,27 +25,16 @@ skip-if = toolkit == 'gonk' [test_async_chain.js] [test_async_querySpinningly.js] - [test_bagheera_server.js] -skip-if = os == "android" - [test_bagheera_client.js] -skip-if = os == "android" - [test_hawkclient.js] -skip-if = os == "android" [test_hawkrequest.js] -skip-if = os == "android" - [test_logmanager.js] [test_observers.js] [test_restrequest.js] - [test_tokenauthenticatedrequest.js] -skip-if = os == "android" [test_tokenserverclient.js] skip-if = os == "android" [test_storage_server.js] -skip-if = os == "android"