summaryrefslogtreecommitdiffstats
path: root/chrome/test/data/npapi
diff options
context:
space:
mode:
authorinitial.commit <initial.commit@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-26 23:55:29 +0000
committerinitial.commit <initial.commit@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-26 23:55:29 +0000
commit09911bf300f1a419907a9412154760efd0b7abc3 (patch)
treef131325fb4e2ad12c6d3504ab75b16dd92facfed /chrome/test/data/npapi
parent586acc5fe142f498261f52c66862fa417c3d52d2 (diff)
downloadchromium_src-09911bf300f1a419907a9412154760efd0b7abc3.zip
chromium_src-09911bf300f1a419907a9412154760efd0b7abc3.tar.gz
chromium_src-09911bf300f1a419907a9412154760efd0b7abc3.tar.bz2
Add chrome to the repository.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/data/npapi')
-rw-r--r--chrome/test/data/npapi/arguments.html40
-rw-r--r--chrome/test/data/npapi/execute_script_delete_in_npn_evaluate.html39
-rw-r--r--chrome/test/data/npapi/execute_script_delete_in_paint.html39
-rw-r--r--chrome/test/data/npapi/get_javascript_url.html26
-rw-r--r--chrome/test/data/npapi/geturl.html26
-rw-r--r--chrome/test/data/npapi/layout_test_plugin.html17
-rw-r--r--chrome/test/data/npapi/many_plugins.html94
-rw-r--r--chrome/test/data/npapi/new_fails.html30
-rw-r--r--chrome/test/data/npapi/npapi.js28
-rw-r--r--chrome/test/data/npapi/npobject_lifetime_test.html58
-rw-r--r--chrome/test/data/npapi/npobject_lifetime_test_second_instance.html20
-rw-r--r--chrome/test/data/npapi/npobject_proxy.html28
-rw-r--r--chrome/test/data/npapi/self_delete_plugin_geturl.html37
-rw-r--r--chrome/test/data/npapi/self_delete_plugin_invoke.html33
-rw-r--r--chrome/test/data/npapi/self_delete_plugin_stream.html34
-rw-r--r--chrome/test/data/npapi/verify_plugin_window_rect.html30
16 files changed, 579 insertions, 0 deletions
diff --git a/chrome/test/data/npapi/arguments.html b/chrome/test/data/npapi/arguments.html
new file mode 100644
index 0000000..835473c
--- /dev/null
+++ b/chrome/test/data/npapi/arguments.html
@@ -0,0 +1,40 @@
+<html>
+
+<head>
+<script src="npapi.js"></script>
+</head>
+
+
+<body>
+<div id="statusPanel" style="border: 1px solid red; width: 100%">
+Test running....
+</div>
+
+
+NPAPI Loading and Argument Tests<p>
+Tests our ability to pass arguments to the plugin via the embed
+tag.<P>
+
+<embed type="application/vnd.npapi-test"
+ src="foo"
+ name="arguments"
+ id="1"
+ mode="np_embed"
+ count="12"
+ size="10"
+ val1="0123456789"
+ val2="01234567890123456789"
+ val3="012345678901234567890123456789"
+ val4="0123456789012345678901234567890123456789"
+ val5="01234567890123456789012345678901234567890123456789"
+ val6="012345678901234567890123456789012345678901234567890123456789"
+ val7="0123456789012345678901234567890123456789012345678901234567890123456789"
+ val8="01234567890123456789012345678901234567890123456789012345678901234567890123456789"
+ val9="012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
+ val10="0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
+ val11="01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
+ val12="012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
+>
+
+</body>
+</html>
diff --git a/chrome/test/data/npapi/execute_script_delete_in_npn_evaluate.html b/chrome/test/data/npapi/execute_script_delete_in_npn_evaluate.html
new file mode 100644
index 0000000..f2e2bbe
--- /dev/null
+++ b/chrome/test/data/npapi/execute_script_delete_in_npn_evaluate.html
@@ -0,0 +1,39 @@
+<html>
+
+<head>
+<script src="npapi.js"></script>
+
+<script>
+function DeletePluginWithinScript() {
+ var plugin_div = document.getElementById("PluginDiv");
+ plugin_div.innerHTML = "Object Deleted";
+ onSuccess("npobject_delete_plugin_in_evaluate", 1);
+}
+</script>
+</head>
+
+<body>
+<div id="statusPanel" style="border: 1px solid red; width: 100%">
+Test running....
+</div>
+
+
+NPObject Proxy Test<p>
+
+Tests the case where a plugin instance is deleted in the context
+of NPN_Evaluate
+
+<DIV ID=PluginDiv>
+<embed type="application/vnd.npapi-test"
+ src="foo"
+ name="npobject_delete_plugin_in_evaluate"
+ id="1"
+ mode="np_embed"
+>
+</DIV>
+<script>
+ var height = document.body.offsetHeight;
+</script>
+
+</body>
+</html>
diff --git a/chrome/test/data/npapi/execute_script_delete_in_paint.html b/chrome/test/data/npapi/execute_script_delete_in_paint.html
new file mode 100644
index 0000000..fa9ff21
--- /dev/null
+++ b/chrome/test/data/npapi/execute_script_delete_in_paint.html
@@ -0,0 +1,39 @@
+<html>
+
+<head>
+<script src="npapi.js"></script>
+
+<script>
+function DeletePluginWithinScript() {
+ var plugin_div = document.getElementById("PluginDiv");
+ plugin_div.innerHTML = "Object Deleted";
+ onSuccess("execute_script_delete_in_paint", 1);
+}
+</script>
+</head>
+
+<body>
+<div id="statusPanel" style="border: 1px solid red; width: 100%">
+Test running....
+</div>
+
+
+NPObject Proxy Test<p>
+
+Tests the case where a plugin instance is deleted in the context
+of a synchronous paint.
+
+<DIV ID=PluginDiv>
+<embed type="application/vnd.npapi-test"
+ src="foo"
+ name="execute_script_delete_in_paint"
+ id="1"
+ mode="np_embed"
+>
+</DIV>
+<script>
+ var height = document.body.offsetHeight;
+</script>
+
+</body>
+</html>
diff --git a/chrome/test/data/npapi/get_javascript_url.html b/chrome/test/data/npapi/get_javascript_url.html
new file mode 100644
index 0000000..404613b
--- /dev/null
+++ b/chrome/test/data/npapi/get_javascript_url.html
@@ -0,0 +1,26 @@
+<html>
+
+<head>
+<script src="npapi.js"></script>
+</head>
+
+
+<body>
+<div id="statusPanel" style="border: 1px solid red; width: 100%">
+Test running....
+</div>
+
+
+GetJavscriptURL Test<p>
+This test fetches a javascript URL via the plugin with _top as the
+target frame, and verifies that the call succeeds.
+
+<embed type="application/vnd.npapi-test"
+ src="foo"
+ name="getjavascripturl"
+ id="1"
+ mode="np_embed"
+>
+
+</body>
+</html>
diff --git a/chrome/test/data/npapi/geturl.html b/chrome/test/data/npapi/geturl.html
new file mode 100644
index 0000000..002b63b
--- /dev/null
+++ b/chrome/test/data/npapi/geturl.html
@@ -0,0 +1,26 @@
+<html>
+
+<head>
+<script src="npapi.js"></script>
+</head>
+
+
+<body>
+<div id="statusPanel" style="border: 1px solid red; width: 100%">
+Test running....
+</div>
+
+
+GetURL Test<p>
+This test fetches an URL via the plugin, and verifies that the
+callbacks are expected and that the retrieved content is correct.
+
+<embed type="application/vnd.npapi-test"
+ src="foo"
+ name="geturl"
+ id="1"
+ mode="np_embed"
+>
+
+</body>
+</html>
diff --git a/chrome/test/data/npapi/layout_test_plugin.html b/chrome/test/data/npapi/layout_test_plugin.html
new file mode 100644
index 0000000..d523d3c
--- /dev/null
+++ b/chrome/test/data/npapi/layout_test_plugin.html
@@ -0,0 +1,17 @@
+<html>
+<head>
+<title>Layout Test Plugin Test</title>
+</head>
+<body>
+<embed name="plg" type="application/x-webkit-test-netscape"></embed>
+<script>
+// Test for bug 711411: http://b/issue?id=711411
+// There was a crash because of the plugin dll being unloaded before the JS
+// interpreter got a chance to drop references.
+window.plg.eventLoggingEnabled = true;
+</script>
+
+<!-- Make sure unknown plugin types don't crash either -->
+<embed name="no-plg" type="application/not-installed"></embed>
+</body>
+</html>
diff --git a/chrome/test/data/npapi/many_plugins.html b/chrome/test/data/npapi/many_plugins.html
new file mode 100644
index 0000000..5edcc55
--- /dev/null
+++ b/chrome/test/data/npapi/many_plugins.html
@@ -0,0 +1,94 @@
+<html>
+
+<head>
+<script src="npapi.js"></script>
+</head>
+
+
+<body>
+<div id="statusPanel" style="border: 1px solid red; width: 100%">
+Test running....
+</div>
+
+
+Loading many plugins<p>
+Tests our ability to load multiple plugins in a single page.<P>
+
+<embed type="application/vnd.npapi-test"
+ name="arguments"
+ mode="np_embed"
+ id="1"
+>
+<embed type="application/vnd.npapi-test"
+ name="arguments"
+ mode="np_embed"
+ id="2"
+>
+<embed type="application/vnd.npapi-test"
+ name="arguments"
+ mode="np_embed"
+ id="3"
+>
+<embed type="application/vnd.npapi-test"
+ name="arguments"
+ mode="np_embed"
+ id="4"
+>
+<embed type="application/vnd.npapi-test"
+ name="arguments"
+ mode="np_embed"
+ id="5"
+>
+<embed type="application/vnd.npapi-test"
+ name="arguments"
+ mode="np_embed"
+ id="6"
+>
+<embed type="application/vnd.npapi-test"
+ name="arguments"
+ mode="np_embed"
+ id="7"
+>
+<embed type="application/vnd.npapi-test"
+ name="arguments"
+ mode="np_embed"
+ id="8"
+>
+<embed type="application/vnd.npapi-test"
+ name="arguments"
+ mode="np_embed"
+ id="9"
+>
+<embed type="application/vnd.npapi-test"
+ name="arguments"
+ mode="np_embed"
+ id="10"
+>
+<embed type="application/vnd.npapi-test"
+ name="arguments"
+ mode="np_embed"
+ id="11"
+>
+<embed type="application/vnd.npapi-test"
+ name="arguments"
+ mode="np_embed"
+ id="12"
+>
+<embed type="application/vnd.npapi-test"
+ name="arguments"
+ mode="np_embed"
+ id="13"
+>
+<embed type="application/vnd.npapi-test"
+ name="arguments"
+ mode="np_embed"
+ id="14"
+>
+<embed type="application/vnd.npapi-test"
+ name="arguments"
+ mode="np_embed"
+ id="15"
+>
+
+</body>
+</html>
diff --git a/chrome/test/data/npapi/new_fails.html b/chrome/test/data/npapi/new_fails.html
new file mode 100644
index 0000000..a4b7de9
--- /dev/null
+++ b/chrome/test/data/npapi/new_fails.html
@@ -0,0 +1,30 @@
+<html>
+
+<head>
+<script src="npapi.js"></script>
+</head>
+
+
+<body>
+<div id="statusPanel" style="border: 1px solid red; width: 100%">
+Test running....
+</div>
+
+
+NPP_NEW test<p>
+This test ensures we don't crash or assert if NPP_New fails.
+
+<embed type="application/vnd.npapi-test"
+ src="foo"
+ name="new_fails"
+ id="1"
+ mode="np_embed"
+>
+
+<script>
+ var height = document.body.offsetHeight;
+ onSuccess("new_fails", 1);
+</script>
+
+</body>
+</html>
diff --git a/chrome/test/data/npapi/npapi.js b/chrome/test/data/npapi/npapi.js
new file mode 100644
index 0000000..207d188
--- /dev/null
+++ b/chrome/test/data/npapi/npapi.js
@@ -0,0 +1,28 @@
+//
+// This script provides some mechanics for testing NPAPI
+//
+
+/* public */ function onSuccess(name, id)
+{
+ setTimeout(onFinished, 0, name, id, "OK");
+}
+
+/* public */ function onFailure(name, id, status)
+{
+ setTimeout(onFinished, 0, name, id, status);
+}
+
+
+
+// Finish running a test by setting the status
+// and the cookie.
+/* private */ function onFinished(name, id, result)
+{
+ var statusPanel = document.getElementById("statusPanel");
+ if (statusPanel) {
+ statusPanel.innerHTML = result;
+ }
+
+ var cookie = name + "." + id + ".status=" + result + "; path=/";
+ document.cookie = cookie;
+}
diff --git a/chrome/test/data/npapi/npobject_lifetime_test.html b/chrome/test/data/npapi/npobject_lifetime_test.html
new file mode 100644
index 0000000..634fad8
--- /dev/null
+++ b/chrome/test/data/npapi/npobject_lifetime_test.html
@@ -0,0 +1,58 @@
+<html>
+
+<head>
+<script src="npapi.js"></script>
+</head>
+
+
+<body>
+<div id="statusPanel" style="border: 1px solid red; width: 100%">
+Test running....
+</div>
+
+
+NPObject Lifetime test<p>
+
+Tests the case where a plugin holds on to an NPObject reference
+to another plugin in a different frame in the page and whether
+the npobject is callable when the frame is destroyed.
+
+<div ID=npobject_lifetime_test_instance2>
+<iframe src="npobject_lifetime_test_second_instance.html" name="plugin_frame">
+</iframe>
+</div>
+
+<embed type="application/vnd.npapi-test"
+ src="foo"
+ name="npobject_lifetime_test"
+ id="1"
+ mode="np_embed">
+
+<script>
+
+function GetSecondPluginInstance() {
+ var plugin_frame = window.frames["plugin_frame"];
+ if (!plugin_frame) {
+ alert("failed to find frame in frames list");
+ return;
+ }
+
+ var plugin = plugin_frame.document.getElementById(2);
+ if (!plugin) {
+ alert("Failed to locate second plugin");
+ return;
+ }
+ return plugin;
+}
+
+function DeleteSecondPluginInstance() {
+ var frame_div = document.getElementById("npobject_lifetime_test_instance2");
+ if (frame_div.parentNode && frame_div.parentNode.removeChild) {
+ frame_div.parentNode.removeChild(frame_div);
+ }
+}
+</script>
+
+</body>
+</html>
+
diff --git a/chrome/test/data/npapi/npobject_lifetime_test_second_instance.html b/chrome/test/data/npapi/npobject_lifetime_test_second_instance.html
new file mode 100644
index 0000000..5876f8e
--- /dev/null
+++ b/chrome/test/data/npapi/npobject_lifetime_test_second_instance.html
@@ -0,0 +1,20 @@
+<html>
+
+<body>
+<div id="statusPanel" style="border: 1px solid red; width: 100%">
+Second instance.
+</div>
+
+NPObject Lifetime test second plugin instance<p>
+
+Tests the case where a plugin holds on to an NPObject reference
+to another plugin in a different frame in the page and whether
+the npobject is callable when the frame is destroyed.
+
+<embed type="application/vnd.npapi-test"
+ name="npobject_lifetime_test_second_instance"
+ id="2"
+ mode="np_embed"> </embed>
+
+</body>
+</html>
diff --git a/chrome/test/data/npapi/npobject_proxy.html b/chrome/test/data/npapi/npobject_proxy.html
new file mode 100644
index 0000000..ef85ee7
--- /dev/null
+++ b/chrome/test/data/npapi/npobject_proxy.html
@@ -0,0 +1,28 @@
+<html>
+
+<head>
+<script src="npapi.js"></script>
+</head>
+
+
+<body>
+<div id="statusPanel" style="border: 1px solid red; width: 100%">
+Test running....
+</div>
+
+
+NPObject Proxy Test<p>
+
+Tests that if an NPObject is proxies back to its original process, the
+original pointer is returned and not a proxy. If this fails the plugin
+will crash.
+
+<embed type="application/vnd.npapi-test"
+ src="foo"
+ name="npobject_proxy"
+ id="1"
+ mode="np_embed"
+>
+
+</body>
+</html>
diff --git a/chrome/test/data/npapi/self_delete_plugin_geturl.html b/chrome/test/data/npapi/self_delete_plugin_geturl.html
new file mode 100644
index 0000000..2d14340
--- /dev/null
+++ b/chrome/test/data/npapi/self_delete_plugin_geturl.html
@@ -0,0 +1,37 @@
+<html>
+<head>
+<title>Self Deleting Plugin Test - GetURL</title>
+<script src="npapi.js"></script>
+<script>
+function DeletePluginWithinScript() {
+ var plugin_div = document.getElementById("PluginDiv");
+ plugin_div.innerHTML = "Object Deleted";
+}
+
+function CallGetUrl() {
+ var plg = window.document["plg"];
+ plg.getURL("javascript:DeletePluginWithinScript()");
+}
+</script>
+</head>
+
+<body>
+
+<h2>Test to delete a plugin during script execution</h2>
+
+<p>
+This test is for a corner case when a plugin executes a script
+that deletes the invoking plugin itself.
+</p>
+
+<DIV ID=PluginDiv>
+<embed name="plg" type="application/x-webkit-test-netscape"></embed>
+</DIV>
+<script>
+ CallGetUrl();
+ onSuccess("self_delete_plugin_geturl", 1);
+</script>
+
+</body>
+</html>
+
diff --git a/chrome/test/data/npapi/self_delete_plugin_invoke.html b/chrome/test/data/npapi/self_delete_plugin_invoke.html
new file mode 100644
index 0000000..73b940f
--- /dev/null
+++ b/chrome/test/data/npapi/self_delete_plugin_invoke.html
@@ -0,0 +1,33 @@
+<html>
+<head>
+<title>Self Deleting Plugin Test - Invoke</title>
+<script src="npapi.js"></script>
+<script>
+function DeletePluginWithinScript() {
+ var plugin_div = document.getElementById("PluginDiv");
+ plugin_div.innerHTML = "Object Deleted";
+}
+</script>
+</head>
+
+<body>
+
+<h2>Test to delete a plugin during script execution</h2>
+
+<p>
+This test is for a corner case when a plugin executes a script
+that deletes the invoking plugin itself.
+</p>
+
+<DIV ID=PluginDiv>
+<embed name="plg" type="application/x-webkit-test-netscape"></embed>
+</DIV>
+<script>
+ var plg = window.document["plg"];
+ plg.testCallback("DeletePluginWithinScript");
+ onSuccess("self_delete_plugin_invoke", 1);
+</script>
+
+</body>
+</html>
+
diff --git a/chrome/test/data/npapi/self_delete_plugin_stream.html b/chrome/test/data/npapi/self_delete_plugin_stream.html
new file mode 100644
index 0000000..a43c38a
--- /dev/null
+++ b/chrome/test/data/npapi/self_delete_plugin_stream.html
@@ -0,0 +1,34 @@
+<html>
+
+<head>
+<script src="npapi.js"></script>
+
+<script>
+function DeletePluginWithinScript() {
+ var plugin_div = document.getElementById("PluginDiv");
+ plugin_div.innerHTML = "Object Deleted";
+ onSuccess("self_delete_plugin_stream", 1);
+}
+</script>
+</head>
+
+<body>
+<div id="statusPanel" style="border: 1px solid red; width: 100%">
+Test running....
+</div>
+
+
+<DIV ID=PluginDiv>
+<embed type="application/vnd.npapi-test"
+ src="foo"
+ name="self_delete_plugin_stream"
+ id="1"
+ mode="np_embed"
+>
+</DIV>
+<script>
+ var height = document.body.offsetHeight;
+</script>
+
+</body>
+</html>
diff --git a/chrome/test/data/npapi/verify_plugin_window_rect.html b/chrome/test/data/npapi/verify_plugin_window_rect.html
new file mode 100644
index 0000000..7dca47a
--- /dev/null
+++ b/chrome/test/data/npapi/verify_plugin_window_rect.html
@@ -0,0 +1,30 @@
+<html>
+
+<head>
+<script src="npapi.js"></script>
+</head>
+
+<body>
+<div id="statusPanel" style="border: 1px solid red; width: 100%">
+Test running....
+</div>
+
+
+Plugin Window Rect Test<p>
+
+Tests whether the plugin window has a non zero client rect.
+
+<DIV ID=PluginDiv>
+<embed type="application/vnd.npapi-test"
+ src="foo"
+ name="checkwindowrect"
+ id="1"
+ mode="np_embed"
+>
+</DIV>
+<script>
+ var height = document.body.offsetHeight;
+</script>
+
+</body>
+</html>