Refs #482: Changes http_status.js tests for Gecko
It seems that Gecko has a different behavior than Phantomjs's webkit on some HTTP response: 102, 118 and 408. Let's do not tests on these http code with Gecko.
Showing
1 changed file
with
19 additions
and
5 deletions
... | @@ -15,19 +15,33 @@ casper.test.begin("HTTP status code handling", 163, { | ... | @@ -15,19 +15,33 @@ casper.test.begin("HTTP status code handling", 163, { |
15 | response.write(""); | 15 | response.write(""); |
16 | response.close(); | 16 | response.close(); |
17 | }); | 17 | }); |
18 | var isGecko = (phantom.casperEngine === 'slimerjs'); | ||
19 | |||
18 | this.testCodes = [ | 20 | this.testCodes = [ |
19 | 100, 101, 102, 118, 200, 201, 202, 203, 204, 205, 206, 207, 210, | 21 | 100, 101, 200, 201, 202, 203, 204, 205, 206, 207, 210, |
20 | 300, 301, 302, 303, 304, 305, 307, 310 | 22 | 300, 301, 302, 303, 304, 305, 307, 310 |
21 | ]; | 23 | ]; |
22 | if (utils.ltVersion(phantom.version, '1.9.0')) { | 24 | if (!isGecko) { |
25 | // it seems that the network layer of Gecko does not process these response | ||
26 | this.testCodes.push(102); | ||
27 | this.testCodes.push(118); | ||
28 | } | ||
29 | |||
30 | if (utils.ltVersion(phantom.version, '1.9.0') || isGecko) { | ||
23 | // https://github.com/ariya/phantomjs/issues/11163 | 31 | // https://github.com/ariya/phantomjs/issues/11163 |
24 | this.testCodes = this.testCodes.concat([ | 32 | this.testCodes = this.testCodes.concat([ |
25 | 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, | 33 | 400, 401, 402, 403, 404, 405, 406, 407, 409, 410, 411, 412, 413, |
26 | 414, 415, 416, 417, 418, 422, 423, 424, 425, 426, 449, 450, | 34 | 414, 415, 416, 417, 418, 422, 423, 424, 425, 426, 449, 450, |
27 | 500, 501, 502, 503, 504, 505, 507, 509 | 35 | 500, 501, 502, 503, 504, 505, 507, 509 |
28 | ]); | 36 | ]); |
29 | } else { | 37 | if (!isGecko) { |
30 | test.skip(102); | 38 | // it seems that the network layer of Gecko has a different |
39 | // behavior for 408 than PhantomJS's webkit | ||
40 | this.testCodes.push(408); | ||
41 | } | ||
42 | } | ||
43 | if ((this.testCodes.length * 3) < 165 ) { | ||
44 | test.skip(163 - (this.testCodes.length * 3 - 2) ); | ||
31 | } | 45 | } |
32 | }, | 46 | }, |
33 | 47 | ... | ... |
-
Please register or sign in to post a comment