Commit 89e2b85c 89e2b85c6b7f412bf03a55f390a1dbf448bc3d58 by Chris Bosco

Request: Fix userAgent tests

refs #401
1 parent 11a7feb8
...@@ -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);
......