mirror of https://github.com/vitalif/phantomjs
Port the test to check for plugin non-existence.
https://github.com/ariya/phantomjs/issues/124392.0
parent
f85238322e
commit
83f4baf8c6
|
@ -0,0 +1,17 @@
|
||||||
|
var assert = require('../../assert');
|
||||||
|
var webpage = require('webpage');
|
||||||
|
|
||||||
|
var page = webpage.create();
|
||||||
|
|
||||||
|
var pluginLength = page.evaluate(function() {
|
||||||
|
return window.navigator.plugins.length;
|
||||||
|
});
|
||||||
|
assert.equal(pluginLength, 0);
|
||||||
|
|
||||||
|
page.open('http://localhost:9180/hello.html', function (status) {
|
||||||
|
assert.equal(status, 'success');
|
||||||
|
var pluginLength = page.evaluate(function() {
|
||||||
|
return window.navigator.plugins.length;
|
||||||
|
});
|
||||||
|
assert.equal(pluginLength, 0);
|
||||||
|
});
|
|
@ -38,6 +38,7 @@ TESTS = [
|
||||||
'module/webpage/abort-network-request.js',
|
'module/webpage/abort-network-request.js',
|
||||||
'module/webpage/resource-request-error.js',
|
'module/webpage/resource-request-error.js',
|
||||||
'module/webpage/resource-received-error.js',
|
'module/webpage/resource-received-error.js',
|
||||||
|
'module/webpage/no-plugin.js',
|
||||||
'module/system/system.js',
|
'module/system/system.js',
|
||||||
'module/system/args.js',
|
'module/system/args.js',
|
||||||
'module/system/os.js',
|
'module/system/os.js',
|
||||||
|
|
|
@ -641,12 +641,6 @@ describe("WebPage object", function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should not load any NPAPI plugins (e.g. Flash)", function() {
|
|
||||||
runs(function() {
|
|
||||||
expect(page.evaluate(function () { return window.navigator.plugins.length; })).toEqual(0);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("reports unhandled errors", function() {
|
it("reports unhandled errors", function() {
|
||||||
var lastError = null;
|
var lastError = null;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue