Closed Bug 1522280 Opened 9 months ago Closed 9 months ago

Add autofill tests

Categories

(Firefox :: Address Bar, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
Firefox 67
Tracking Status
firefox67 --- fixed

People

(Reporter: adw, Assigned: adw)

References

Details

(Whiteboard: [fxsearch])

Attachments

(2 files)

Bug 1521236 added autofill to quantumbar, but it didn't include any tests. We should add tests.

Whiteboard: [fxsearch]

I split this up into two patches, one for input tests and one for controller tests.

The input tests check a couple of things: input.autofill() in isolation, and also that enableAutofill is false when the previous search string starts with the new search string.

The controller test checks that input.autofill() gets called as appropriate (on receiveResults on the first result and context.autofillValue is non-null).

Pushed by dwillcoxon@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2859bb1963a1
Add autofill tests: controller tests. r=Standard8
Pushed by dwillcoxon@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7065c7171760
Add autofill tests: input tests. r=dao

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&fromchange=2859bb1963a10ea87a3ca3840ee5f24ea7561e3a&tochange=9865a7358969d86d1b657ba2b9890e4ea5189f11&selectedJob=224754784

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=224754784&repo=autoland&lineNumber=2003

Backout link: https://hg.mozilla.org/integration/autoland/rev/9865a7358969d86d1b657ba2b9890e4ea5189f11

[task 2019-01-29T17:11:46.513Z] 17:11:46 INFO - TEST-START | browser/components/urlbar/tests/unit/test_UrlbarController_unit.js
[task 2019-01-29T17:11:47.246Z] 17:11:47 WARNING - TEST-UNEXPECTED-FAIL | browser/components/urlbar/tests/unit/test_UrlbarController_unit.js | xpcshell return code: 0
[task 2019-01-29T17:11:47.248Z] 17:11:47 INFO - TEST-INFO took 731ms
[task 2019-01-29T17:11:47.249Z] 17:11:47 INFO - >>>>>>>
[task 2019-01-29T17:11:47.250Z] 17:11:47 INFO - PID 10986 | [10986, Main Thread] WARNING: Couldn't get the user appdata directory. Crash events may not be produced.: file /builds/worker/workspace/build/src/toolkit/crashreporter/nsExceptionHandler.cpp, line 2536
[task 2019-01-29T17:11:47.251Z] 17:11:47 INFO - PID 10986 | JavaScript strict warning: resource://testing-common/sinon-2.3.2.js, line 8941: ReferenceError: reference to undefined property "iso-8859-8-i"
[task 2019-01-29T17:11:47.251Z] 17:11:47 INFO - (xpcshell/head.js) | test MAIN run_test pending (1)
[task 2019-01-29T17:11:47.253Z] 17:11:47 INFO - (xpcshell/head.js) | test run_next_test 0 pending (2)
[task 2019-01-29T17:11:47.254Z] 17:11:47 INFO - (xpcshell/head.js) | test MAIN run_test finished (2)
[task 2019-01-29T17:11:47.255Z] 17:11:47 INFO - running event loop
[task 2019-01-29T17:11:47.256Z] 17:11:47 INFO - "CONSOLE_MESSAGE: (warn) [JavaScript Warning: "ReferenceError: reference to undefined property "iso-8859-8-i"" {file: "resource://testing-common/sinon-2.3.2.js" line: 8941}]"
[task 2019-01-29T17:11:47.258Z] 17:11:47 INFO - browser/components/urlbar/tests/unit/test_UrlbarController_unit.js | Starting setup
[task 2019-01-29T17:11:47.259Z] 17:11:47 INFO - (xpcshell/head.js) | test setup pending (2)
[task 2019-01-29T17:11:47.260Z] 17:11:47 INFO - (xpcshell/head.js) | test run_next_test 0 finished (2)
[task 2019-01-29T17:11:47.260Z] 17:11:47 INFO - (xpcshell/head.js) | test run_next_test 1 pending (2)
[task 2019-01-29T17:11:47.262Z] 17:11:47 INFO - (xpcshell/head.js) | test setup finished (2)
[task 2019-01-29T17:11:47.263Z] 17:11:47 INFO - browser/components/urlbar/tests/unit/test_UrlbarController_unit.js | Starting test_constructor_throws
[task 2019-01-29T17:11:47.264Z] 17:11:47 INFO - (xpcshell/head.js) | test test_constructor_throws pending (2)
[task 2019-01-29T17:11:47.264Z] 17:11:47 INFO - TEST-PASS | browser/components/urlbar/tests/unit/test_UrlbarController_unit.js | test_constructor_throws - [test_constructor_throws : 59] . Should throw if the browserWindow was not supplied

Flags: needinfo?(adw)
Backout by csabou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2b73321e629d
Backed out changeset 7065c7171760 for xpcshell failures on test_UrlbarController_unit.

The addition to the controller test got tripped up by the rename of MATCH_SOURCE to RESULT_SOURCE in bug 1522425, which landed on autoland earlier today but hasn't landed on m-c yet. Fix coming up.

Flags: needinfo?(adw)
Pushed by dwillcoxon@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/303a009b3ef9
Add autofill tests: controller tests. r=Standard8
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 67

Uh, I never relanded the input tests after they were backed out. Bug 1523753 happened while those tests were briefly in autoland though, so I need to fix that first.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Once bug 1523753 is fixed, I'll reland the input tests. My changes didn't cause the leak, and they probably don't make it worse, but I'll hold off on relanding anyway until that's resolved.

Pushed by dwillcoxon@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4c2502aad681
Add autofill tests: input tests. r=dao
Status: REOPENED → RESOLVED
Closed: 9 months ago9 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.