2016-10-20 12:33:42 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2017-06-22 13:51:42 +03:00
|
|
|
add_task(async function runTests() {
|
|
|
|
let tab = await BrowserTestUtils.openNewForegroundTab(
|
|
|
|
gBrowser,
|
|
|
|
"about:about"
|
|
|
|
);
|
2016-10-20 12:33:42 +03:00
|
|
|
|
2017-06-22 13:51:42 +03:00
|
|
|
registerCleanupFunction(function() {
|
2016-10-20 12:33:42 +03:00
|
|
|
gBrowser.removeTab(tab);
|
|
|
|
});
|
|
|
|
|
|
|
|
let browser = tab.linkedBrowser;
|
|
|
|
|
2017-11-28 13:38:15 +03:00
|
|
|
let loaded = BrowserTestUtils.browserLoaded(browser);
|
2018-08-29 17:46:43 +03:00
|
|
|
BrowserTestUtils.loadURI(browser, "about:config");
|
2017-11-28 13:38:15 +03:00
|
|
|
let href = await loaded;
|
|
|
|
is(href, "about:config", "Check about:config loaded");
|
2016-10-20 12:33:42 +03:00
|
|
|
|
|
|
|
// Using a dummy onunload listener to disable the bfcache as that can prevent
|
|
|
|
// the test browser load detection mechanism from working.
|
2017-11-28 13:38:15 +03:00
|
|
|
loaded = BrowserTestUtils.browserLoaded(browser);
|
2018-08-29 17:46:43 +03:00
|
|
|
BrowserTestUtils.loadURI(
|
|
|
|
browser,
|
|
|
|
"data:text/html,<body%20onunload=''><iframe></iframe></body>"
|
|
|
|
);
|
2017-11-28 13:38:15 +03:00
|
|
|
href = await loaded;
|
2016-10-20 12:33:42 +03:00
|
|
|
is(
|
|
|
|
href,
|
|
|
|
"data:text/html,<body%20onunload=''><iframe></iframe></body>",
|
|
|
|
"Check data URL loaded"
|
|
|
|
);
|
|
|
|
|
2017-11-28 13:38:15 +03:00
|
|
|
loaded = BrowserTestUtils.browserLoaded(browser);
|
2016-10-20 12:33:42 +03:00
|
|
|
browser.goBack();
|
2017-11-28 13:38:15 +03:00
|
|
|
href = await loaded;
|
|
|
|
is(href, "about:config", "Check we've gone back to about:config");
|
2016-10-20 12:33:42 +03:00
|
|
|
|
2017-11-28 13:38:15 +03:00
|
|
|
loaded = BrowserTestUtils.browserLoaded(browser);
|
2016-10-20 12:33:42 +03:00
|
|
|
browser.goForward();
|
2017-11-28 13:38:15 +03:00
|
|
|
href = await loaded;
|
2016-10-20 12:33:42 +03:00
|
|
|
is(
|
|
|
|
href,
|
|
|
|
"data:text/html,<body%20onunload=''><iframe></iframe></body>",
|
|
|
|
"Check we've gone forward to data URL"
|
|
|
|
);
|
|
|
|
});
|