gecko/browser/base/content/test/tabview/browser_tabview_bug634158.js
Tim Taubert ef1f986004 Bug 631752 - Tab aspect ratio gets changed on drag-drop orphaning [r=ian]
--HG--
extra : rebase_source : ddac3b95a6bc946e31edc88ba1d54df9a1c84e48
2011-03-28 20:20:26 +02:00

32 lines
900 B
JavaScript

/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
function test() {
waitForExplicitFinish();
newWindowWithTabView(function (win) {
registerCleanupFunction(function () {
if (!win.closed)
win.close();
});
let tabItem = win.gBrowser.tabs[0]._tabViewTabItem;
tabItem.parent.remove(tabItem);
let cw = win.TabView.getContentWindow();
let container = cw.iQ(tabItem.container);
let expander = cw.iQ('.expander', container);
let bounds = container.bounds();
let halfWidth = bounds.width / 2;
let halfHeight = bounds.height / 2;
let rect = new cw.Rect(bounds.left + halfWidth, bounds.top + halfHeight,
halfWidth, halfHeight);
ok(rect.contains(expander.bounds()), "expander is in the tabItem's bottom-right corner");
win.close();
finish();
});
}