author | Vicamo Yang <vyang@mozilla.com> |
Mon, 23 Jun 2014 20:56:02 +0800 | |
changeset 190191 | b0299260cb743df0cae7d2cb405889bbdc7ffbd9 |
parent 190190 | 29a1c6a34550c29d07882e9910133507718bccd3 |
child 190192 | c944488979ba705bbaa97b9382ef12d71c20f534 |
push id | 27003 |
push user | kwierso@gmail.com |
push date | Tue, 24 Jun 2014 01:56:11 +0000 |
treeherder | mozilla-central@e86b84998b18 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | yoshi |
bugs | 973024 |
milestone | 33.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
|
--- a/dom/system/gonk/tests/header_helpers.js +++ b/dom/system/gonk/tests/header_helpers.js @@ -74,16 +74,48 @@ function newWorker(custom_ns) { // Register at least one client. worker_ns.ContextPool.registerClient({ clientId: 0 }); return worker_ns; } /** + * Create a buffered RIL worker. + * + * @return A worker object that stores sending octets in a internal buffer. + */ +function newUint8Worker() { + let worker = newWorker(); + let index = 0; // index for read + let buf = []; + + let context = worker.ContextPool._contexts[0]; + context.Buf.writeUint8 = function(value) { + buf.push(value); + }; + + context.Buf.readUint8 = function() { + return buf[index++]; + }; + + context.Buf.seekIncoming = function(offset) { + index += offset; + }; + + context.Buf.getReadAvailable = function() { + return buf.length - index; + }; + + worker.debug = do_print; + + return worker; +} + +/** * Create a parcel suitable for postRILMessage(). * * @param fakeParcelSize * Value to be written to parcel size field for testing * incorrect/incomplete parcel reading. Replaced with correct * one determined length of data if negative. * @param response * Response code of the incoming parcel.
--- a/dom/system/gonk/tests/test_ril_worker_barring_password.js +++ b/dom/system/gonk/tests/test_ril_worker_barring_password.js @@ -5,42 +5,16 @@ subscriptLoader.loadSubScript("resource: function run_test() { run_next_test(); } const PIN = "0000"; const NEW_PIN = "1234"; -/** - * Helper function. - */ -function newUint8Worker() { - let worker = newWorker(); - let context = worker.ContextPool._contexts[0]; - let index = 0; // index for read - let buf = []; - - context.Buf.writeUint8 = function(value) { - buf.push(value); - }; - - context.Buf.readUint8 = function() { - return buf[index++]; - }; - - context.Buf.seekIncoming = function(offset) { - index += offset; - }; - - worker.debug = do_print; - - return worker; -} - add_test(function test_change_call_barring_password() { let worker = newUint8Worker(); let context = worker.ContextPool._contexts[0]; let buf = context.Buf; function do_test(facility, pin, newPin) { buf.sendParcel = function fakeSendParcel () { // Request Type.
--- a/dom/system/gonk/tests/test_ril_worker_icc.js +++ b/dom/system/gonk/tests/test_ril_worker_icc.js @@ -3,46 +3,16 @@ subscriptLoader.loadSubScript("resource://gre/modules/ril_consts.js", this); function run_test() { run_next_test(); } /** - * Helper function. - */ -function newUint8Worker() { - let worker = newWorker(); - let index = 0; // index for read - let buf = []; - - let context = worker.ContextPool._contexts[0]; - context.Buf.writeUint8 = function(value) { - buf.push(value); - }; - - context.Buf.readUint8 = function() { - return buf[index++]; - }; - - context.Buf.seekIncoming = function(offset) { - index += offset; - }; - - context.Buf.getReadAvailable = function() { - return buf.length - index; - }; - - worker.debug = do_print; - - return worker; -} - -/** * Verify ICCPDUHelper#readICCUCS2String() */ add_test(function test_read_icc_ucs2_string() { let worker = newUint8Worker(); let context = worker.ContextPool._contexts[0]; let helper = context.GsmPDUHelper; let iccHelper = context.ICCPDUHelper;
--- a/dom/system/gonk/tests/test_ril_worker_ruim.js +++ b/dom/system/gonk/tests/test_ril_worker_ruim.js @@ -3,42 +3,16 @@ subscriptLoader.loadSubScript("resource://gre/modules/ril_consts.js", this); function run_test() { run_next_test(); } /** - * Helper function. - */ -function newUint8Worker() { - let worker = newWorker(); - let context = worker.ContextPool._contexts[0]; - let index = 0; // index for read - let buf = []; - - context.Buf.writeUint8 = function(value) { - buf.push(value); - }; - - context.Buf.readUint8 = function() { - return buf[index++]; - }; - - context.Buf.seekIncoming = function(offset) { - index += offset; - }; - - worker.debug = do_print; - - return worker; -} - -/** * Verify RUIM Service. */ add_test(function test_is_ruim_service_available() { let worker = newWorker(); let context = worker.ContextPool._contexts[0]; context.RIL._isCdma = true; context.RIL.appType = CARD_APPTYPE_RUIM;
--- a/dom/system/gonk/tests/test_ril_worker_stk.js +++ b/dom/system/gonk/tests/test_ril_worker_stk.js @@ -5,39 +5,16 @@ subscriptLoader.loadSubScript("resource: function run_test() { run_next_test(); } /** * Helper function. */ -function newUint8Worker() { - let worker = newWorker(); - let index = 0; // index for read - let buf = []; - let context = worker.ContextPool._contexts[0]; - - context.Buf.writeUint8 = function(value) { - buf.push(value); - }; - - context.Buf.readUint8 = function() { - return buf[index++]; - }; - - context.Buf.seekIncoming = function(offset) { - index += offset; - }; - - worker.debug = do_print; - - return worker; -} - function newUint8SupportOutgoingIndexWorker() { let worker = newWorker(); let index = 4; // index for read let buf = [0, 0, 0, 0]; // Preserved parcel size let context = worker.ContextPool._contexts[0]; context.Buf.writeUint8 = function(value) { if (context.Buf.outgoingIndex >= buf.length) {