summaryrefslogtreecommitdiffstats
path: root/chrome/test/data
diff options
context:
space:
mode:
authorgregoryd@google.com <gregoryd@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-11 20:48:28 +0000
committergregoryd@google.com <gregoryd@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-11 20:48:28 +0000
commit2d78334cabcfac4c528bb7f737fcafa4067ed2e8 (patch)
tree81b7348662bcaed85f4c987d0abe64e0c86ccfc2 /chrome/test/data
parent9c74bc42641f8b9f1474234c0afa5c1fd03ab69c (diff)
downloadchromium_src-2d78334cabcfac4c528bb7f737fcafa4067ed2e8.zip
chromium_src-2d78334cabcfac4c528bb7f737fcafa4067ed2e8.tar.gz
chromium_src-2d78334cabcfac4c528bb7f737fcafa4067ed2e8.tar.bz2
Add a test for "native_client" permission for extensions.
BUG=45881 TEST=this CL Review URL: http://codereview.chromium.org/3064048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55775 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/data')
-rw-r--r--chrome/test/data/extensions/api_test/permissions/nacl_enabled/background.html42
-rw-r--r--chrome/test/data/extensions/api_test/permissions/nacl_enabled/manifest.json7
2 files changed, 49 insertions, 0 deletions
diff --git a/chrome/test/data/extensions/api_test/permissions/nacl_enabled/background.html b/chrome/test/data/extensions/api_test/permissions/nacl_enabled/background.html
new file mode 100644
index 0000000..a813fe8
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/permissions/nacl_enabled/background.html
@@ -0,0 +1,42 @@
+<script>
+// OnNaClLoad should be called and invoking a method
+// in a NaCl module should return a correct value.
+
+var pass = chrome.test.callbackPass;
+
+chrome.test.runTests([
+ function nacl() {
+ // Nothing to do here,
+ // we call the callback when we get the notification from NaCl
+ }
+]);
+
+function OnNaClLoad() {
+ try {
+ plugin = document.getElementById('pluginobj');
+ result = plugin.helloworld();
+ if ('hello, world.' != result) {
+ chrome.test.fail();
+ }
+ } catch(e) {
+ chrome.test.fail();
+ }
+ chrome.test.succeed();
+}
+
+function OnNaClFail() {
+ chrome.test.fail();
+}
+</script>
+
+<h1>Native Client SRPC Simple Plug-in</h1>
+<p>
+ <embed name="nacl_module"
+ id="pluginobj"
+ width=0 height=0
+ src="bin/x86/srpc_hw.nexe"
+ type="application/x-nacl-srpc"
+ onload="OnNaClLoad()"
+ onfail="OnNaClFail()"
+ />
+</p>
diff --git a/chrome/test/data/extensions/api_test/permissions/nacl_enabled/manifest.json b/chrome/test/data/extensions/api_test/permissions/nacl_enabled/manifest.json
new file mode 100644
index 0000000..c37d815
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/permissions/nacl_enabled/manifest.json
@@ -0,0 +1,7 @@
+{
+ "name": "nacl permission enabled apitest",
+ "description": "nacl permission enabled extension",
+ "version": "0.1",
+ "background_page": "background.html",
+ "permissions": [ "native_client" ]
+}