1 <!-- ***** BEGIN LICENSE BLOCK *****
2 - Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 - The contents of this file are subject to the Mozilla Public License Version
5 - 1.1 (the "License"); you may not use this file except in compliance with
6 - the License. You may obtain a copy of the License at
7 - http://www.mozilla.org/MPL/
9 - Software distributed under the License is distributed on an "AS IS" basis,
10 - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 - for the specific language governing rights and limitations under the
14 - The Original Code is Mozilla Communicator Test Cases.
16 - The Initial Developer of the Original Code is Netscape Communications
17 - Corp. Portions created by Netscape Communications Corp. are
18 - Copyright (C) 1999 Netscape Communications Corp. All
22 - dsirnapalli@netscape.com
24 - Alternatively, the contents of this file may be used under the terms of
25 - either the GNU General Public License Version 2 or later (the "GPL"), or
26 - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 - in which case the provisions of the GPL or the LGPL are applicable instead
28 - of those above. If you wish to allow use of your version of this file only
29 - under the terms of either the GPL or the LGPL, and not to allow others to
30 - use your version of this file under the terms of the MPL, indicate your
31 - decision by deleting the provisions above and replace them with the notice
32 - and other provisions required by the LGPL or the GPL. If you do not delete
33 - the provisions above, a recipient may use your version of this file under
34 - the terms of any one of the MPL, the GPL or the LGPL.
36 - ***** END LICENSE BLOCK ***** -->
38 <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
40 <title> Component List </title>
41 <!-- Descrpt: Component List Test
42 Author: dsirnapalli@netscape.com
43 Revs: 10.12.01 - Created
47 <!-- script below is ngdriverspecific -->
48 <script TYPE="text/javascript" SRC="http://bubblegum/ngdriver/suites/testlib.js">
51 <script TYPE="text/javascript">
52 function getBrowserVersion()
55 res = res + '<b><h3><font color="#CC6600"> Browser Info </font></h3></b>' + '\n';
56 res = res + '<table BORDER COLS=2 WIDTH="70%">' + '\n';
57 res = res + ' <tr>' + '\n';
58 res = res + ' <td WIDTH="30%"><b> App Name: </b></td>' + '\n';
59 res = res + ' <td>' + navigator.appName + '</td>' + '\n';
60 res = res + ' </tr>' + '\n';
61 res = res + ' <tr>' + '\n';
62 res = res + ' <td><b> User Agent: </b></td>' + '\n';
63 res = res + ' <td>' + navigator.userAgent + '</td>' + '\n';
64 res = res + ' </tr>' + '\n';
65 res = res + ' <tr>' + '\n';
66 res = res + ' <td><b> Code Name:: </b></td>' + '\n';
67 res = res + ' <td>' + navigator.appCodeName + '</td>' + '\n';
68 res = res + ' </tr>' + '\n';
69 res = res + ' <tr>' + '\n';
70 res = res + ' <td><b> App Version: </b></td>' + '\n';
71 res = res + ' <td>' + navigator.appVersion + '</td>' + '\n';
72 res = res + ' </tr>' + '\n';
73 res = res + ' <tr>' + '\n';
74 res = res + ' <td><b> Language: </b></td>' + '\n';
75 res = res + ' <td>' + navigator.language + '</td>' + '\n';
76 res = res + ' </tr>' + '\n';
77 res = res + ' <tr>' + '\n';
78 res = res + ' <td><b> Platform: </b></td>' + '\n';
79 res = res + ' <td>' + navigator.platform + '</td>' + '\n';
80 res = res + ' </tr>' + '\n';
81 res = res + '</table>' + '\n';
86 <script TYPE="text/javascript">
87 function getShortPluginsList()
91 navigator.plugins.refresh(false);
92 var numPlugins = navigator.plugins.length;
94 res = res + '<b><h3><font color="#CC6600"> Plugins </font></h3></b>' + '\n';
95 res = res + 'For Complete description of Plugins ';
96 res = res + '<a href="plugins.html">Click here</a>';
97 res = res + '<br><br>';
98 res = res + '<table BORDER COLS=1 WIDTH="30%">' + '\n';
100 res = res + '<caption><b><h3> Installed plug-ins </h3></b></caption>' + '\n';
103 res = res + '<caption><b><h3> No plug-ins are installed. </h3></b></caption>' + '\n';
104 res = res + ' <tr>' + '\n';
105 res = res + ' <td> Empty </td>' + '\n';
106 res = res + ' </tr>' + '\n';
108 for (var i=0;i<numPlugins;i++)
110 var plugin = navigator.plugins[i];
111 res = res + ' <tr>' + '\n';
112 res = res + ' <td>' + plugin.name + '</td>' + '\n';
113 res = res + ' </tr>' + '\n';
115 res = res + '</table>' + '\n';
120 <script TYPE="text/javascript">
121 complist = new Array();
122 noncomplist = new Array();
126 function getComponentList()
128 var servicecontractidlist = new Array("@mozilla.org/cookieService;1",
129 "@mozilla.org/file/directory_service;1",
130 "@mozilla.org/browser/global-history;1",
131 "@mozilla.org/preferences-service;1",
132 "@mozilla.org/embedcomp/window-watcher;1",
133 "@mozilla.org/embedcomp/prompt-service;1");
135 var serviceinterfacelist = new Array("nsICookieService",
136 "nsIDirectoryService",
142 var contractidlist = new Array("@mozilla.org/network/standard-url;1",
143 "@mozilla.org/network/standard-url;1",
144 "@mozilla.org/browser/shistory;1",
145 "@mozilla.org/helperapplauncherdialog;1",
146 "@mozilla.org/file/local;1",
147 "@mozilla.org/xpcom/observer;1",
148 "@mozilla.org/preferences-service;1",
149 "@mozilla.org/gfx/fontlist;1");
151 var interfacelist = new Array("nsIURI",
154 "nsIHelperAppLauncherDialog",
159 for (var m=0; m<serviceinterfacelist.length; m++)
160 checkservice(servicecontractidlist[m], serviceinterfacelist[m]);
162 for (var n=0; n<interfacelist.length; n++)
163 checkinterface(contractidlist[n], interfacelist[n]);
166 function getAdditionalComponentList()
168 // additional interface objects which cannot be got directly.
170 netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
171 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
173 var domWindow = window.QueryInterface(Components.interfaces.nsIDOMWindow);
175 complist[i++] = "nsIDOMWindow";
178 noncomplist[j++] = "nsIDOMWindow";
182 netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
183 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
185 var charsetObj = domWindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
186 .getInterface(Components.interfaces.nsIDocCharset);
188 complist[i++] = "nsIDocCharset";
191 noncomplist[j++] = "nsIDocCharset";
195 function checkservice(contractid, interfacename)
198 netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
199 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
201 var iID = Components.interfaces[interfacename];
202 var obj = Components.classes[contractid].getService(iID);
204 complist[i++] = interfacename;
207 noncomplist[j++] = interfacename;
211 function checkinterface(contractid, interfacename)
214 netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
215 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
217 var iID = Components.interfaces[interfacename];
218 var obj = Components.classes[contractid].createInstance(iID);
220 complist[i++] = interfacename;
223 noncomplist[j++] = interfacename;
227 function getComponentResults()
231 res = res + '<b><h3><font color="#CC6600"> Embedding Components </font></h3></b>' + '\n';
232 res = res + '<table BORDER COLS=1 WIDTH="30%">' + '\n';
233 res = res + '<caption><b><h3> Components Available </h3></b></caption>' + '\n';
234 for (var i=0; i<complist.length; i++)
236 res = res + ' <tr>' + '\n';
237 res = res + ' <td>' + complist[i] + '</td>' + '\n';
238 res = res + ' </tr>' + '\n';
240 if(complist.length == 0)
242 res = res + ' <tr>' + '\n';
243 res = res + ' <td> Empty </td>' + '\n';
244 res = res + ' </tr>' + '\n';
246 res = res + '</table>' + '\n';
248 res = res + '<br>' + '\n';
249 res = res + '<table BORDER COLS=1 WIDTH="30%">' + '\n';
250 res = res + '<caption><b><h3> Components Not Available </h3></b></caption>' + '\n';
251 for (var j=0; j<noncomplist.length; j++)
253 res = res + ' <tr>' + '\n';
254 res = res + ' <td>' + noncomplist[j] + '</td>' + '\n';
255 res = res + ' </tr>' + '\n';
257 if(noncomplist.length == 0)
259 res = res + ' <tr>' + '\n';
260 res = res + ' <td> Empty </td>' + '\n';
261 res = res + ' </tr>' + '\n';
263 res = res + '</table>' + '\n';
268 <script TYPE="text/javascript">
269 function displayResults(results)
271 document.results.textarea.value = results;
272 if (top.name == "testWindow")
278 document.write(document.results.textarea.value);
286 <!-- form below is ngdriverspecific -->
287 <form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
288 <script TYPE="text/javascript">
289 document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
291 <input type="hidden" name="textarea">
294 <script TYPE="text/javascript">
297 result = result + "<font color='#CC6600'> NOTE: </font>" + "<br>";
298 result = result + "For the Test Case to run correctly include the following line into your prefs.js file." + "<br>";
299 result = result + 'user_pref("signed.applets.codebase_principal_support", true);' + "<br>";
300 result = result + 'prefs.js can be found at' + '<br>';
301 result = result + 'WINNT:C:\\WINNT\\Profiles\\profileyouareusing\\Application Data\\MfcEmbed\\Profiles\\default\\somefolder.slt\\prefs.js' + '<br>';
302 result = result + 'WIN98:C:\\WINDOWS\\Application Data\\MfcEmbed\\Profiles\\default\\somefolder.slt\\prefs.js' + '<br>';
303 result = result + '<br><hr ALIGN=LEFT SIZE=5 NOSHADE WIDTH="80%">' + '\n';
305 browserres = getBrowserVersion();
306 result = result + browserres;
307 result = result + '<br><hr ALIGN=LEFT SIZE=5 NOSHADE WIDTH="80%">' + '\n';
308 pluginres = getShortPluginsList();
309 result = result + pluginres;
310 result = result + '<br><hr ALIGN=LEFT SIZE=5 NOSHADE WIDTH="80%">' + '\n';
312 getAdditionalComponentList();
313 componentres = getComponentResults();
314 result = result + componentres;
315 result = result + '<br><hr ALIGN=LEFT SIZE=5 NOSHADE WIDTH="80%">' + '\n';
316 displayResults(result);