mirror of
https://github.com/ariya/phantomjs.git
synced 2024-09-11 12:55:33 +03:00
Port the test to check for plugin non-existence.
https://github.com/ariya/phantomjs/issues/12439
This commit is contained in:
parent
f85238322e
commit
83f4baf8c6
17
test/module/webpage/no-plugin.js
Normal file
17
test/module/webpage/no-plugin.js
Normal file
@ -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/resource-request-error.js',
|
||||
'module/webpage/resource-received-error.js',
|
||||
'module/webpage/no-plugin.js',
|
||||
'module/system/system.js',
|
||||
'module/system/args.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() {
|
||||
var lastError = null;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user