Release Android Preview 21 and bilingual changelog
Add permission-based reading of Android contacts, SMS and call history. Include shared Gaia fixes and document device validation limits. Pixel image qualification remains pending.
This commit is contained in:
parent
1c20a0b6d5
commit
200d1fb235
43 changed files with 2271 additions and 65 deletions
20
tests/call-log-contacts.test.mjs
Normal file
20
tests/call-log-contacts.test.mjs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import vm from 'node:vm';
|
||||
import {readFileSync} from 'node:fs';
|
||||
|
||||
for (const file of ['gaia/apps/communications/dialer/js/call_log.js',
|
||||
'assets/webapps/communications.gaiamobile.org/dialer/js/call_log.js']) {
|
||||
test(`call log resolves contacts in its newly rendered section: ${file}`, () => {
|
||||
const context = {navigator:{mozContacts:{}},window:{}};
|
||||
vm.runInNewContext(readFileSync(file,'utf8'),context);
|
||||
const log = context.CallLog, items = [], lookedUp = [];
|
||||
const list = {appendChild:row=>items.push(row),querySelectorAll:()=>items};
|
||||
log.createSectionForGroup=()=>({getElementsByTagName:()=>[list]});
|
||||
log.createGroup=group=>({dataset:{phoneNumber:group.number}});
|
||||
log.callLogContainer={appendChild(){}};
|
||||
log._updateContact=(_node,number)=>lookedUp.push(number);
|
||||
log.renderChunk([{number:'5550199'}]);
|
||||
assert.deepEqual(lookedUp,['5550199']);
|
||||
});
|
||||
}
|
||||
Loading…
Reference in a new issue