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_logshake_readLog_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_logshake_readLog_gonk.js')
-rw-r--r-- | b2g/components/test/unit/test_logshake_readLog_gonk.js | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/b2g/components/test/unit/test_logshake_readLog_gonk.js b/b2g/components/test/unit/test_logshake_readLog_gonk.js deleted file mode 100644 index 003723ad5..000000000 --- a/b2g/components/test/unit/test_logshake_readLog_gonk.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Test the log capturing capabilities of LogShake.jsm under conditions that - * could cause races - */ - -/* jshint moz: true, esnext: true */ -/* global Cu, LogCapture, LogShake, ok, add_test, run_next_test, dump, - XPCOMUtils, do_get_profile, OS, volumeService, Promise, equal, - setup_logshake_mocks */ -/* exported run_test */ - -/* disable use strict warning */ -/* jshint -W097 */ - -"use strict"; - -function run_test() { - Cu.import("resource://gre/modules/LogShake.jsm"); - run_next_test(); -} - -add_test(setup_logshake_mocks); - -add_test(function test_logShake_captureLogs_waits_to_read() { - // Enable LogShake - LogShake.init(); - - // Save no logs synchronously (except properties) - LogShake.LOGS_WITH_PARSERS = {}; - - LogShake.captureLogs().then(logResults => { - LogShake.uninit(); - - ok(logResults.logFilenames.length > 0, "Should have filenames"); - ok(logResults.logPaths.length > 0, "Should have paths"); - ok(!logResults.compressed, "Should not be compressed"); - - // This assumes that the about:memory reading will only fail under abnormal - // circumstances. It does not check for screenshot.png because - // systemAppFrame is unavailable during xpcshell tests. - let hasAboutMemory = false; - - logResults.logFilenames.forEach(filename => { - // Because the about:memory log's filename has the PID in it we can not - // use simple equality but instead search for the "about_memory" part of - // the filename which will look like logshake-about_memory-{PID}.json.gz - if (filename.indexOf("about_memory") < 0) { - return; - } - hasAboutMemory = true; - }); - - ok(hasAboutMemory, - "LogShake's asynchronous read of about:memory should have succeeded."); - - run_next_test(); - }, - error => { - LogShake.uninit(); - - ok(false, "Should not have received error: " + error); - - run_next_test(); - }); -}); |