diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-05-12 11:09:44 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-05-12 11:09:44 +0200 |
commit | cfe5ef4ac7cd59f094b538252161ad74223c47da (patch) | |
tree | e5c0ee7e70db84bd2bfc6062784006769e9df730 /dom/system/gonk/tests/test_ril_worker_clir.js | |
parent | 28cf922aa9af4d4b8e0a3ce91dc1270a55986909 (diff) | |
download | UXP-cfe5ef4ac7cd59f094b538252161ad74223c47da.tar UXP-cfe5ef4ac7cd59f094b538252161ad74223c47da.tar.gz UXP-cfe5ef4ac7cd59f094b538252161ad74223c47da.tar.lz UXP-cfe5ef4ac7cd59f094b538252161ad74223c47da.tar.xz UXP-cfe5ef4ac7cd59f094b538252161ad74223c47da.zip |
Remove Gonk build directories
Diffstat (limited to 'dom/system/gonk/tests/test_ril_worker_clir.js')
-rw-r--r-- | dom/system/gonk/tests/test_ril_worker_clir.js | 122 |
1 files changed, 0 insertions, 122 deletions
diff --git a/dom/system/gonk/tests/test_ril_worker_clir.js b/dom/system/gonk/tests/test_ril_worker_clir.js deleted file mode 100644 index 5882a3c4c..000000000 --- a/dom/system/gonk/tests/test_ril_worker_clir.js +++ /dev/null @@ -1,122 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -subscriptLoader.loadSubScript("resource://gre/modules/ril_consts.js", this); - -// Calling line identification restriction constants. - -// Uses subscription default value. -const CLIR_DEFAULT = 0; -// Restricts CLI presentation. -const CLIR_INVOCATION = 1; -// Allows CLI presentation. -const CLIR_SUPPRESSION = 2; - -function run_test() { - run_next_test(); -} - -add_test(function test_setCLIR_success() { - let workerHelper = newInterceptWorker(); - let worker = workerHelper.worker; - let context = worker.ContextPool._contexts[0]; - - context.RIL.setCLIR = function fakeSetCLIR(options) { - context.RIL[REQUEST_SET_CLIR](0, { - rilMessageType: "setCLIR" - }); - }; - - context.RIL.setCLIR({ - clirMode: CLIR_DEFAULT - }); - - let postedMessage = workerHelper.postedMessage; - - equal(postedMessage.errorMsg, undefined); - - run_next_test(); -}); - -add_test(function test_setCLIR_generic_failure() { - let workerHelper = newInterceptWorker(); - let worker = workerHelper.worker; - let context = worker.ContextPool._contexts[0]; - - context.RIL.setCLIR = function fakeSetCLIR(options) { - context.RIL[REQUEST_SET_CLIR](0, { - rilMessageType: "setCLIR", - errorMsg: GECKO_ERROR_GENERIC_FAILURE - }); - }; - - context.RIL.setCLIR({ - clirMode: CLIR_DEFAULT - }); - - let postedMessage = workerHelper.postedMessage; - - equal(postedMessage.errorMsg, GECKO_ERROR_GENERIC_FAILURE); - - run_next_test(); -}); - -add_test(function test_getCLIR_n0_m1() { - let workerHelper = newInterceptWorker(); - let worker = workerHelper.worker; - let context = worker.ContextPool._contexts[0]; - - context.Buf.readInt32 = function fakeReadUint32() { - return context.Buf.int32Array.pop(); - }; - - context.RIL.getCLIR = function fakeGetCLIR(options) { - context.Buf.int32Array = [ - 1, // Presentation indicator is used according to the subscription - // of the CLIR service. - 0, // CLIR provisioned in permanent mode. - 2 // Length. - ]; - context.RIL[REQUEST_GET_CLIR](1, { - rilMessageType: "setCLIR" - }); - }; - - context.RIL.getCLIR({}); - - let postedMessage = workerHelper.postedMessage; - - equal(postedMessage.errorMsg, undefined); - equal(postedMessage.n, 0); - equal(postedMessage.m, 1); - run_next_test(); -}); - -add_test(function test_getCLIR_error_generic_failure_invalid_length() { - let workerHelper = newInterceptWorker(); - let worker = workerHelper.worker; - let context = worker.ContextPool._contexts[0]; - - context.Buf.readInt32 = function fakeReadUint32() { - return context.Buf.int32Array.pop(); - }; - - context.RIL.getCLIR = function fakeGetCLIR(options) { - context.Buf.int32Array = [ - 1, // Presentation indicator is used according to the subscription - // of the CLIR service. - 0, // CLIR provisioned in permanent mode. - 0 // Length (invalid one). - ]; - context.RIL[REQUEST_GET_CLIR](1, { - rilMessageType: "setCLIR" - }); - }; - - context.RIL.getCLIR({}); - - let postedMessage = workerHelper.postedMessage; - - equal(postedMessage.errorMsg, GECKO_ERROR_GENERIC_FAILURE); - run_next_test(); -}); |