-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
caca1a0
commit e3f1a4b
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* See license.txt for terms of usage */ | ||
|
||
"use strict"; | ||
|
||
const { click, addNewLayer, waitForEvents, removeLayer, sendPopupMessage } = require("./common.js"); | ||
const { closeTab } = require("sdk/tabs/utils"); | ||
|
||
/** | ||
* xxxHonza TODO docs | ||
*/ | ||
exports["test Layer Invert"] = function(assert, done) { | ||
addNewLayer().then(config => { | ||
let popup = config.popup; | ||
let layer = config.layer; | ||
|
||
// xxxHonza: the scale change should be done through the form UI. | ||
let props = { scale: 2 }; | ||
sendPopupMessage(popup, "modify", [layer.id, props]); | ||
|
||
// Wait till the layer is modified on the backend. | ||
waitForEvents(popup, ["layer-modified"]).then(result => { | ||
// Get layer info from the backend. | ||
popup.front.getLayerInfo(layer.id).then(response => { | ||
let style = response.content.image.style; | ||
let index = style.indexOf("transform:scale(2)"); | ||
|
||
assert.ok(index > -1, "Layer's image must be scaled"); | ||
|
||
// Clean up | ||
removeLayer(popup, layer.id).then(() => { | ||
config.popup.destroy().then(() => { | ||
closeTab(config.tab); | ||
done(); | ||
}); | ||
}); | ||
}) | ||
}); | ||
}); | ||
}; | ||
|
||
require("sdk/test").run(exports); |