Adding bug 535806 test. r=dbaron

This commit is contained in:
Boris Zbarsky 2010-01-13 11:37:54 -05:00
parent 8c09ee17b6
commit 1d3e09c88b
8 changed files with 147 additions and 0 deletions

View File

@ -45,6 +45,9 @@ include $(DEPTH)/config/autoconf.mk
MODULE = layout
DIRS += chrome \
$(NULL)
# XXX Yuck. We can't transfer everything from autoconf to HOST_CFLAGS,
# but it would be nice to pick up anything affecting nsCSSPropList.h
# automatically.

View File

@ -0,0 +1,54 @@
# ***** 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) 2009
# 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 = layout/style/test/chrome
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
_CHROME_FILES = \
test_bug535806.xul \
bug535806-css.css \
bug535806-html.html \
bug535806-xul.xul \
$(NULL)
libs:: $(_CHROME_FILES)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)

View File

@ -0,0 +1 @@
fooBar[fooBar] { color: green; }

View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="bug535806-css.css">
</head>
<body onload="window.parent.wrappedJSObject.htmlLoaded()">
</body>
</html>

View File

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<?xml-stylesheet type="text/css" href="data:text/css,fooBar{color:red;}"?>
<?xml-stylesheet type="text/css" href="bug535806-css.css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="window.parent.wrappedJSObject.xulLoaded()">
<fooBar fooBar="" id="s"/>
</window>

View File

@ -0,0 +1,44 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=535806
-->
<window title="Mozilla Bug 535806"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"/>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
<!-- test results are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml">
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=535806"
target="_blank">Mozilla Bug 535806</a>
</body>
<iframe id="f"/>
<!-- test code goes here -->
<script type="application/javascript">
<![CDATA[
/** Test for Bug 535806 **/
SimpleTest.waitForExplicitFinish();
window.addEventListener("load", function() {
$("f").setAttribute("src", "bug535806-html.html");
}, false);
function htmlLoaded() {
$("f").setAttribute("src", "bug535806-xul.xul");
}
function xulLoaded() {
var doc = $("f").contentDocument;
is(doc.defaultView.getComputedStyle(doc.getElementById("s"), null).color,
"rgb(0, 128, 0)");
SimpleTest.finish();
}
]]>
</script>
</window>

View File

@ -19,6 +19,8 @@ if ($template_type eq "xul") {
$template_type = "$FindBin::RealBin/static/xul.template.txt";
} elsif ($template_type eq "xhtml") {
$template_type = "$FindBin::RealBin/static/xhtml.template.txt";
} elsif ($template_type eq "chrome") {
$template_type = "$FindBin::RealBin/static/chrome.template.txt";
} else {
$template_type = "$FindBin::RealBin/static/test.template.txt";
}

View File

@ -0,0 +1,27 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id={BUGNUMBER}
-->
<window title="Mozilla Bug {BUGNUMBER}"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"/>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
<!-- test results are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml">
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id={BUGNUMBER}"
target="_blank">Mozilla Bug {BUGNUMBER}</a>
</body>
<!-- test code goes here -->
<script type="application/javascript">
<![CDATA[
/** Test for Bug {BUGNUMBER} **/
]]>
</script>
</window>