mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
28 lines
819 B
JavaScript
28 lines
819 B
JavaScript
//! unsupported
|
|
var webpage = require('webpage');
|
|
|
|
async_test(function () {
|
|
var page = webpage.create();
|
|
|
|
var url = TEST_HTTP_BASE + "cdn-cgi/pe/bag?r%5B%5D="+
|
|
"http%3A%2F%2Fwww.example.org%2Fcdn-cgi%2Fnexp%2F"+
|
|
"abv%3D927102467%2Fapps%2Fabetterbrowser.js";
|
|
var receivedUrl;
|
|
|
|
page.onResourceRequested = this.step_func(function(requestData, request) {
|
|
request.changeUrl(requestData.url);
|
|
});
|
|
|
|
page.onResourceReceived = this.step_func(function(data) {
|
|
if (data.stage === 'end') {
|
|
receivedUrl = data.url;
|
|
}
|
|
});
|
|
|
|
page.open(url, this.step_func_done(function (status) {
|
|
assert_equals(status, 'success');
|
|
assert_equals(receivedUrl, url);
|
|
}));
|
|
|
|
}, "encoded URLs properly round-trip through request.changeUrl");
|