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

Side by Side Diff: LayoutTests/plugins/npruntime/enumerate.html

Issue 1319473007: Delete a bunch of NPAPI layout tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <script>
3 function runTest()
4 {
5 if (window.testRunner)
6 testRunner.dumpAsText();
7
8 var plugin = document.getElementById("testPlugin");
9 var result = document.getElementById('result');
10
11 // First test NPN_Enumerate from the plugin's side
12 var testObject = { "one" : 1, "two" : 2, "three" : 3, 4 : 4 }
13 var outArray = [];
14 plugin.testEnumerate(testObject, outArray);
15
16 if (outArray.sort().toString() != '4,one,three,two') {
17 result.innerHTML = 'FAILURE: Array returned from plugin was ' + outArray .toString();
18 return;
19 }
20
21 // Now try enumerating a plugin object's properties
22 var propNames = [];
23 for (var v in plugin.testObject) {
24 propNames.push(v);
25 }
26
27 if (propNames.sort().toString() != 'bar,foo') {
28 result.innerHTML = 'FAILURE: Plugin object properties was ' + propNames. toString();
29 return;
30 }
31
32 // Now try enumerating a plugin object's properties using Object.keys
33 var keys = Object.keys(plugin.testObject);
34 if (keys.sort().toString() != 'bar,foo') {
35 result.innerHTML = 'FAILURE: Plugin object properties returned by Object .keys were ' + keys.toString();
36 return;
37 }
38
39 result.innerHTML = 'SUCCESS';
40 }
41 </script>
42
43 <body onload="runTest();">
44 <embed id="testPlugin" type="application/x-webkit-test-netscape" width="200" hei ght="200"></embed>
45 This tests that a plugin can enumerate an object's properties using NPN_Enumerat e. It also tests that JavaScript can enumerate a plugin object's properties. If this test is successful the text "SUCCESS" will be show below.
46 <div id="result">FAILURE</div>
47 </body>
48 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698