puppeteer/third_party/phantomjs/test/module/webpage/local-urls-enabled.js
2017-05-11 00:06:41 -07:00

24 lines
680 B
JavaScript

//! unsupported
//! phantomjs: --local-url-access=yes
var webpage = require("webpage");
async_test(function () {
var page = webpage.create();
var url = "file:///nonexistent";
var rsErrorCalled = false;
page.onResourceError = this.step_func(function (error) {
rsErrorCalled = true;
assert_equals(error.url, url);
assert_equals(error.errorCode, 203);
assert_regexp_match(error.errorString,
/^Error opening\b.*?\bnonexistent:/);
});
page.open(url, this.step_func_done(function () {
assert_is_true(rsErrorCalled);
}));
}, "attempts to load a file: URL with --local-url-access=yes");