Add test coverage for the creditCards.storage.rust.enabled pref
Categories
(Toolkit :: Form Autofill, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox160 | --- | fixed |
People
(Reporter: dimi, Assigned: dimi)
References
(Blocks 1 open bug)
Details
Attachments
(1 external file)
The credit card browser tests run only against the JSON store. rustCreditCard/browser.toml runs them a second time with extensions.formautofill.creditCards.storage.rust.enabled set, so the Rust store serves every credit card read and write. It includes test/browser/creditCard/ by reference rather than copying it, so the skip-if annotations stay in one place.
The counterpart of Bug 2071837, which did this for addresses.
Some of the suite cannot be shared as it stands:
browser_creditCard_cvv.js— the Rust credit card schema has no column for the security code.browser_creditCard_decryption_failure.js— it makes a card unreadable by re-keying the OS key store, which leaves the Rust store's NSS key untouched.- The telemetry assertions in
browser_creditCard_fill_cancel_login.jsandbrowser_creditCard_doorhanger_display.js—creditcard.osKeystoreDecryptis recorded byOSKeyStore.decrypt, which this store never reaches.
None of the credit card storage tests in xpcshell.toml can be re-run either: test_getRecords.js resets the NSS token to set a primary password, which would take the Rust store's key with it, and the rest reach either for sync APIs the Rust adapter does not answer or past the collection API into creditCards._data. The Rust store's xpcshell coverage stays in test_rust_autofill_credit_card_adapter.js and test_rust_autofill_credit_card_migration.js.
| Assignee | ||
Comment 1•2 months ago
|
||
The credit card counterpart of Bug 2071837, in the same shape:
rustCreditCard/browser.toml includes test/browser/creditCard/ wholesale so its
skip-if annotations are inherited rather than copied, lists as shims the credit
card tests that live in test/browser/ instead, and test/browser/head.js asserts
rust.active once the pref is set. browser_creditCard_migration.js moves out to
test/browser/, covering the migration rather than re-running a test under a
different pref; its fixtures gain a 15-digit card, so the mask this store
rebuilds at a fixed width and the fields it derives are asserted against a
record the migration copied.
The rest follows from cards being encrypted, which addresses are not. Six places
decrypted a stored number through OSKeyStore, which reads nothing this store
wrote, and ask the collection instead through a decryptCreditCardNumber helper.
The two assertions on creditcard.osKeystoreDecrypt keep the original and gain a
counterpart beside it, that event being OSKeyStore.decrypt's own. head_cc.js and
the browser_telemetry_utils.js support file resolved against whichever manifest
pulled creditCard/browser.toml in, and are named from the top of the tree now.
Two tests are skipped in the file rather than annotated, the include running the
directory wholesale: browser_creditCard_cvv.js is about the security code, which
the Rust schema has no column for, and browser_creditCard_decryption_failure.js
makes a card unreadable by re-keying the OS key store, which leaves this store's
NSS key alone -- covered for it by test_rust_autofill_credit_card_adapter.js.
There is no xpcshell counterpart: every credit card storage test in xpcshell.toml
reaches for sync APIs the Rust adapter does not answer or past the collection API
into creditCards._data, and test_getRecords.js resets the NSS token, which would
take this store's key with it.
Depends on D325418
Updated•2 months ago
|
Updated•2 months ago
|
Backed out for causing bc failures @ creditCard/browser_creditCard_doorhanger_cvv.js
| Assignee | ||
Updated•1 month ago
|
Comment 6•1 month ago
|
||
| bugherder | ||
Updated•1 month ago
|
Description
•