зеркало из https://github.com/mozilla/gecko-dev.git
Bug 670452. Fix WindowSnapshot's windowutils codepath to work correctly for canvases of different sizes. r=joe
This commit is contained in:
Родитель
e4a0fb65db
Коммит
3b926816f1
|
@ -36,7 +36,19 @@ function compareSnapshots(s1, s2, expected) {
|
|||
var s1Str, s2Str;
|
||||
var correct = false;
|
||||
if (gWindowUtils) {
|
||||
correct = ((gWindowUtils.compareCanvases(s1, s2, {}) == 0) == expected);
|
||||
// First, check that the canvases are the same size.
|
||||
var equal;
|
||||
if (s1.width != s2.width || s1.height != s2.height) {
|
||||
equal = false;
|
||||
} else {
|
||||
try {
|
||||
equal = (gWindowUtils.compareCanvases(s1, s2, {}) == 0);
|
||||
} catch (e) {
|
||||
equal = false;
|
||||
ok(false, "Exception thrown from compareCanvases: " + e);
|
||||
}
|
||||
}
|
||||
correct = (equal == expected);
|
||||
}
|
||||
|
||||
if (!correct) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче