Skip to content

Commit 4fbca4c

Browse files
committed
Do not support SpecRunner.html via file://
We stopped doing this in 65b1239
1 parent 615348c commit 4fbca4c

File tree

4 files changed

+27
-48
lines changed

4 files changed

+27
-48
lines changed

src/.jshintrc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"proxies": true,
1919
"documentUtil": true,
2020
"documentHelper": true,
21-
"mediaQueryHelper": true,
2221
"browser": true,
2322
"svg2image": true,
2423
"document2svg": true,
@@ -38,7 +37,6 @@
3837
"proxies",
3938
"browser",
4039
"documentUtil",
41-
"documentHelper",
42-
"mediaQueryHelper"
40+
"documentHelper"
4341
]
4442
}

test/.jshintrc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,14 @@
1515
"spyOn": true,
1616

1717
"ifNotInWebkitOrBlinkIt": true,
18-
"ifNotInHeadlessChromeAndNotLocalRunnerIt": true,
19-
"ifNotInWebKitAndNotLocalRunnerIt": true,
20-
"ifNotLocalRunnerIt": true,
18+
"ifNotInHeadlessChrome": true,
2119
"testHelper": true,
2220
"diffHelper": true,
2321

2422
"util": true,
2523
"proxies": true,
2624
"documentUtil": true,
2725
"documentHelper": true,
28-
"mediaQueryHelper": true,
2926
"browser": true,
3027
"svg2image": true,
3128
"document2svg": true,

test/helpers.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
var isWebkitOrBlink = navigator.userAgent.indexOf("WebKit") >= 0,
55
isHeadlessChrome = navigator.userAgent.indexOf("HeadlessChrome") >= 0,
6-
isLocalRunner =
7-
document.baseURI.substr(0, "file://".length) === "file://",
86
testDisabledOnCondition = function (condition, text, functionHandle) {
97
var spec = it(text, functionHandle);
108
if (condition) {
@@ -15,17 +13,7 @@
1513
window.ifNotInWebkitOrBlinkIt = function (text, functionHandle) {
1614
return testDisabledOnCondition(isWebkitOrBlink, text, functionHandle);
1715
};
18-
window.ifNotInHeadlessChromeAndNotLocalRunnerIt = function (
19-
text,
20-
functionHandle
21-
) {
22-
return testDisabledOnCondition(
23-
isHeadlessChrome || isLocalRunner,
24-
text,
25-
functionHandle
26-
);
27-
};
28-
window.ifNotLocalRunnerIt = function (text, functionHandle) {
29-
return testDisabledOnCondition(isLocalRunner, text, functionHandle);
16+
window.ifNotInHeadlessChrome = function (text, functionHandle) {
17+
return testDisabledOnCondition(isHeadlessChrome, text, functionHandle);
3018
};
3119
})();

test/specs/integration.test.js

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@ describe("Integration test", function () {
152152
.finally(done);
153153
});
154154

155-
// This fails in Firefox probably due to https://bugzilla.mozilla.org/show_bug.cgi?id=942138
156-
ifNotInHeadlessChromeAndNotLocalRunnerIt(
155+
ifNotInHeadlessChrome(
157156
"should take a URL and load non UTF-8 content",
158157
function (done) {
159158
var inlineReferencesSpy = spyOn(
@@ -181,31 +180,28 @@ describe("Integration test", function () {
181180
}
182181
);
183182

184-
ifNotLocalRunnerIt(
185-
"should work around Firefox bug with `null` style properties",
186-
function (done) {
187-
// The bug only turns up when there's no JS executed which creates a new document
188-
// In addition this test will fail due to https://bugzilla.mozilla.org/show_bug.cgi?id=942138
189-
rasterizeHTML
190-
.drawURL(testHelper.fixturesPath + "test.html", {
191-
cache: "none",
192-
active: ".bgimage",
193-
hover: ".webfont",
194-
clip: "body",
195-
width: 200,
196-
height: 100,
197-
})
198-
.then(function (result) {
199-
forceImageSizeForPlatformCompatibility(result.image);
200-
expect(result.image).toEqualImage(referenceImg, 2);
201-
})
202-
.catch(function (err) {
203-
expect(err).toBe(null);
204-
fail();
205-
})
206-
.finally(done);
207-
}
208-
);
183+
it("should work around Firefox bug with `null` style properties", function (done) {
184+
// The bug only turns up when there's no JS executed which creates a new document
185+
// In addition this test will fail due to https://bugzilla.mozilla.org/show_bug.cgi?id=942138
186+
rasterizeHTML
187+
.drawURL(testHelper.fixturesPath + "test.html", {
188+
cache: "none",
189+
active: ".bgimage",
190+
hover: ".webfont",
191+
clip: "body",
192+
width: 200,
193+
height: 100,
194+
})
195+
.then(function (result) {
196+
forceImageSizeForPlatformCompatibility(result.image);
197+
expect(result.image).toEqualImage(referenceImg, 2);
198+
})
199+
.catch(function (err) {
200+
expect(err).toBe(null);
201+
fail();
202+
})
203+
.finally(done);
204+
});
209205

210206
it("should report a source error on invalid input from HTML", function (done) {
211207
rasterizeHTML

0 commit comments

Comments
 (0)