Regression test for bug 335816
authorsmontagu@smontagu.org
Thu, 06 Dec 2007 09:04:46 -0800
changeset 8793 e785a936a4915a6ee0a97612487df43f63b687ee
parent 8792 9b2a28cec34ecc507824b151c5dc94c5a48d2446
child 8794 60903a5c45c4ff470d2442fdcc08d40719e3011b
push idunknown
push userunknown
push dateunknown
bugs335816
milestone1.9b2pre
Regression test for bug 335816
intl/uconv/tests/Makefile.in
intl/uconv/tests/test_bug335816.html
--- a/intl/uconv/tests/Makefile.in
+++ b/intl/uconv/tests/Makefile.in
@@ -34,16 +34,17 @@
 # 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	= intl/uconv/tests
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE          = test_intl_uconv
 
 MOZILLA_INTERNAL_API = 1
 
 REQUIRES	= \
@@ -60,16 +61,26 @@ CPPSRCS		= \
 		$(NULL)
 
 ifeq ($(OS_ARCH),WINNT)
 CPPSRCS		+= convperf.cpp
 endif
 
 SIMPLE_PROGRAMS	= $(CPPSRCS:.cpp=$(BIN_SUFFIX))
 
+ifdef MOZ_MOCHITEST
+
+_TEST_FILES =	\
+		test_bug335816.html \
+		$(NULL)
+libs:: $(_TEST_FILES)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
+
+endif # MOZ_MOCHITEST
+
 XPCSHELL_TESTS = unit
 
 include $(topsrcdir)/config/rules.mk
 
 INCLUDES	+= \
 		-I$(srcdir)/../ucvlatin \
 		-I$(srcdir)/../ucvja \
 		-I$(srcdir)/../util \
new file mode 100644
--- /dev/null
+++ b/intl/uconv/tests/test_bug335816.html
@@ -0,0 +1,42 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=335816
+-->
+<head>
+  <meta http-equiv="Content-type" content="text/html; charset=UTF-8">
+  <title>Test for Bug 335816</title>
+  <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+
+/** Test for Bug 335816 **/
+function test()
+{
+  ok($("display").innerHTML != "Keep that breathless charm", "Hidden script not executed");
+  SimpleTest.finish();
+}
+
+function WontYouPleaseArrangeIt()
+{
+  $("display").innerHTML = "Keep that breathless charm";
+}
+
+  setTimeout(test, 100);
+  SimpleTest.waitForExplicitFinish();
+</script>
+</pre>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=335816">Mozilla Bug 335816</a>
+<p id="display">Lovely ... Never, ever change.</p>
+
+<!-- There is a UTF-8 BOM just here - - - 
+                                         |  which should not be stripped 
+                                         v      -->
+<div id="content" style="display: none"><´╗┐script>WontYouPleaseArrangeIt();</script></div>
+</body>
+</html>
+