mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1096804 - Enable existing taskbar tests. Remove one test that uses old sync api. r=me
This commit is contained in:
parent
7940f9c518
commit
539a002c6d
@ -21,4 +21,4 @@ support-files =
|
||||
[browser_SignInToWebsite.js]
|
||||
skip-if = e10s # Bug 941426 - SignIntoWebsite.jsm not e10s friendly
|
||||
[browser_taskbar_preview.js]
|
||||
skip-if = os != win || e10s # Bug 666808 - AeroPeek support for e10s
|
||||
skip-if = os != win
|
||||
|
@ -50,19 +50,6 @@ function test() {
|
||||
ok(checkSelectedTab(), "Current tab is correctly selected");
|
||||
});
|
||||
|
||||
let currentSelectedTab = gBrowser.selectedTab;
|
||||
for (let idx of [1,2,3,4]) {
|
||||
let preview = getPreviewForTab(gBrowser.tabs[0]);
|
||||
let canvas = createThumbnailSurface(preview);
|
||||
let ctx = canvas.getContext("2d");
|
||||
preview.controller.drawThumbnail(ctx, canvas.width, canvas.height);
|
||||
ok(currentSelectedTab.selected, "Drawing thumbnail does not change selection");
|
||||
canvas = getCanvas(preview.controller.width, preview.controller.height);
|
||||
ctx = canvas.getContext("2d");
|
||||
preview.controller.drawPreview(ctx);
|
||||
ok(currentSelectedTab.selected, "Drawing preview does not change selection");
|
||||
}
|
||||
|
||||
// Close #4
|
||||
getPreviewForTab(gBrowser.selectedTab).controller.onClose();
|
||||
checkPreviews(3, "Expected number of previews after closing selected tab via controller");
|
||||
@ -117,26 +104,3 @@ function test() {
|
||||
function isTabSelected(idx) {
|
||||
return gBrowser.tabs[idx].selected;
|
||||
}
|
||||
|
||||
function createThumbnailSurface(p) {
|
||||
let thumbnailWidth = 200,
|
||||
thumbnailHeight = 120;
|
||||
let ratio = p.controller.thumbnailAspectRatio;
|
||||
|
||||
if (thumbnailWidth/thumbnailHeight > ratio)
|
||||
thumbnailWidth = thumbnailHeight * ratio;
|
||||
else
|
||||
thumbnailHeight = thumbnailWidth / ratio;
|
||||
|
||||
return getCanvas(thumbnailWidth, thumbnailHeight);
|
||||
}
|
||||
|
||||
function getCanvas(width, height) {
|
||||
let win = window.QueryInterface(Ci.nsIDOMWindow);
|
||||
let doc = win.document;
|
||||
let canvas = doc.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
|
||||
canvas.width = width;
|
||||
canvas.height = height;
|
||||
return canvas;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user