Bug 1096804 - Enable existing taskbar tests. Remove one test that uses old sync api. r=me

This commit is contained in:
Jim Mathies 2016-01-12 11:08:34 -06:00
parent 9e48f3f866
commit 5127430884
2 changed files with 1 additions and 37 deletions

View File

@ -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

View File

@ -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;
}
}