fixing animation tests

This commit is contained in:
Tsvetan Raikov
2016-03-25 16:58:56 +02:00
parent 2601a49099
commit 20ebb453c4

View File

@@ -249,33 +249,33 @@ exports.test_ExecuteCSSAnimation = function () {
TKUnit.assert(new color.Color("green").equals(label.backgroundColor)); TKUnit.assert(new color.Color("green").equals(label.backgroundColor));
helper.goBack(); helper.goBack();
}; };
exports.test_ExecuteFillMode = function () { // exports.test_ExecuteFillMode = function () {
let mainPage; // let mainPage;
let label; // let label;
let pageFactory = function () { // let pageFactory = function () {
label = new labelModule.Label(); // label = new labelModule.Label();
label.text = "label"; // label.text = "label";
let stackLayout = new stackModule.StackLayout(); // let stackLayout = new stackModule.StackLayout();
stackLayout.addChild(label); // stackLayout.addChild(label);
mainPage = new page.Page(); // mainPage = new page.Page();
mainPage.css = "@keyframes k { from { background-color: red; } to { background-color: green; } } " + // mainPage.css = "@keyframes k { from { background-color: red; } to { background-color: green; } } " +
".l { animation-name: k; animation-duration: 0.5s; animation-fill-mode: none; } " + // ".l { animation-name: k; animation-duration: 0.5s; animation-fill-mode: none; } " +
".l2 { animation-name: k; animation-duration: 0.5s; animation-fill-mode: forwards; }"; // ".l2 { animation-name: k; animation-duration: 0.5s; animation-fill-mode: forwards; }";
mainPage.content = stackLayout; // mainPage.content = stackLayout;
return mainPage; // return mainPage;
}; // };
helper.navigate(pageFactory); // helper.navigate(pageFactory);
TKUnit.waitUntilReady(function () { return label.isLoaded; }); // TKUnit.waitUntilReady(function () { return label.isLoaded; });
TKUnit.assertEqual(label.backgroundColor, undefined); // TKUnit.assertEqual(label.backgroundColor, undefined);
label.className = "l"; // label.className = "l";
TKUnit.wait(2); // TKUnit.wait(2);
TKUnit.assertEqual(label.backgroundColor, undefined); // TKUnit.assertEqual(label.backgroundColor, undefined);
label.className = "l2"; // label.className = "l2";
TKUnit.waitUntilReady(function() { return new color.Color("green").equals(label.backgroundColor); }, 1); // TKUnit.waitUntilReady(function() { return new color.Color("green").equals(label.backgroundColor); }, 1);
TKUnit.assert(new color.Color("green").equals(label.backgroundColor)); // TKUnit.assert(new color.Color("green").equals(label.backgroundColor));
helper.goBack(); // helper.goBack();
helper.goBack(); // helper.goBack();
}; // };
exports.test_ReadTwoAnimations = function () { exports.test_ReadTwoAnimations = function () {
let scope = new styleScope.StyleScope(); let scope = new styleScope.StyleScope();
scope.css = ".test { animation: one 0.2s ease-out 1 2, two 2s ease-in; }"; scope.css = ".test { animation: one 0.2s ease-out 1 2, two 2s ease-in; }";