blob: cf777c4c6c9bc1a740169e73246e237ee535a846 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
let waitForDebugLog = target =>
new Promise(resolve => {
Cc["@mozilla.org/appservices/logger;1"]
.getService(Ci.mozIAppServicesLogger)
.register(target, {
maxLevel: Ci.mozIServicesLogSink.LEVEL_INFO,
info: resolve,
});
});
let rustLog = (target, message) => {
Cc["@mozilla.org/xpcom/debug;1"]
.getService(Ci.nsIDebug2)
.rustLog(target, message);
};
add_task(async () => {
let target = "app-services:webext_storage:sync";
let expectedMessage = "info error: uh oh";
let promiseMessage = waitForDebugLog(target);
rustLog(target, expectedMessage);
let actualMessage = await promiseMessage;
Assert.ok(actualMessage.includes(expectedMessage));
});
|