1/* 2* The contents of this file are subject to the Netscape Public 3* License Version 1.1 (the "License"); you may not use this file 4* except in compliance with the License. You may obtain a copy of 5* the License at http://www.mozilla.org/NPL/ 6* 7* Software distributed under the License is distributed on an "AS 8* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 9* implied. See the License for the specific language governing 10* rights and limitations under the License. 11* 12* The Original Code is mozilla.org code. 13* 14* The Initial Developer of the Original Code is Netscape 15* Communications Corporation. Portions created by Netscape are 16* Copyright (C) 1998 Netscape Communications Corporation. All 17* Rights Reserved. 18* 19* Contributor(s): pschwartau@netscape.com 20* Date: 16 May 2001 21* 22* SUMMARY: Regression test for bug 76054 23* 24* See http://bugzilla.mozilla.org/show_bug.cgi?id=76054 25* See http://bugzilla.mozilla.org/show_bug.cgi?id=78706 26* All String HTML methods should be LOWER case - 27*/ 28//------------------------------------------------------------------------------------------------- 29var UBound = 0; 30var bug = 76054; 31var summary = 'Testing that String HTML methods produce all lower-case'; 32var statprefix = 'Currently testing String.'; 33var status = ''; 34var statusitems = [ ]; 35var actual = ''; 36var actualvalues = [ ]; 37var expect= ''; 38var expectedvalues = [ ]; 39var s = 'xyz'; 40 41status = 'anchor()'; 42actual = s.anchor(); 43expect = actual.toLowerCase(); 44addThis(); 45 46status = 'big()'; 47actual = s.big(); 48expect = actual.toLowerCase(); 49addThis(); 50 51status = 'blink()'; 52actual = s.blink(); 53expect = actual.toLowerCase(); 54addThis(); 55 56status = 'bold()'; 57actual = s.bold(); 58expect = actual.toLowerCase(); 59addThis(); 60 61status = 'italics()'; 62actual = s.italics(); 63expect = actual.toLowerCase(); 64addThis(); 65 66status = 'fixed()'; 67actual = s.fixed(); 68expect = actual.toLowerCase(); 69addThis(); 70 71status = 'fontcolor()'; 72actual = s.fontcolor(); 73expect = actual.toLowerCase(); 74addThis(); 75 76status = 'fontsize()'; 77actual = s.fontsize(); 78expect = actual.toLowerCase(); 79addThis(); 80 81status = 'link()'; 82actual = s.link(); 83expect = actual.toLowerCase(); 84addThis(); 85 86status = 'small()'; 87actual = s.small(); 88expect = actual.toLowerCase(); 89addThis(); 90 91status = 'strike()'; 92actual = s.strike(); 93expect = actual.toLowerCase(); 94addThis(); 95 96status = 'sub()'; 97actual = s.sub(); 98expect = actual.toLowerCase(); 99addThis(); 100 101status = 'sup()'; 102actual = s.sup(); 103expect = actual.toLowerCase(); 104addThis(); 105 106 107//------------------------------------------------------------------------------------------------- 108test(); 109//------------------------------------------------------------------------------------------------- 110 111 112function addThis() 113{ 114 statusitems[UBound] = status; 115 actualvalues[UBound] = actual; 116 expectedvalues[UBound] = expect; 117 UBound++; 118} 119 120 121function test() 122{ 123 enterFunc ('test'); 124 printBugNumber (bug); 125 printStatus (summary); 126 127 for (var i = 0; i < UBound; i++) 128 { 129 reportCompare(expectedvalues[i], actualvalues[i], getStatus(i)); 130 } 131 132 exitFunc ('test'); 133} 134 135 136function getStatus(i) 137{ 138 return statprefix + statusitems[i]; 139} 140