Enable the loadAndSave test for OdfContainer.

This commit is contained in:
Jos van den Oever
2015-09-02 09:49:16 +02:00
parent 3d016853b3
commit a0d3a73d66
3 changed files with 12 additions and 15 deletions
+1
View File
@@ -36,3 +36,4 @@ test.odt
simple.odt
simpleFrame.odt
webodf/tests/*.odt
webodf/tests/odf/newloadsave.odt
+11 -15
View File
@@ -324,16 +324,13 @@ odf.OdfContainerTests = function OdfContainerTests(runner) {
);
}
/*
function compareZipEntryList(odf1path, odf2path, callback) {
var z1 = new core.Zip(odf1path, function (err, z1) {
var dummy = new core.Zip(odf1path, function (err, z1) {
t.err = err;
r.shouldBeNull(t, "t.err");
var z2 = new core.Zip(odf2path, function (err, z2) {
dummy = new core.Zip(odf2path, function (err, z2) {
t.err = err;
r.shouldBeNull(t, "t.err");
r.shouldBe(t, "t.e1", "t.e2.length");
t.e1 = z1.getEntries();
t.e2 = z2.getEntries();
r.shouldBe(t, "t.e1.length", "t.e2.length");
@@ -357,18 +354,17 @@ odf.OdfContainerTests = function OdfContainerTests(runner) {
t.allPresent = j !== t.e2.length;
}
r.shouldBe(t, "t.allPresent", "true");
callback();
checkMimeType(t, odf2path, callback);
});
return z2;
});
return z1;
return dummy;
}
function compare(odf1, odf2, odf1path, odf2path, callback) {
function compare(odf1path, odf2path, callback) {
compareZipEntryList(odf1path, odf2path, callback);
}
function loadAndSave(callback) {
var path = "odf/styletest.odt",
newpath = "odf/newstyletest.odt";
var path = "odf/loadsave.odt",
newpath = "odf/newloadsave.odt";
t.odf = new odf.OdfContainer(path, function (o1) {
t.odf = o1;
r.shouldBe(t, "t.odf.state", "odf.OdfContainer.DONE");
@@ -378,12 +374,12 @@ odf.OdfContainerTests = function OdfContainerTests(runner) {
t.odf2 = new odf.OdfContainer(newpath, function (o2) {
t.odf2 = o2;
r.shouldBe(t, "t.odf2.state", "odf.OdfContainer.DONE");
compare(o1, o2, path, newpath, callback);
compare(path, newpath, callback);
});
});
});
}
*/
this.tests = function () {
return r.name([
createNewText,
@@ -404,8 +400,8 @@ odf.OdfContainerTests = function OdfContainerTests(runner) {
testDefaultStyleOnlyFontFaceDeclsSaveAsAndLoadRoundTrip,
testStyleOnlyFontFaceDeclsSaveAsAndLoadRoundTrip,
testAutomaticStyleOnlyFontFaceDeclsSaveAsAndLoadRoundTrip,
testMultiStylesFontFaceDeclsSaveAsAndLoadRoundTrip
//loadAndSave
testMultiStylesFontFaceDeclsSaveAsAndLoadRoundTrip,
loadAndSave
]);
};
};
Binary file not shown.