Commit 4c6547a1 authored by Gijs Kruitbosch's avatar Gijs Kruitbosch
Browse files

Bug 1532501 - stopgap: make browser_toolbarButtonKeyPress.js more reliable, r=jaws

parent cd1fbef5
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -201,14 +201,18 @@ add_task(async function testSendTabToDeviceButtonPress() {
// This is a toolbarbutton with a click handler and no command handler, but
// the toolbar keyboard navigation code should handle keyboard activation.
add_task(async function testReloadButtonPress() {
  await BrowserTestUtils.withNewTab("https://example.com", async function(
  await BrowserTestUtils.withNewTab("https://example.com/1", async function(
    aBrowser
  ) {
    let button = document.getElementById("reload-button");
    info("Waiting for button to be enabled.");
    await TestUtils.waitForCondition(() => !button.disabled);
    forceFocus(button);
    let loaded = BrowserTestUtils.browserLoaded(aBrowser);
    info("Focusing button");
    forceFocus(button);
    info("Pressing space on the button");
    EventUtils.synthesizeKey(" ");
    info("Waiting for load.");
    await loaded;
    ok(true, "Page loaded after Reload button pressed");
  });