2009-10-14 15:43:20 -07:00
|
|
|
// Very basic tests for the main window UI
|
2009-03-18 20:28:42 -07:00
|
|
|
|
2009-10-14 15:43:20 -07:00
|
|
|
const Cc = Components.classes;
|
|
|
|
const Ci = Components.interfaces;
|
2009-03-18 20:28:42 -07:00
|
|
|
|
2009-10-14 15:43:20 -07:00
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
// Entry point (must be named "test")
|
|
|
|
function test() {
|
2009-10-15 21:00:14 -07:00
|
|
|
is(window.location.href, "chrome://browser/content/browser.xul", "Main window should be browser.xul");
|
2010-09-29 14:48:20 -07:00
|
|
|
|
2009-10-15 21:00:14 -07:00
|
|
|
window.focus();
|
2010-09-29 14:48:20 -07:00
|
|
|
|
2009-10-15 21:00:14 -07:00
|
|
|
let browser = Browser.selectedBrowser;
|
|
|
|
isnot(browser, null, "Should have a browser");
|
2010-09-29 14:48:20 -07:00
|
|
|
|
2009-10-15 21:00:14 -07:00
|
|
|
is(browser.currentURI.spec, Browser.selectedTab.browser.currentURI.spec, "selectedBrowser == selectedTab.browser");
|
2010-09-29 14:48:20 -07:00
|
|
|
|
2009-10-15 21:00:14 -07:00
|
|
|
testContentContainerSize();
|
2009-10-15 12:00:39 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function testContentContainerSize() {
|
2010-09-16 12:29:03 -07:00
|
|
|
let container = document.getElementById("content-viewport");
|
2009-10-15 12:00:39 -07:00
|
|
|
|
2010-09-16 12:29:03 -07:00
|
|
|
let rect = container.getBoundingClientRect();
|
2010-09-29 14:48:20 -07:00
|
|
|
is(rect.width, window.innerWidth, "Content container is same width as window");
|
|
|
|
is(rect.height, window.innerHeight, "Content container is same height as window");
|
2009-10-14 15:43:20 -07:00
|
|
|
}
|