Add work in progress for tests of CSS property parsing and data computation.

This commit is contained in:
dbaron@dbaron.org 2007-04-15 15:27:14 -07:00
Родитель 4ff6796341
Коммит bda8a4f932
3 изменённых файлов: 1927 добавлений и 0 удалений

Просмотреть файл

@ -73,7 +73,9 @@ _TEST_FILES = test_bug302186.html \
test_bug373293.html \
test_inherit_storage.html \
test_initial_storage.html \
test_property_database.html \
css_properties.js \
property_database.js \
$(NULL)

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,61 @@
<!DOCTYPE HTML>
<html>
<!--
-->
<head>
<title>Test that property_database.js contains all supported CSS properties</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="css_properties.js"></script>
<script type="text/javascript" src="property_database.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none">
<div id="testnode"></div>
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test that property_database.js contains all supported CSS properties **/
/*
* Here we are testing the hand-written property_database.js against
* the autogenerated css_properties.js to make sure that everything in
* css_properties.js is in property_database.js.
*
* This prevents CSS properties from being added to the code without
* also being put under the minimal test coverage provided by the tests
* that use property_database.js.
*/
for (var idx in gLonghandProperties) {
var prop = gLonghandProperties[idx];
ok(prop.name in gCSSProperties &&
gCSSProperties[prop.name].type == CSS_TYPE_LONGHAND &&
gCSSProperties[prop.name].domProp == prop.prop,
"'" + prop.name + "' listed in gCSSProperties as CSS_TYPE_LONGHAND with correct DOM property name");
}
for (var idx in gShorthandProperties) {
var prop = gShorthandProperties[idx];
ok(prop.name in gCSSProperties &&
(gCSSProperties[prop.name].type == CSS_TYPE_TRUE_SHORTHAND ||
gCSSProperties[prop.name].type == CSS_TYPE_SHORTHAND_AND_LONGHAND) &&
gCSSProperties[prop.name].domProp == prop.prop,
"'" + prop.name + "' listed in gCSSProperties as CSS_TYPE_TRUE_SHORTHAND or CSS_TYPE_SHORTHAND_AND_LONGHAND with correct DOM property name");
}
for (var idx in gShorthandPropertiesLikeLonghand) {
var prop = gShorthandPropertiesLikeLonghand[idx];
ok(prop.name in gCSSProperties &&
gCSSProperties[prop.name].type == CSS_TYPE_SHORTHAND_AND_LONGHAND &&
gCSSProperties[prop.name].domProp == prop.prop,
"'" + prop.name + "' listed in gCSSProperties as CSS_TYPE_SHORTHAND_AND_LONGHAND with correct DOM property name");
}
</script>
</pre>
</body>
</html>