Bug 725647. (Bv1a) test_embeds.xul: Use new openBrowserWindow(). f=sgautherie r=surkov.alexander.

This commit is contained in:
Mark Capella 2012-02-13 21:03:43 +01:00
parent b2bb1f78ee
commit 772d8a7ef2

View File

@ -21,27 +21,11 @@
src="../events.js"></script>
<script type="application/javascript"
src="../relations.js"></script>
<script type="application/javascript"
src="../browser.js"></script>
<script type="application/javascript">
<![CDATA[
////////////////////////////////////////////////////////////////////////////
// Helpers
function tabBrowser()
{
return gBrowserWnd.gBrowser;
}
function currentBrowser()
{
return tabBrowser().selectedBrowser;
}
function currentTabDocument()
{
return currentBrowser().contentDocument;
}
////////////////////////////////////////////////////////////////////////////
// Invokers
@ -58,7 +42,7 @@
this.finalCheck = function loadURI_finalCheck()
{
testRelation(gBrowserWnd.document, RELATION_EMBEDS,
testRelation(browserDocument(), RELATION_EMBEDS,
getAccessible(currentTabDocument()));
}
@ -81,7 +65,7 @@
this.finalCheck = function loadURI_finalCheck()
{
testRelation(gBrowserWnd.document, RELATION_EMBEDS,
testRelation(browserDocument(), RELATION_EMBEDS,
getAccessible(currentTabDocument()));
}
@ -94,28 +78,12 @@
////////////////////////////////////////////////////////////////////////////
// Testing
var gBrowserWnd = null;
function loadBrowser()
{
gBrowserWnd = window.openDialog("chrome://browser/content/", "_blank",
"chrome,all,dialog=no", "about:");
addA11yLoadEvent(startTests, gBrowserWnd);
}
function startTests()
{
// Wait for tab load.
var browser = currentBrowser();
addA11yLoadEvent(doTests, browser.contentWindow);
}
//gA11yEventDumpToConsole = true; // debug
var gQueue = null;
function doTests()
{
testRelation(gBrowserWnd.document, RELATION_EMBEDS,
testRelation(browserDocument(), RELATION_EMBEDS,
getAccessible(currentTabDocument()));
gQueue = new eventQueue();
@ -125,13 +93,13 @@
gQueue.onFinish = function()
{
gBrowserWnd.close();
closeBrowserWindow();
}
gQueue.invoke();
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(loadBrowser);
openBrowserWindow(doTests, "about:");
]]>
</script>