Port the test to change the encoded URL of network request.

https://github.com/ariya/phantomjs/issues/12439