diff --git a/dom/html/test/file_fullscreen-api.html b/dom/html/test/file_fullscreen-api.html
index b79856d9a660..25eb18aa814b 100644
--- a/dom/html/test/file_fullscreen-api.html
+++ b/dom/html/test/file_fullscreen-api.html
@@ -305,7 +305,7 @@ function testNamespaces(followupTestFn) {
});
}
- elem.requestFullscreen();
+ SimpleTest.waitForFocus(() => elem.requestFullscreen());
}
runNextNamespaceTest();
diff --git a/dom/html/test/file_fullscreen-prefixed.html b/dom/html/test/file_fullscreen-prefixed.html
index 5f3d60196aa3..a7fc4ebe19cb 100644
--- a/dom/html/test/file_fullscreen-prefixed.html
+++ b/dom/html/test/file_fullscreen-prefixed.html
@@ -103,7 +103,7 @@ class TestCase {
}
};
this.changeListeners("add", eventType, handleEvent);
- actionCallback();
+ SimpleTest.waitForFocus(() => actionCallback());
});
}