Bug 1225202, part 3 - Create files in test_fileapi_slice.html using SpecialPowers.createFiles. r=baku

This makes the test work with e10s enabled.

Remove createFileWithData from fileutils.js which is no longer used.
This commit is contained in:
Andrew McCreight 2015-11-19 10:24:20 -08:00
Родитель 76e045febd
Коммит 0679656434
3 изменённых файлов: 15 добавлений и 23 удалений

Просмотреть файл

@ -127,23 +127,6 @@ function testHasRun() {
}
}
function createFileWithData(fileData) {
var dirSvc = SpecialPowers.Cc["@mozilla.org/file/directory_service;1"].getService(SpecialPowers.Ci.nsIProperties);
var testFile = dirSvc.get("ProfD", SpecialPowers.Ci.nsIFile);
testFile.append("fileAPItestfile2-" + fileNum);
fileNum++;
var outStream = SpecialPowers.Cc["@mozilla.org/network/file-output-stream;1"].createInstance(SpecialPowers.Ci.nsIFileOutputStream);
outStream.init(testFile, 0x02 | 0x08 | 0x20, // write, create, truncate
0666, 0);
outStream.write(fileData, fileData.length);
outStream.close();
var fileList = document.getElementById('fileList');
SpecialPowers.wrap(fileList).value = testFile.path;
return fileList.files[0];
}
function gc() {
window.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
.getInterface(SpecialPowers.Ci.nsIDOMWindowUtils)

Просмотреть файл

@ -742,7 +742,7 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' #bug 904183 # b2g(bug 904183
[test_encodeToStringWithMaxLength.html]
[test_fileapi.html]
[test_fileapi_slice.html]
skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #bug 775227
skip-if = buildapp == 'b2g' || toolkit == 'android' #bug 775227
[test_getElementById.html]
[test_html_colors_quirks.html]
[test_html_colors_standards.html]

Просмотреть файл

@ -85,7 +85,8 @@ var testBinaryData = "";
// that we're testing with files that are large enough.
ok(size > 65536, "test data sufficiently large");
basicTest([createFileWithData(fileData)]);
SpecialPowers.createFiles([{name: "basicTestFile", data: fileData}],
basicTest);
function basicTest(files) {
var fileFile = files[0];
@ -104,7 +105,9 @@ function basicTest(files) {
}
// image in the middle
imageMiddleTest([createFileWithData(testBinaryData + fileData + testBinaryData)]);
SpecialPowers.createFiles([{name: "middleTestFile",
data: testBinaryData + fileData + testBinaryData}],
imageMiddleTest);
}
function imageMiddleTest(files) {
@ -116,7 +119,9 @@ function imageMiddleTest(files) {
expectedTestCount++;
// image at start
imageStartTest([createFileWithData(fileData + testBinaryData)]);
SpecialPowers.createFiles([{name: "startTestFile",
data: fileData + testBinaryData}],
imageStartTest);
}
function imageStartTest(files) {
@ -128,7 +133,9 @@ function imageStartTest(files) {
expectedTestCount++;
// image at end
imageEndTest([createFileWithData(testBinaryData + fileData)]);
SpecialPowers.createFiles([{name: "endTestFile",
data: testBinaryData + fileData}],
imageEndTest);
}
function imageEndTest(files) {
@ -140,7 +147,9 @@ function imageEndTest(files) {
expectedTestCount++;
// image past end
imagePastEndTest([createFileWithData(testBinaryData + fileData)]);
SpecialPowers.createFiles([{name: "pastEndTestFile",
data: testBinaryData + fileData}],
imagePastEndTest);
}
function imagePastEndTest(files) {