Bug 464947 - Clear Recent History dialog should clear form data by timespan. r=mconnor
[wine-gecko.git] / embedding / qa / jstests / ComponentListTest.txt
blob0217a08e685be5ebf3bc72d78f4c62be2f395533
1 <!-- ***** BEGIN LICENSE BLOCK *****
2    - Version: MPL 1.1/GPL 2.0/LGPL 2.1
3    -
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/
8    -
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
12    - License.
13    -
14    - The Original Code is Mozilla Communicator Test Cases.
15    -
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
19    - Rights Reserved.
20    -
21    - Contributor(s):
22    -   dsirnapalli@netscape.com
23    -
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.
35    -
36    - ***** END LICENSE BLOCK ***** -->
38 <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
39 <html>
40 <title> Component List </title>
41 <!-- Descrpt: Component List Test
42      Author: dsirnapalli@netscape.com
43      Revs: 10.12.01 - Created
44   -->
45 <head>
47 <!-- script below is ngdriverspecific  -->
48 <script TYPE="text/javascript" SRC="http://bubblegum/ngdriver/suites/testlib.js">
49 </script>
51 <script TYPE="text/javascript">
52 function getBrowserVersion()
54   var res = "";
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';
82   return res;
84 </script>
86 <script TYPE="text/javascript">
87 function getShortPluginsList()
89   var res="";
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';
99   if(numPlugins > 0)
100     res = res + '<caption><b><h3> Installed plug-ins </h3></b></caption>' + '\n';
101   else
102   {
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';
107   }
108   for (var i=0;i<numPlugins;i++)
109   {
110     var plugin = navigator.plugins[i];
111     res = res + ' <tr>' + '\n';
112     res = res + '  <td>' + plugin.name + '</td>' + '\n';
113     res = res + ' </tr>' + '\n';
114   }
115   res = res + '</table>' + '\n';
116   return res;
118 </script>
120 <script TYPE="text/javascript">
121 complist = new Array();
122 noncomplist = new Array();
123 i = 0;
124 j = 0;
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",
137                                        "nsIGlobalHistory",
138                                        "nsIPrefService",
139                                        "nsIWindowWatcher",
140                                        "nsIPromptService");
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",
152                                 "nsIURL",
153                                 "nsISHistory",
154                                 "nsIHelperAppLauncherDialog",
155                                 "nsILocalFile",
156                                 "nsIObserver",
157                                 "nsIPrefBranch");
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.
169   try{
170     netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
171     netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
173     var domWindow = window.QueryInterface(Components.interfaces.nsIDOMWindow);
174     if (domWindow)
175      complist[i++] = "nsIDOMWindow";
176   }
177   catch(e){
178     noncomplist[j++] = "nsIDOMWindow";
179   }
180   try
181   {
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);
187     if (charsetObj)
188       complist[i++] = "nsIDocCharset";
189   }
190   catch(e){
191     noncomplist[j++] = "nsIDocCharset";
192   }
195 function checkservice(contractid, interfacename)
197   try{
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);
203     if (obj)
204       complist[i++] = interfacename;
205   }
206   catch(e){
207     noncomplist[j++] = interfacename;
208   }
211 function checkinterface(contractid, interfacename)
213   try{
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);
219     if (obj)
220       complist[i++] = interfacename;
221   }
222   catch(e){
223     noncomplist[j++] = interfacename;
224   }
227 function getComponentResults()
229   var res = "";
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++)
235   {
236     res = res + ' <tr>' + '\n';
237     res = res + '  <td>' + complist[i] + '</td>' + '\n';
238     res = res + ' </tr>' + '\n';
239   }
240   if(complist.length == 0)
241   {
242     res = res + ' <tr>' + '\n';
243     res = res + '  <td> Empty </td>' + '\n';
244     res = res + ' </tr>' + '\n';
245   }
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++)
252   {
253     res = res + ' <tr>' + '\n';
254     res = res + '  <td>' + noncomplist[j] + '</td>' + '\n';
255     res = res + ' </tr>' + '\n';
256   }
257   if(noncomplist.length == 0)
258   {
259     res = res + ' <tr>' + '\n';
260     res = res + '  <td> Empty </td>' + '\n';
261     res = res + ' </tr>' + '\n';
262   }
263   res = res + '</table>' + '\n';
264   return res;
266 </script>
268 <script TYPE="text/javascript">
269 function displayResults(results)
271   document.results.textarea.value = results;
272   if (top.name == "testWindow")
273   {
274         fixSubmit();
275   }
276   else
277   {
278         document.write(document.results.textarea.value);
279   }
281 </script>
283 </head>
284 <body>
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 + '">');
290 </script>
291 <input type="hidden" name="textarea">
292 </form>
294 <script TYPE="text/javascript">
295 var result = "";
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';
311 getComponentList();
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);
317 </script>
319 </body>
320 </html>