Bug 339350. move unit tests. r=mrbkap

This commit is contained in:
sayrer%gmail.com 2007-02-19 19:47:31 +00:00
parent abc9f31757
commit 62aae02099
4 changed files with 117 additions and 1 deletions

View File

@ -53,4 +53,9 @@ DIRS += \
$(NULL)
endif
ifdef MOZ_MOCHITEST
DIRS += mochitest \
$(NULL)
endif
include $(topsrcdir)/config/rules.mk

View File

@ -0,0 +1,51 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# 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.org code.
#
# The Initial Developer of the Original Code is
# Mozilla Foundation.
# Portions created by the Initial Developer are Copyright (C) 2007
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = parser/htmlparser/tests/mochitest
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
_TEST_FILES = test_bug339350.xhtml \
$(NULL)
libs:: $(_TEST_FILES)
$(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)

View File

@ -0,0 +1,61 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
Tests by Sam Ruby - WTFPL License (http://sam.zoy.org/wtfpl/)
http://www.intertwingly.net/blog/2006/10/03/Firefox-XHTML-innerHTML-quirk#comments
https://bugzilla.mozilla.org/show_bug.cgi?id=339350
-->
<head>
<!-- XHTML needs the packed version -->
<script type="text/javascript" src="/MochiKit/packed.js"/>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"/>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=339350">Mozilla Bug 339350</a>
<div style="display: none">
<table border="1" cellspacing="0">
<thead>
<th></th>
<th>plain</th>
<th>brackets</th>
<th>braces</th>
</thead>
<tr>
<th>innerHTML</th>
<td><div id="i1"/></td>
<td style="background:yellow"><div id="i2"/></td>
<td><div id="i3"/></td>
</tr>
<tr>
<th>textNode</th>
<td><div id="t1"/></td>
<td><div id="t2"/></td>
<td><div id="t3"/></td>
</tr>
</table>
</div>
<pre id="test">
<script type="text/javascript">
var text1 = 'foo bar';
var text2 = 'foo [bar]';
var text3 = 'foo {bar}';
<!-- This is the long way to write this stuff,
you can use MochiKit functions too -->
document.getElementById('i1').innerHTML = text1;
document.getElementById('i2').innerHTML = text2;
document.getElementById('i3').innerHTML = text3;
document.getElementById('t1').appendChild(document.createTextNode(text1));
document.getElementById('t2').appendChild(document.createTextNode(text2));
document.getElementById('t3').appendChild(document.createTextNode(text3));
<!-- The is() function is one way to add a test -->
is(document.getElementById('i2').innerHTML, text2, "XHTML innerHTML with trailing brackets ']]'");
</script>
</pre>
</body>
</html>

View File

@ -53,7 +53,6 @@ RunSet.runall = function() {
'test_bug319381.html',
'test_bug333983.html',
'test_bug337124.html',
'test_bug339350.xhtml',
'test_bug342448.html',
'test_bug344830.html',
'test_bug344861.html',