4372674c99
This patch improves phantom_shim: - introduce WebPage.loading/WebPage.loadingProgress - improve compatibility of WebPage.onInitialized. This allows to pass phantomjs tests, even though the implementation is hacky. - teach PhantomResponse about "stage" state which could be either "start" or "end" - unskip a bunch of phantom webpage tests: - webpage/change-request-encoded-url - webpage/loading.js - webpage/long-running-javascript.js - webpage/modify-header.js - webpage/on-initialized.js - webpage/remove-header.js
22 lines
669 B
JavaScript
22 lines
669 B
JavaScript
async_test(function () {
|
|
var webpage = require('webpage');
|
|
var page = webpage.create();
|
|
|
|
assert_type_of(page, 'object');
|
|
assert_type_of(page.loading, 'boolean');
|
|
assert_type_of(page.loadingProgress, 'number');
|
|
|
|
assert_is_false(page.loading);
|
|
assert_equals(page.loadingProgress, 0);
|
|
|
|
page.open(TEST_HTTP_BASE + 'hello.html',
|
|
this.step_func_done(function (status) {
|
|
assert_equals(status, 'success');
|
|
assert_equals(page.loading, false);
|
|
assert_equals(page.loadingProgress, 100);
|
|
}));
|
|
|
|
assert_is_true(page.loading);
|
|
assert_greater_than(page.loadingProgress, 0);
|
|
}, "page loading progress");
|