diff options
author | Matt A. Tobin <email@mattatobin.com> | 2018-02-03 06:25:10 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2018-02-03 06:25:10 -0500 |
commit | 8b8c65072aedef94610748ce92c2ed3a19fd5517 (patch) | |
tree | 8614d386acf5db7a77b08d19a5854a7d75dab015 /b2g/components/test/unit/test_logcapture_gonk.js | |
parent | 8c3a46bd13a0660a3ff1e0379dbf515873a852d2 (diff) | |
download | UXP-8b8c65072aedef94610748ce92c2ed3a19fd5517.tar UXP-8b8c65072aedef94610748ce92c2ed3a19fd5517.tar.gz UXP-8b8c65072aedef94610748ce92c2ed3a19fd5517.tar.lz UXP-8b8c65072aedef94610748ce92c2ed3a19fd5517.tar.xz UXP-8b8c65072aedef94610748ce92c2ed3a19fd5517.zip |
Purge b2g/
Diffstat (limited to 'b2g/components/test/unit/test_logcapture_gonk.js')
-rw-r--r-- | b2g/components/test/unit/test_logcapture_gonk.js | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/b2g/components/test/unit/test_logcapture_gonk.js b/b2g/components/test/unit/test_logcapture_gonk.js deleted file mode 100644 index d80f33dd9..000000000 --- a/b2g/components/test/unit/test_logcapture_gonk.js +++ /dev/null @@ -1,70 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ */ - - -/** - * Test that LogCapture successfully reads from the /dev/log devices, returning - * a Uint8Array of some length, including zero. This tests a few standard - * log devices - */ -function run_test() { - Components.utils.import("resource:///modules/LogCapture.jsm"); - run_next_test(); -} - -function verifyLog(log) { - // log exists - notEqual(log, null); - // log has a length and it is non-negative (is probably array-like) - ok(log.length >= 0); -} - -add_test(function test_readLogFile() { - let mainLog = LogCapture.readLogFile("/dev/log/main"); - verifyLog(mainLog); - - let meminfoLog = LogCapture.readLogFile("/proc/meminfo"); - verifyLog(meminfoLog); - - run_next_test(); -}); - -add_test(function test_readProperties() { - let propertiesLog = LogCapture.readProperties(); - notEqual(propertiesLog, null, "Properties should not be null"); - notEqual(propertiesLog, undefined, "Properties should not be undefined"); - - for (let propertyName in propertiesLog) { - equal(typeof(propertiesLog[propertyName]), "string", - "Property " + propertyName + " should be a string"); - } - - equal(propertiesLog["ro.product.locale.language"], "en", - "Locale language should be read correctly. See bug 1171577."); - - equal(propertiesLog["ro.product.locale.region"], "US", - "Locale region should be read correctly. See bug 1171577."); - - run_next_test(); -}); - -add_test(function test_readAppIni() { - let appIni = LogCapture.readLogFile("/system/b2g/application.ini"); - verifyLog(appIni); - - run_next_test(); -}); - -add_test(function test_get_about_memory() { - let memLog = LogCapture.readAboutMemory(); - - ok(memLog, "Should have returned a valid Promise object"); - - memLog.then(file => { - ok(file, "Should have returned a filename"); - run_next_test(); - }, error => { - ok(false, "Dumping about:memory promise rejected: " + error); - run_next_test(); - }); -}); |