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

Unified Diff: chrome/test/data/extensions/native_client/test.html

Issue 7488060: Add tests for CWS restriction of Nacl plugin invocation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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/test/data/extensions/native_client/manifest.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/native_client/test.html
===================================================================
--- chrome/test/data/extensions/native_client/test.html (revision 0)
+++ chrome/test/data/extensions/native_client/test.html (revision 0)
@@ -0,0 +1,56 @@
+<html>
+<!--
+This test file causes Chrome to attempt to create the NaCl plugin as a simple
+embed and as a content type handler. The script allows the test to check if
+the plugin was created or blocked in either case.
+-->
+<head>
+<title>Native Client CWS Restriction</title>
+
+<script>
+ var embedded_event;
+ var content_handler_event;
+
+ function setListeners(body_element) {
+ var eventListener = function(e) {
+ var target_element = e.target;
+ if (target_element.className != 'naclModule')
+ return;
+
+ var element_id = target_element.id;
+ if (element_id == 'embedded')
+ embedded_event = e.type;
+ else if (element_id == 'content_handler')
+ content_handler_event = e.type;
+ }
+ body_element.addEventListener('loadstart', eventListener, true);
+ body_element.addEventListener('error', eventListener, true);
+ }
+
+ function EmbeddedPluginCreated() {
+ return embedded_event != undefined;
+ }
+
+ function ContentHandlerPluginCreated() {
+ return content_handler_event != undefined;
+ }
+
+</script>
+
+</head>
+<body>
+ <embed id="embedded"
+ class="naclModule"
+ type="application/x-nacl"
+ src="dummy.nmf">
+ </embed>
+ <embed id="content_handler"
+ class="naclModule"
+ type="application/pdf"
+ src="test.pdf">
+ </embed>
+ <script>
+ setListeners(document.body);
+ </script>
+</body>
+</html>
Property changes on: chrome\test\data\extensions\native_client\test.html
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/test/data/extensions/native_client/manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698