Bug 1325778 - Wait for storage updates before proceeding with test. r=MattN
authorJared Wein <jwein@mozilla.com>
Tue, 02 Apr 2019 18:24:23 +0000
changeset 467653 f0df19a1280a8722a23e148197208cb557689686
parent 467652 4edd84663f956428a125e54cddafd73f633dae64
child 467654 71a1c61543e49af28e83e9d1b7f46e822cf4af9b
push id35806
push userrgurzau@mozilla.com
push dateWed, 03 Apr 2019 04:07:39 +0000
treeherdermozilla-central@45808ab18609 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1325778
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1325778 - Wait for storage updates before proceeding with test. r=MattN Differential Revision: https://phabricator.services.mozilla.com/D25022
toolkit/components/passwordmgr/test/mochitest/pwmgr_common.js
toolkit/components/passwordmgr/test/mochitest/test_basic_form_autocomplete.html
toolkit/components/passwordmgr/test/mochitest/test_insecure_form_field_autocomplete.html
--- a/toolkit/components/passwordmgr/test/mochitest/pwmgr_common.js
+++ b/toolkit/components/passwordmgr/test/mochitest/pwmgr_common.js
@@ -39,28 +39,31 @@ function $_(formNum, name) {
 }
 
 /**
  * Check autocomplete popup results to ensure that expected
  * values are being shown correctly as items in the popup.
  */
 function checkAutoCompleteResults(actualValues, expectedValues, hostname, msg) {
   if (hostname !== null) {
+    isnot(actualValues.length, 0, "There should be items in the autocomplete popup: " + JSON.stringify(actualValues));
+
     // Check the footer first.
     let footerResult = actualValues[actualValues.length - 1];
     ok(footerResult.includes("View Saved Logins"), "the footer text is shown correctly");
     ok(footerResult.includes(hostname), "the footer has the correct hostname attribute");
   }
 
   if (hostname === null) {
     checkArrayValues(actualValues, expectedValues, msg);
     return;
   }
 
-  if (actualValues.length == 0) {
+  if (actualValues.length == 1) {
+    is(expectedValues.length, 0, "If only the footer is present then there should be no expectedValues");
     info("Only the footer is present in the popup");
     return;
   }
 
   // Check the rest of the autocomplete item values.
   checkArrayValues(actualValues.slice(0, -1), expectedValues, msg);
 }
 
--- a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_autocomplete.html
+++ b/toolkit/components/passwordmgr/test/mochitest/test_basic_form_autocomplete.html
@@ -491,28 +491,26 @@ add_task(async function test_form1_check
   restoreForm();
   let shownPromise = promiseACShown();
   synthesizeKey("KEY_ArrowDown"); // open
   await shownPromise;
 
   /* test 56 */
   // Delete the only remaining entry, "testuser2"
   synthesizeKey("KEY_ArrowDown");
+  let storageChanged = promiseStorageChanged(["removeLogin", "removeLogin", "addLogin"]);
   synthesizeKey("KEY_Delete", {shiftKey: true});
   checkACForm("", "");
   let numLogins = LoginManager.countLogins("https://example.com", "https://autocomplete:8888", null);
   is(numLogins, 1, "Correct number of logins after deleting one");
 
   // remove the logins for the previous tests
   setupScript.sendSyncMessage("removeLogin", "login0");
-  setupScript.sendSyncMessage("removeLogin", "login1");
-  setupScript.sendSyncMessage("removeLogin", "login2");
-  setupScript.sendSyncMessage("removeLogin", "login3");
-  setupScript.sendSyncMessage("removeLogin", "login4");
   setupScript.sendSyncMessage("addLogin", "login5");
+  await storageChanged;
 });
 
 /* Tests for single-user forms for ignoring autocomplete=off */
 add_task(async function test_form2() {
   await setFormAndWaitForFieldFilled(`
     <form id="form2" action="https://autocomplete2" onsubmit="return false;">
       <input  type="text"       name="uname">
       <input  type="password"   name="pword" autocomplete="off">
@@ -632,22 +630,26 @@ add_task(async function test_form6_chang
   synthesizeKey("KEY_ArrowRight");
   synthesizeKey("X", {shiftKey: true});
   // Trigger the 'blur' event on uname
   pword.focus();
   await spinEventLoop();
   checkACForm("singleuser5X", "singlepass5");
   uname.focus();
 
+  let storageChanged = promiseStorageChanged(["removeLogin"]);
   setupScript.sendSyncMessage("removeLogin", "login5");
+  await storageChanged;
 });
 
 add_task(async function test_form7() {
+  let storageChanged = promiseStorageChanged(["addLogin", "addLogin"]);
   setupScript.sendSyncMessage("addLogin", "login6A");
   setupScript.sendSyncMessage("addLogin", "login6B");
+  await storageChanged;
   await setFormAndWaitForFieldFilled(`
     <!-- This form will be manipulated to insert a different username field. -->
     <form id="form7" action="https://autocomplete3" onsubmit="return false;">
       <input  type="text"       name="uname">
       <input  type="password"   name="pword">
       <button type="submit">Submit</button>
     </form>`, {fieldSelector: `input[name="uname"]`, fieldValue: ""});
 
@@ -661,42 +663,53 @@ add_task(async function test_form7() {
   newField.setAttribute("type", "text");
   newField.setAttribute("name", "uname2");
   pword.parentNode.insertBefore(newField, pword);
   is($_(7, "uname2").value, "", "Verifying empty uname2");
 
   // Delete login6B. It was created just to prevent filling in a login
   // automatically, removing it makes it more likely that we'll catch a
   // future regression with form filling here.
+  storageChanged = promiseStorageChanged(["removeLogin"]);
   setupScript.sendSyncMessage("removeLogin", "login6B");
+  await storageChanged;
 });
 
 add_task(async function test_form7_2() {
   restoreForm();
   let shownPromise = promiseACShown();
   synthesizeKey("KEY_ArrowDown"); // open
-  await shownPromise;
+  let results = await shownPromise;
+  checkAutoCompleteResults(results,
+                           ["form7user1"],
+                           "example.com",
+                           "Check dropdown is showing all logins while field is blank");
 
   // Check first entry
   synthesizeKey("KEY_ArrowDown");
   checkACForm("", ""); // value shouldn't update
   synthesizeKey("KEY_Enter");
   // The form changes, so we expect the old username field to get the
   // selected autocomplete value, but neither the new username field nor
   // the password field should have any values filled in.
-  await spinEventLoop();
+  await SimpleTest.promiseWaitForCondition(() => uname.value == "form7user1",
+                                           "Wait for username to get filled");
   checkACForm("form7user1", "");
   is($_(7, "uname2").value, "", "Verifying empty uname2");
   restoreForm(); // clear field, so reloading test doesn't fail
 
+  let storageChanged = promiseStorageChanged(["removeLogin"]);
   setupScript.sendSyncMessage("removeLogin", "login6A");
+  await storageChanged;
 });
 
 add_task(async function test_form8() {
+  let storageChanged = promiseStorageChanged(["addLogin"]);
   setupScript.sendSyncMessage("addLogin", "login7");
+  await storageChanged;
   await setFormAndWaitForFieldFilled(`
     <!-- This form will be manipulated to insert a different username field. -->
     <form id="form7" action="https://autocomplete3" onsubmit="return false;">
       <input  type="text"       name="uname">
       <input  type="password"   name="pword">
       <button type="submit">Submit</button>
     </form>
     <!-- test for no autofill after onblur with blank username -->
@@ -720,76 +733,94 @@ add_task(async function test_form8_blur(
 
 add_task(async function test_form8_2() {
   checkACForm("", "");
   restoreForm();
 });
 
 add_task(async function test_form8_3() {
   checkACForm("", "");
+  let storageChanged = promiseStorageChanged(["removeLogin", "addLogin", "addLogin"]);
   setupScript.sendSyncMessage("removeLogin", "login7");
   setupScript.sendSyncMessage("addLogin", "login8A");
   setupScript.sendSyncMessage("addLogin", "login8B");
+  await storageChanged;
 });
 
 add_task(async function test_form9_filtering() {
   await setFormAndWaitForFieldFilled(`
     <!-- test autocomplete dropdown -->
     <form id="form9" action="https://autocomplete5" onsubmit="return false;">
       <input  type="text"       name="uname">
       <input  type="password"   name="pword">
       <button type="submit">Submit</button>
     </form>`, {fieldSelector: `input[name="uname"]`, fieldValue: ""});
 
   // Turn our attention to form9 to test the dropdown - bug 497541
+  let shownPromise = promiseACShown();
   uname = $_(9, "uname");
   pword = $_(9, "pword");
   uname.focus();
-  let shownPromise = promiseACShown();
+  let results = await shownPromise;
+  checkAutoCompleteResults(results,
+                           ["form9userAAB", "form9userAB"],
+                           "example.com",
+                           "Check dropdown is showing all logins while field is blank");
+  synthesizeKey("KEY_Escape"); // Need to close the popup so we can get another popupshown after sending the string below.
+
+  shownPromise = promiseACShown();
   sendString("form9userAB");
-  await shownPromise;
+  results = await shownPromise;
+  checkAutoCompleteResults(results,
+                           ["form9userAB"],
+                           "example.com",
+                           "Check dropdown is showing login with only one 'A'");
 
   checkACForm("form9userAB", "");
   uname.focus();
   synthesizeKey("KEY_ArrowLeft");
   shownPromise = promiseACShown();
   synthesizeKey("A", {shiftKey: true});
-  let results = await shownPromise;
+  results = await shownPromise;
 
   checkACForm("form9userAAB", "");
   checkAutoCompleteResults(results, ["form9userAAB"], "example.com", "Check dropdown is updated after inserting 'A'");
   synthesizeKey("KEY_ArrowDown");
   synthesizeKey("KEY_Enter");
   await promiseFormsProcessed();
   checkACForm("form9userAAB", "form9pass");
 });
 
 add_task(async function test_form9_autocomplete_cache() {
   // Note that this addLogin call will only be seen by the autocomplete
   // attempt for the synthesizeKey if we do not successfully cache the
   // autocomplete results.
+  let storageChanged = promiseStorageChanged(["addLogin"]);
   setupScript.sendSyncMessage("addLogin", "login8C");
+  await storageChanged;
   uname.focus();
   let promise1 = notifyMenuChanged(1);
   sendString("z");
   let results = await promise1;
   checkAutoCompleteResults(results, [], "example.com", "Check popup does not have any login items");
 
   // check that empty results are cached - bug 496466
   promise1 = notifyMenuChanged(1);
   sendString("z");
   results = await promise1;
   checkAutoCompleteResults(results, [], "example.com", "Check popup only has the footer when it opens");
 });
 
 add_task(async function test_form11_formless() {
+  let storageChanged = promiseStorageChanged(["removeLogin", "removeLogin", "removeLogin", "addLogin"]);
   setupScript.sendSyncMessage("removeLogin", "login8A");
   setupScript.sendSyncMessage("removeLogin", "login8B");
   setupScript.sendSyncMessage("removeLogin", "login8C");
   setupScript.sendSyncMessage("addLogin", "login11");
+  await storageChanged;
   await setFormAndWaitForFieldFilled(`
     <!-- tests <form>-less autocomplete -->
     <div id="form11">
       <input  type="text"       name="uname" id="uname">
       <input  type="password"   name="pword" id="pword">
       <button type="submit">Submit</button>
     </div>`, {fieldSelector: `input[name="uname"]`, fieldValue: "testuser11"});
 
@@ -831,21 +862,25 @@ add_task(async function test_form11_open
   synthesizeMouseAtCenter(uname, {});
   await firePrivEventPromise;
   await shownPromise;
   synthesizeKey("KEY_ArrowDown");
   const processedPromise = promiseFormsProcessed();
   synthesizeKey("KEY_Enter");
   await processedPromise;
   checkACForm("testuser11", "testpass11");
+  let storageChanged = promiseStorageChanged(["removeLogin"]);
   setupScript.sendSyncMessage("removeLogin", "login11");
+  await storageChanged;
 });
 
 add_task(async function test_form12_recipes() {
+  let storageChanged = promiseStorageChanged(["addLogin"]);
   setupScript.sendSyncMessage("addLogin", "login10");
+  await storageChanged;
   await setFormAndWaitForFieldFilled(`
     <!-- test for onUsernameInput recipe testing -->
     <form id="form12" action="https://autocomplete7" onsubmit="return false;">
       <input  type="text"   name="1">
       <input  type="text"   name="2">
       <button type="submit">Submit</button>
     </form>`, {fieldSelector: `input[name="1"]`, fieldValue: ""});
 
--- a/toolkit/components/passwordmgr/test/mochitest/test_insecure_form_field_autocomplete.html
+++ b/toolkit/components/passwordmgr/test/mochitest/test_insecure_form_field_autocomplete.html
@@ -439,17 +439,19 @@ add_task(async function test_form1_delet
   let shownPromise = promiseACShown();
   synthesizeKey("KEY_ArrowDown"); // open
   await shownPromise;
 
   synthesizeKey("KEY_ArrowDown"); // skip insecure warning
   // Delete the second entry (of 3), "testuser3"
   synthesizeKey("KEY_ArrowDown");
   synthesizeKey("KEY_ArrowDown");
+  let storageChanged = promiseStorageChanged(["removeLogin"]);
   synthesizeKey("KEY_Delete", {shiftKey: true});
+  await storageChanged;
   checkACForm("", "");
   let numLogins = LoginManager.countLogins("http://mochi.test:8888", "", null);
   is(numLogins, 3, "Correct number of logins after deleting one");
   synthesizeKey("KEY_Enter");
   await promiseFormsProcessed();
   checkACForm("zzzuser4", "zzzpass4");
 });
 
@@ -473,17 +475,19 @@ add_task(async function test_form1_delet
   synthesizeKey("KEY_ArrowDown"); // open
   await shownPromise;
 
   synthesizeKey("KEY_ArrowDown"); // skip insecure warning
   // test 54
   // Delete the last entry (of 2), "zzzuser4"
   synthesizeKey("KEY_ArrowDown");
   synthesizeKey("KEY_ArrowDown");
+  let storageChanged = promiseStorageChanged(["removeLogin"]);
   synthesizeKey("KEY_Delete", {shiftKey: true});
+  await storageChanged;
   checkACForm("", "");
   let numLogins = LoginManager.countLogins("http://mochi.test:8888", "", null);
   is(numLogins, 2, "Correct number of logins after deleting one");
   synthesizeKey("KEY_ArrowDown"); // skip insecure warning
   synthesizeKey("KEY_ArrowDown");
   synthesizeKey("KEY_Enter");
   await promiseFormsProcessed();
   checkACForm("testuser2", "testpass2");
@@ -508,28 +512,32 @@ add_task(async function test_form1_check
   let shownPromise = promiseACShown();
   synthesizeKey("KEY_ArrowDown"); // open
   await shownPromise;
 
   synthesizeKey("KEY_ArrowDown"); // skip insecure warning
   // test 56
   // Delete the only remaining entry, "testuser2"
   synthesizeKey("KEY_ArrowDown");
+  let storageChanged = promiseStorageChanged(["removeLogin", "removeLogin"]);
   synthesizeKey("KEY_Delete", {shiftKey: true});
   checkACForm("", "");
   let numLogins = LoginManager.countLogins("http://mochi.test:8888", "", null);
   is(numLogins, 1, "Correct number of logins after deleting one");
 
   // remove the login that's not shown in the list.
   setupScript.sendSyncMessage("removeLogin", "login0");
+  await storageChanged;
 });
 
 // Tests for single-user forms for ignoring autocomplete=off
 add_task(async function test_form2() {
+  let storageChanged = promiseStorageChanged(["addLogin"]);
   setupScript.sendSyncMessage("addLogin", "login5");
+  await storageChanged;
   await setFormAndWaitForFieldFilled(`
     <!-- other forms test single logins, with autocomplete=off set -->
     <form id="form2" action="http://autocomplete2" onsubmit="return false;">
       <input  type="text"       name="uname">
       <input  type="password"   name="pword" autocomplete="off">
       <button type="submit">Submit</button>
     </form>`, {fieldSelector: `input[name="uname"]`, fieldValue: "singleuser5"});
 
@@ -650,22 +658,26 @@ add_task(async function test_form6_chang
   synthesizeKey("KEY_ArrowRight");
   synthesizeKey("X", {shiftKey: true});
   // Trigger the 'blur' event on uname
   pword.focus();
   await spinEventLoop();
   checkACForm("singleuser5X", "singlepass5");
   uname.focus();
 
+  let storageChanged = promiseStorageChanged(["removeLogin"]);
   setupScript.sendSyncMessage("removeLogin", "login5");
+  await storageChanged;
 });
 
 add_task(async function test_form7() {
+  let storageChanged = promiseStorageChanged(["addLogin", "addLogin"]);
   setupScript.sendSyncMessage("addLogin", "login6A");
   setupScript.sendSyncMessage("addLogin", "login6B");
+  await storageChanged;
   await setFormAndWaitForFieldFilled(`
     <!-- This form will be manipulated to insert a different username field. -->
     <form id="form7" action="http://autocomplete3" onsubmit="return false;">
       <input  type="text"       name="uname">
       <input  type="password"   name="pword">
       <button type="submit">Submit</button>
     </form>`, {fieldSelector: `input[name="uname"]`, fieldValue: ""});
 
@@ -679,17 +691,19 @@ add_task(async function test_form7() {
   newField.setAttribute("type", "text");
   newField.setAttribute("name", "uname2");
   pword.parentNode.insertBefore(newField, pword);
   is($_(7, "uname2").value, "", "Verifying empty uname2");
 
   // Delete login6B. It was created just to prevent filling in a login
   // automatically, removing it makes it more likely that we'll catch a
   // future regression with form filling here.
+  storageChanged = promiseStorageChanged(["removeLogin"]);
   setupScript.sendSyncMessage("removeLogin", "login6B");
+  await storageChanged;
 });
 
 add_task(async function test_form7_2() {
   restoreForm();
   let shownPromise = promiseACShown();
   synthesizeKey("KEY_ArrowDown"); // open
   await shownPromise;
 
@@ -701,21 +715,25 @@ add_task(async function test_form7_2() {
   // The form changes, so we expect the old username field to get the
   // selected autocomplete value, but neither the new username field nor
   // the password field should have any values filled in.
   await spinEventLoop();
   checkACForm("form7user1", "");
   is($_(7, "uname2").value, "", "Verifying empty uname2");
   restoreForm(); // clear field, so reloading test doesn't fail
 
+  let storageChanged = promiseStorageChanged(["removeLogin"]);
   setupScript.sendSyncMessage("removeLogin", "login6A");
+  await storageChanged;
 });
 
 add_task(async function test_form8() {
+  let storageChanged = promiseStorageChanged(["addLogin"]);
   setupScript.sendSyncMessage("addLogin", "login7");
+  await storageChanged;
   await setFormAndWaitForFieldFilled(`
     <!-- This form will be manipulated to insert a different username field. -->
     <form id="form7" action="http://autocomplete3" onsubmit="return false;">
       <input  type="text"       name="uname">
       <input  type="password"   name="pword">
       <button type="submit">Submit</button>
     </form>
     <!-- test for no autofill after onblur with blank username -->
@@ -740,44 +758,57 @@ add_task(async function test_form8_blur(
 
 add_task(async function test_form8_2() {
   checkACForm("", "");
   restoreForm();
 });
 
 add_task(async function test_form8_3() {
   checkACForm("", "");
-  setupScript.sendSyncMessage("removeLogin", "login7");
 });
 
 add_task(async function test_form9_filtering() {
+  let storageChanged = promiseStorageChanged(["removeLogin", "addLogin", "addLogin"]);
+  setupScript.sendSyncMessage("removeLogin", "login7");
   setupScript.sendSyncMessage("addLogin", "login8A");
   setupScript.sendSyncMessage("addLogin", "login8B");
+  await storageChanged;
   await setFormAndWaitForFieldFilled(`
     <!-- test autocomplete dropdown -->
     <form id="form9" action="http://autocomplete5" onsubmit="return false;">
       <input  type="text"       name="uname">
       <input  type="password"   name="pword">
       <button type="submit">Submit</button>
     </form>`, {fieldSelector: `input[name="uname"]`, fieldValue: ""});
 
   // Turn our attention to form9 to test the dropdown - bug 497541
+  let shownPromise = promiseACShown();
   uname = $_(9, "uname");
   pword = $_(9, "pword");
   uname.focus();
-  let shownPromise = promiseACShown();
+  let results = await shownPromise;
+  checkAutoCompleteResults(results,
+                           ["This connection is not secure. Logins entered here could be compromised. Learn More", "form9userAAB", "form9userAB"],
+                           "mochi.test",
+                           "Check dropdown is showing all logins while field is blank");
+  synthesizeKey("KEY_Escape"); // Need to close the popup so we can get another popupshown after sending the string below.
+  shownPromise = promiseACShown();
   sendString("form9userAB");
-  await shownPromise;
+  results = await shownPromise;
+  checkAutoCompleteResults(results,
+                           ["This connection is not secure. Logins entered here could be compromised. Learn More", "form9userAB"],
+                           "mochi.test",
+                           "Check dropdown is showing login with only one 'A'");
 
   checkACForm("form9userAB", "");
   uname.focus();
   synthesizeKey("KEY_ArrowLeft");
   shownPromise = promiseACShown();
   synthesizeKey("A", {shiftKey: true});
-  let results = await shownPromise;
+  results = await shownPromise;
 
   checkACForm("form9userAAB", "");
   checkAutoCompleteResults(results,
                            ["This connection is not secure. Logins entered here could be compromised. Learn More", "form9userAAB"],
                            "mochi.test",
                            "Check dropdown is updated after inserting 'A'");
   synthesizeKey("KEY_ArrowDown"); // skip insecure warning
   synthesizeKey("KEY_ArrowDown");
@@ -785,17 +816,19 @@ add_task(async function test_form9_filte
   await promiseFormsProcessed();
   checkACForm("form9userAAB", "form9pass");
 });
 
 add_task(async function test_form9_autocomplete_cache() {
   // Note that this addLogin call will only be seen by the autocomplete
   // attempt for the synthesizeKey if we do not successfully cache the
   // autocomplete results.
+  let storageChanged = promiseStorageChanged(["addLogin"]);
   setupScript.sendSyncMessage("addLogin", "login8C");
+  await storageChanged;
   uname.focus();
   let promise2 = notifyMenuChanged(2);
   let shownPromise = promiseACShown();
   sendString("z");
   let results = await promise2;
   await shownPromise;
   checkAutoCompleteResults(results,
                            ["This connection is not secure. Logins entered here could be compromised. Learn More"],
@@ -804,23 +837,27 @@ add_task(async function test_form9_autoc
   // check that empty results are cached - bug 496466
   promise2 = notifyMenuChanged(2);
   sendString("z");
   results = await promise2;
   checkAutoCompleteResults(results,
                            ["This connection is not secure. Logins entered here could be compromised. Learn More"],
                            "mochi.test",
                            "Check popup only has the footer and insecure warning");
+  storageChanged = promiseStorageChanged(["removeLogin", "removeLogin", "removeLogin"]);
   setupScript.sendSyncMessage("removeLogin", "login8A");
   setupScript.sendSyncMessage("removeLogin", "login8B");
   setupScript.sendSyncMessage("removeLogin", "login8C");
+  await storageChanged;
 });
 
 add_task(async function test_form11_recipes() {
+  let storageChanged = promiseStorageChanged(["addLogin"]);
   setupScript.sendSyncMessage("addLogin", "login10");
+  await storageChanged;
   await loadRecipes({
     siteRecipes: [{
       "hosts": ["mochi.test:8888"],
       "usernameSelector": "input[name='1']",
       "passwordSelector": "input[name='2']",
     }],
   });
   await setFormAndWaitForFieldFilled(`
@@ -870,19 +907,21 @@ add_task(async function test_form12_form
     <div id="form12">
       <input  type="text"       name="uname" id="uname">
       <input  type="password"   name="pword" id="pword">
       <button type="submit">Submit</button>
     </div>`, {fieldSelector: `input[name="uname"]`, fieldValue: ""});
 
   uname = $_(12, "uname");
   pword = $_(12, "pword");
-  restoreForm();
-  checkACForm("", "");
   let shownPromise = promiseACShown();
+  uname.focus();
+  await shownPromise;
+  synthesizeKey("KEY_Escape"); // close the autocomplete popup
+  shownPromise = promiseACShown();
   synthesizeKey("KEY_ArrowDown"); // open
   let results = await shownPromise;
 
   let expectedMenuItems = ["This connection is not secure. Logins entered here could be compromised. Learn More",
                            "testuser10"];
   checkAutoCompleteResults(results, expectedMenuItems, "mochi.test", "Check all menuitems are displayed correctly.");
   synthesizeKey("KEY_ArrowDown"); // skip insecure warning
   synthesizeKey("KEY_ArrowDown");