diff --git a/src/test/java/org/htmlunit/javascript/host/Location2Test.java b/src/test/java/org/htmlunit/javascript/host/Location2Test.java index 66892cd0ac..af36759fef 100644 --- a/src/test/java/org/htmlunit/javascript/host/Location2Test.java +++ b/src/test/java/org/htmlunit/javascript/host/Location2Test.java @@ -438,7 +438,9 @@ public void replaceLastInHistory() throws Exception { @Alerts("on-load") public void replaceOnload() throws Exception { final String html - = "First"; - final String[] expectedAlerts = getExpectedAlerts(); final URL url = URL_FIRST; final String origin = url.getProtocol() + "://" + url.getHost() + ':' + url.getPort(); - for (int i = 0; i < expectedAlerts.length; i++) { - expectedAlerts[i] = expectedAlerts[i].replaceAll("§§ORIGIN§§", origin); - } + expandExpectedAlertsVariables(origin); - final WebDriver driver = loadPage2(html); - verifyAlerts(driver, expectedAlerts); + loadPageVerifyTitle2(html); } /** * @throws Exception if the test fails */ @Test - @Alerts("§§ORIGIN§§") + @Alerts("§§URL§§") public void documentOrigin() throws Exception { final String html = ""; - final String[] expectedAlerts = getExpectedAlerts(); final URL url = URL_FIRST; final String origin = url.getProtocol() + "://" + url.getHost() + ':' + url.getPort(); - for (int i = 0; i < expectedAlerts.length; i++) { - expectedAlerts[i] = expectedAlerts[i].replaceAll("§§ORIGIN§§", origin); - } + expandExpectedAlertsVariables(origin); - final WebDriver driver = loadPage2(html); - verifyAlerts(driver, expectedAlerts); + loadPageVerifyTitle2(html); } /**