1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 add_task(async function test() {
6 let prefs = ["history", "historyAndFormData"];
8 for (let pref of prefs) {
9 // This test relies on the form history being empty to start with delete
10 // all the items first.
11 // The TabContextMenu initializes its strings only on a focus or mouseover event.
12 // Calls focus event on the TabContextMenu early in the test.
13 gBrowser.selectedTab.focus();
14 await FormHistory.update({ op: "remove" });
16 // Sanitize now so we can test the baseline point.
17 await Sanitizer.sanitize([pref]);
18 await gFindBarPromise;
19 ok(!gFindBar.hasTransactions, "pre-test baseline for sanitizer");
21 gFindBar.getElement("findbar-textbox").value = "m";
22 ok(gFindBar.hasTransactions, "formdata can be cleared after input");
24 await Sanitizer.sanitize(["formdata"]);
26 gFindBar.getElement("findbar-textbox").value,
28 "findBar textbox should be empty after sanitize"
30 ok(!gFindBar.hasTransactions, "No transactions after sanitize");