Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Unified Diff: chrome/test/data/load_npapi_plugin.html

Issue 645203002: Block NPAPI plugins by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make npapi plugin load tests more robust. remove ifdefs Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/prerender/prerender_browsertest.cc ('k') | content/browser/plugin_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/load_npapi_plugin.html
diff --git a/chrome/test/data/load_npapi_plugin.html b/chrome/test/data/load_npapi_plugin.html
new file mode 100644
index 0000000000000000000000000000000000000000..fa29bf4e5ce9a5a2db2879d1de4548b144cc7ecc
--- /dev/null
+++ b/chrome/test/data/load_npapi_plugin.html
@@ -0,0 +1,31 @@
+<html>
+<head>
+<title>Initial Title</title>
+<script>
+function PluginCreated() {
+ document.title = "Loaded";
+}
+
+function injectPlugin() {
+ var child = document.createElement('div');
+ child.innerHTML = '<embed type="application/vnd.npapi-test" src="foo"' +
Will Harris 2014/10/17 18:57:08 nit: tab here.
+ ' name="invoke_js_function_on_create" id="plugin"' +
+ ' mode="np_embed"></embed>';
+ document.getElementById('content').appendChild(child);
+ // Plugins are loaded synchronously during layout, so the plugin has either
+ // been loaded or blocked at this point.
+ var plugin = document.getElementById('plugin');
+ // Check for the "loadedProperty" to determine if plugin is loaded.
+ if (plugin.loadedProperty == true) {
+ document.title = "Loaded";
+ } else {
+ document.title = "Not Loaded";
+ }
+}
+</script>
+</head>
+<body onload='injectPlugin();'>
+<div id='content'></div>
+</embed>
+</body>
+</html>
« no previous file with comments | « chrome/browser/prerender/prerender_browsertest.cc ('k') | content/browser/plugin_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698