mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
3595bf3564
The LogShake features allows one to shake its device to be able to dump a set of useful logging informations. This includes several log files, and also the Android properties. In the past, we relied on the /dev/__properties__ file to extract their content by parsing its value. This is duplicate work from the bionic libc and libcutils library. Worst, the format used to store the values in this file has been changed between JellyBean and Kitkat, so our parser was not able to dump the values: that explains bug 1079322. To fix this we make use of some of the underlying libc-defined functions used to iterate and get properties values: - __system_property_find_nth() to retrieve one arbitrary property by its number (starting from 0), and this returns a struct containing all the informations - __system_property_read() to read the values contained in the struct that was previously retrieved
31 lines
985 B
JavaScript
31 lines
985 B
JavaScript
/* 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");
|
|
|
|
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);
|
|
}
|
|
|
|
let propertiesLog = LogCapture.readProperties();
|
|
notEqual(propertiesLog, null, "Properties should not be null");
|
|
notEqual(propertiesLog, undefined, "Properties should not be undefined");
|
|
equal(propertiesLog["ro.kernel.qemu"], "1", "QEMU property should be 1");
|
|
|
|
let mainLog = LogCapture.readLogFile("/dev/log/main");
|
|
verifyLog(mainLog);
|
|
|
|
let meminfoLog = LogCapture.readLogFile("/proc/meminfo");
|
|
verifyLog(meminfoLog);
|
|
}
|