-
Notifications
You must be signed in to change notification settings - Fork 343
/
exists.js
26 lines (24 loc) · 891 Bytes
/
exists.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
* Test for BrowserContext#exists()
*
* A browser context should exist when a tab is opened. It should no longer exist after
* being disconnected.
*/
function runTest()
{
var browser = new FW.Firebug.BTI.Browser(); // TODO
var url = FBTest.getHTTPURLBase()+"bti/browsercontext/testScripts.html";
browser.addEventListener("onContextCreated", function(context)
{
FBTest.compare(context.getURL(), url, "URL of newly created context should be " +url);
FBTest.ok(context.exists(), "Context should exist when created");
browser.disconnect();
FBTest.ok(!context.exists(), "Context should not exist when disconnected");
FBTest.testDone("done test #exists()");
});
FBTest.progress("exists, open test page "+url);
FBTest.openNewTab(url, function(win)
{
FBTest.progress("exists, new tab opened "+url);
});
}