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

18 lines
420 B
JavaScript

//! unsupported
test(function () {
var page = require('webpage').create();
var msg = "message",
value = "value",
result,
expected = "extra-value";
page.onPrompt = function(msg, value) {
return "extra-"+value;
};
result = page.evaluate(function(m, v) {
return window.prompt(m, v);
}, msg, value);
assert_equals(result, expected);
}, "page.onPrompt");