Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
89e2b85c
...
89e2b85c6b7f412bf03a55f390a1dbf448bc3d58
authored
2013-03-04 17:44:05 -0500
by
Chris Bosco
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Request: Fix userAgent tests
refs #401
1 parent
11a7feb8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
modules/casper.js
tests/suites/casper/agent.js
modules/casper.js
View file @
89e2b85
...
...
@@ -2175,7 +2175,7 @@ function createPage(casper) {
casper
.
handleReceivedResource
(
resource
);
};
page
.
onResourceRequested
=
function
onResourceRequested
(
requestData
,
request
)
{
casper
.
emit
(
'resource.requested'
,
request
);
casper
.
emit
(
'resource.requested'
,
request
Data
,
request
);
if
(
request
.
url
===
casper
.
requestUrl
)
{
casper
.
emit
(
'page.resource.requested'
,
request
);
}
...
...
tests/suites/casper/agent.js
View file @
89e2b85
...
...
@@ -6,8 +6,8 @@ function testUA(ua, match) {
);
}
function
fetchUA
(
request
)
{
var
headers
=
request
.
headers
.
filter
(
function
(
header
)
{
function
fetchUA
(
request
Data
,
request
)
{
var
headers
=
request
Data
.
headers
.
filter
(
function
(
header
)
{
return
header
.
name
===
"User-Agent"
;
});
casper
.
test
.
assert
(
headers
.
length
>
0
);
...
...
Please
register
or
sign in
to post a comment