Skip to content

Commit 6f5f828

Browse files
committed
Remove unused code
1 parent 31f8b08 commit 6f5f828

File tree

1 file changed

+1
-92
lines changed

1 file changed

+1
-92
lines changed

test/testHelper.js

Lines changed: 1 addition & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
"use strict";
22

33
window.testHelper = (function () {
4-
var module = {},
5-
tempPath = null,
6-
tempPathCounter = 0;
4+
var module = {};
75

86
module.fixturesPath = "fixtures/";
97

@@ -27,67 +25,6 @@ window.testHelper = (function () {
2725
});
2826
};
2927

30-
module.testImageUrl = function (url, callback) {
31-
loadImage(
32-
url,
33-
function () {
34-
callback(true);
35-
},
36-
function () {
37-
callback(false);
38-
}
39-
);
40-
};
41-
42-
module.createImageOfSize = function (width, height, callback) {
43-
module.loadImageFromUrl(
44-
"data:image/svg+xml;charset=utf-8," +
45-
encodeURIComponent(
46-
'<svg xmlns="http://www.w3.org/2000/svg" width="' +
47-
width +
48-
'" height="' +
49-
height +
50-
'"></svg>'
51-
),
52-
callback
53-
);
54-
};
55-
56-
module.getFileUrl = function (filePath) {
57-
var fs = require("fs");
58-
59-
return "file://" + fs.absolute(filePath);
60-
};
61-
62-
function tempPathName() {
63-
return "/tmp/csscriticTest." + Math.floor(Math.random() * 10000) + "/";
64-
}
65-
66-
var createMainTempPath = function () {
67-
var fs = require("fs"),
68-
path = tempPathName();
69-
70-
while (fs.exists(path)) {
71-
path = tempPathName();
72-
}
73-
74-
fs.makeDirectory(path);
75-
return path;
76-
};
77-
78-
module.createTempPath = function () {
79-
var fs = require("fs"),
80-
tempSubPath;
81-
82-
if (tempPath === null) {
83-
tempPath = createMainTempPath();
84-
}
85-
tempSubPath = tempPath + "/" + tempPathCounter + "/";
86-
tempPathCounter += 1;
87-
fs.makeDirectory(tempSubPath);
88-
return tempSubPath;
89-
};
90-
9128
module.failedPromise = function (e) {
9229
var defer = ayepromise.defer();
9330
defer.reject(e);
@@ -116,33 +53,5 @@ window.testHelper = (function () {
11653
};
11754
};
11855

119-
var doWait = function (predicate, timeout, callback) {
120-
var checkIntervalLengh = 100;
121-
122-
if (predicate()) {
123-
callback(true);
124-
} else if (timeout > 0) {
125-
setTimeout(function () {
126-
doWait(predicate, timeout - checkIntervalLengh, callback);
127-
}, checkIntervalLengh);
128-
} else {
129-
callback(false);
130-
}
131-
};
132-
133-
module.waitsFor = function (predicate) {
134-
var timeout = 2000;
135-
136-
return new Promise(function (fulfill, reject) {
137-
doWait(predicate, timeout, function (predicateResovled) {
138-
if (predicateResovled) {
139-
fulfill();
140-
} else {
141-
reject();
142-
}
143-
});
144-
});
145-
};
146-
14756
return module;
14857
})();

0 commit comments

Comments
 (0)