Tests: add compareGradientColors helper function.

This commit is contained in:
Jonathan Puckey 2011-05-21 12:09:00 +02:00
parent 46b1311260
commit 5d48a7383a

View file

@ -88,6 +88,16 @@ function compareGrayColors(color1, color2, message) {
(message || '') + ' gray');
}
function compareGradientColors(color1, color2) {
Base.each(['origin', 'destination', 'hilite'], function(key) {
equals(color1[key].toString(), color2[key].toString(),
'color1[' + key + '].toString() == color2[' + key + '].toString()');
});
equals(function() {
return color1.gradient.equals(color2.gradient);
}, true);
}
function cloneAndCompare(item) {
var copy = item.clone();
compareItems(item, copy);