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

21 lines
588 B
JavaScript

//! unsupported
var webpage = require('webpage');
async_test(function () {
var page = webpage.create();
var requestCount = 0;
page.onRepaintRequested = this.step_func(function(x, y, w, h) {
if ((w > 0) && (h > 0)) {
++requestCount;
}
});
page.open(TEST_HTTP_BASE + 'hello.html',
this.step_func_done(function (status) {
assert_equals(status, 'success');
assert_greater_than(requestCount, 0);
}));
}, "onRepaintRequested should be called at least once for each page load");