зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1362937 - [Form Autofill] Handle undefined profile fields in autocomplete filtering. r=MattN
MozReview-Commit-ID: JvETH3KBjxY --HG-- extra : rebase_source : 8c0b4087e4ec3f323bcbd1d3acbd0153bca31164
This commit is contained in:
Родитель
e07521d38d
Коммит
a9c4650c1d
|
@ -284,7 +284,7 @@ ProfileStorage.prototype = {
|
||||||
return !!name;
|
return !!name;
|
||||||
}
|
}
|
||||||
|
|
||||||
return name.toLowerCase().startsWith(lcSearchString);
|
return name && name.toLowerCase().startsWith(lcSearchString);
|
||||||
});
|
});
|
||||||
|
|
||||||
log.debug("getByFilter: Returning", result.length, "result(s)");
|
log.debug("getByFilter: Returning", result.length, "result(s)");
|
||||||
|
|
|
@ -143,6 +143,11 @@ add_task(function* test_getByFilter() {
|
||||||
filter = {info: {fieldName: "street-address"}, searchString: ".*"};
|
filter = {info: {fieldName: "street-address"}, searchString: ".*"};
|
||||||
profiles = profileStorage.getByFilter(filter);
|
profiles = profileStorage.getByFilter(filter);
|
||||||
do_check_eq(profiles.length, 0);
|
do_check_eq(profiles.length, 0);
|
||||||
|
|
||||||
|
// Prevent broken while searching the property that is not existed.
|
||||||
|
filter = {info: {fieldName: "tel"}, searchString: "1"};
|
||||||
|
profiles = profileStorage.getByFilter(filter);
|
||||||
|
do_check_eq(profiles.length, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(function* test_add() {
|
add_task(function* test_add() {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче