Made some changes to put the test case on ngdriver.

This commit is contained in:
dsirnapalli%netscape.com 2001-08-17 23:41:14 +00:00
parent ac70d37874
commit 4634de9211
2 changed files with 163 additions and 75 deletions

View File

@ -36,17 +36,7 @@ var mozload = "Fail";
var seamonkeyload = "Fail";
var pageload = "Fail";
function mozillaimageLoaded()
{
mozload = "Pass";
}
function seamonkeyimageLoaded()
{
seamonkeyload = "Pass";
}
function displayResults()
function constructResults()
{
var results = "";
var mozloadcolor = "white";
@ -81,17 +71,76 @@ function displayResults()
results = results + " </table>";
results = results + "</html>";
displayResults(results);
}
function displayResults(results)
{
document.results.textarea.value = results;
fixSubmit();
if (top.name == "testWindow")
{
fixSubmit();
}
else
{
document.write(document.results.textarea.value);
}
}
function mozillaimageLoaded()
{
mozload = "Pass";
}
function seamonkeyimageLoaded()
{
seamonkeyload = "Pass";
}
function pageLoaded()
{
pageload = "Pass";
setTimeout("displayResults();", 1000);
if (usingGecko == "False")
{
displayResults("<b> You cannot execute this test case. The Browser you are using doesnot use Gecko Engine. Try with other browser.<b>");
}
else
{
pageload = "Pass";
setTimeout("constructResults();", 1000);
}
}
</script>
<script TYPE="text/javascript">
function testPage()
{
document.write('<center><b> This is a Test Page </b></center>');
document.write('<center><img src="mozilla-banner.gif" height=58 width=600 onLoad = "mozillaimageLoaded();"></center>');
document.write('<br> <br>');
document.write('<table bgcolor="blue" border="4">');
document.write('<tbody>');
document.write('<caption> <center> <b> Test Table </b> </center> </caption>');
document.write('<tr>');
document.write(' <td> <b> Cell1 </b> </td>');
document.write(' <td> <b> Cell2 </b> </td>');
document.write('</tr>');
document.write('<tr>');
document.write(' <td> <b> Cell3 </b> </td>');
document.write(' <td> <b> Cell4 </b> </td>');
document.write('</tr>');
document.write('</tbody>');
document.write('</table>');
document.write('<center>');
document.write('<img SRC="9709TUANP.jpg" height=183 width=300 onLoad = "seamonkeyimageLoaded();">');
document.write('</center>');
}
</script>
</head>
<body onLoad = "pageLoaded();">
@ -104,30 +153,15 @@ document.write('<input name="resultsfile" type="hidden" value="' + window.opener
<input type="hidden" name="textarea">
</form>
<center><b> This is a Test Page </b></center>
<center>
<img src="mozilla-banner.gif" height=58 width=600 onLoad = "mozillaimageLoaded();">
</center>
<br> <br>
<table bgcolor='blue' border='4'>
<tbody>
<caption> <center> <b> Test Table </b> </center> </caption>
<tr>
<td> <b> Cell1 </b> </td>
<td> <b> Cell2 </b> </td>
</tr>
<tr>
<td> <b> Cell3 </b> </td>
<td> <b> Cell4 </b> </td>
</tr>
</tbody>
</table>
<center>
<img SRC="9709TUANP.jpg" height=183 width=300 onLoad = "seamonkeyimageLoaded();">
</center>
<script TYPE="text/javascript">
var userAgent = navigator.userAgent;
var usingGecko = "False";
if (userAgent.search("Gecko") != -1)
{
usingGecko = "True";
testPage();
}
</script>
</body>
</html>

View File

@ -1,22 +1,60 @@
<HTML>
<!--
Written by Dharma.
Test last run on 07/02/01.
-->
<TITLE> nsIFontList </TITLE>
<HEAD>
<SCRIPT TYPE="text/javascript">
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title> nsIFontList Interface Test </title>
<!-- Descrpt: nsIFontList Interface Test
Author: dsirnapalli@netscape.com
Revs: 07.26.01 - Created
var langgroup = new Array("x-western", "ar", "el", "he", "ja", "ko", "th",
"tr", "x-baltic", "x-central-euro", "x-cyrillic",
"zh-CN", "zh-TW");
var fonttype = new Array("serif" , "sans-serif", "cursive", "fantasy", "monospace");
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator Test Cases.
-
- The Initial Developer of the Original Code is Netscape Communications
- Corp. Portions created by Netscape Communications Corp. are
- Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
-->
<!-- script below is ngdriverspecific -->
<script TYPE="text/javascript" SRC="http://bubblegum/ngdriver/suites/testlib.js">
</script>
<script type="text/javascript">
function getBrowserVersion()
{
results = "";
results = results + "<html>";
results = results + "<b><h2>Browser Info </h2></b>" + "\n";
results = results + "<li><b>App Name:<TAB> </b>" + navigator.appName + "\n";
results = results + "<li><b>User Agent:<TAB> </b>" + navigator.userAgent + "\n";
results = results + "<li><b>Code Name:<TAB> </b>" + navigator.appCodeName + "\n";
results = results + "<li><b>App Version:<TAB> </b>" + navigator.appVersion + "\n";
results = results + "<li><b>Language:<TAB> </b>" + navigator.language + "\n";
results = results + "<li><b>Platform:<TAB> </b>" + navigator.platform + "\n";
results = results + "<hr>" + "\n";
document.results.textarea.value = results;
}
function getFontList()
{
try
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
var fontListObj = Components.classes["@mozilla.org/gfx/fontlist;1"].createInstance();
if (fontListObj)
@ -33,54 +71,70 @@ function getFontList()
return fontListObj;
}
</SCRIPT>
<SCRIPT LANGUAGE="JAVASCRIPT">
function getBrowserVersion()
function displayResults(results)
{
document.write("<b><h2>Browser Info </h2></b>");
document.write("<p><li><b>App Name:<TAB> </b>" + navigator.appName);
document.write("<p><li><b>User Agent:<TAB> </b>" + navigator.userAgent);
document.write("<p><li><b>Code Name:<TAB> </b>" + navigator.appCodeName);
document.write("<p><li><b>App Version:<TAB> </b>" + navigator.appVersion);
document.write("<p><li><b>Language:<TAB> </b>" + navigator.language);
document.write("<p><li><b>Platform:<TAB> </b>" + navigator.platform);
document.results.textarea.value = results;
if (top.name == "testWindow")
{
fixSubmit();
}
else
{
document.write(document.results.textarea.value);
}
}
</SCRIPT>
</HEAD>
</script>
</head>
<body onLoad="displayResults(results);">
<!-- form below is ngdriverspecific -->
<form name="results" action="/ngdriver/cgi-bin/writeresults.cgi" method="post">
<script TYPE="text/javascript">
document.write('<input name="resultsfile" type="hidden" value="' + window.opener.document.resultsform.resultsfile.value + '">');
</script>
<input type="hidden" name="textarea">
</form>
<script TYPE="text/javascript">
var langgroup = new Array("x-western", "ar", "el", "he", "ja", "ko", "th",
"tr", "x-baltic", "x-central-euro", "x-cyrillic",
"zh-CN", "zh-TW");
var fonttype = new Array("serif" , "sans-serif", "cursive", "fantasy", "monospace");
<BODY>
<SCRIPT TYPE="text/javascript">
getBrowserVersion();
var fontList = getFontList();
try
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
document.writeln("<H2><B>" + "Available Fonts" + "</B></H2>");
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
results = results + "<H2><B>" + "Available Fonts" + "</B></H2>";
for(i=0; i<langgroup.length; i++)
{
document.writeln("<BR><B><U>" + langgroup[i] + "</U></B> <BR>");
results = results + "<BR><B><U>" + langgroup[i] + "</U></B> <BR>";
for(j=0; j<fonttype.length; j++)
{
document.writeln("<B>" + fonttype[j] + "</B> <BR>");
results = results + "<B>" + fonttype[j] + "</B> <BR>";
var fontEnumerator = fontList.availableFonts(langgroup[i], fonttype[j]);
while (fontEnumerator.hasMoreElements())
{
fontName = fontEnumerator.getNext();
fontName = fontName.QueryInterface(Components.interfaces.nsISupportsWString);
var fontNameStr = fontName.toString();
document.writeln(fontNameStr + "<BR>");
results = results + fontNameStr + "<BR>";
}
}
}
document.writeln("<B>" + "-------------------" + "</B>");
results = results + "<B>" + "<hr>" + "</B>";
results = results + "</html>";
}
catch(e) {
alert("Exception: " + e);
}
</SCRIPT>
</BODY>
</HTML>
</script>
</body>