Request: Fix userAgent tests
refs #401
Showing
2 changed files
with
3 additions
and
3 deletions
... | @@ -2175,7 +2175,7 @@ function createPage(casper) { | ... | @@ -2175,7 +2175,7 @@ function createPage(casper) { |
2175 | casper.handleReceivedResource(resource); | 2175 | casper.handleReceivedResource(resource); |
2176 | }; | 2176 | }; |
2177 | page.onResourceRequested = function onResourceRequested(requestData, request) { | 2177 | page.onResourceRequested = function onResourceRequested(requestData, request) { |
2178 | casper.emit('resource.requested', request); | 2178 | casper.emit('resource.requested', requestData, request); |
2179 | if (request.url === casper.requestUrl) { | 2179 | if (request.url === casper.requestUrl) { |
2180 | casper.emit('page.resource.requested', request); | 2180 | casper.emit('page.resource.requested', request); |
2181 | } | 2181 | } | ... | ... |
... | @@ -6,8 +6,8 @@ function testUA(ua, match) { | ... | @@ -6,8 +6,8 @@ function testUA(ua, match) { |
6 | ); | 6 | ); |
7 | } | 7 | } |
8 | 8 | ||
9 | function fetchUA(request) { | 9 | function fetchUA(requestData, request) { |
10 | var headers = request.headers.filter(function(header) { | 10 | var headers = requestData.headers.filter(function(header) { |
11 | return header.name === "User-Agent"; | 11 | return header.name === "User-Agent"; |
12 | }); | 12 | }); |
13 | casper.test.assert(headers.length > 0); | 13 | casper.test.assert(headers.length > 0); | ... | ... |
-
Please register or sign in to post a comment