Address review comments.

This commit is contained in:
Josh Matthews 2014-12-12 12:58:42 -05:00
parent 9d82e06e64
commit 3cfe8ab53e
10 changed files with 92 additions and 121 deletions

View file

@ -12,17 +12,17 @@ function expect(num) {
function _fail(s, m) {
_tests++;
// string split to avoid problems with tests that end up printing the value of window._fail.
console.log(_oneline("TEST-UNEXPECTED" + "-FAIL | " + s + ": " + m));
window.alert(_oneline("TEST-UNEXPECTED" + "-FAIL | " + s + ": " + m));
}
function _pass(s, m) {
_tests++;
//console.log(_oneline("TEST-PASS | " + s + ": " + m));
window.alert(_oneline("TEST-PASS | " + s + ": " + m));
}
function _printer(opstr, op) {
return function (a, b, msg) {
var f = op(a,b) ? _pass : _fail;
let f = op(a,b) ? _pass : _fail;
if (!msg) msg = "";
f(a + " " + opstr + " " + b, msg);
};

View file

@ -3,10 +3,8 @@ function run_tests(properties) {
var name = Object.keys(properties)[property];
var generator = create_value_generator(properties[name]);
var prop = properties[name].property || name;
//setTimeout(function(name, generator, prop) {
while (run_test(name, generator, prop)) {
}
//}, 0, name, generator, prop);
while (run_test(name, generator, prop)) {
}
}
}
@ -85,7 +83,6 @@ function to_idl(property) {
}
function run_test(property, generator, prop) {
//console.log("testing " + property + ' ' + to_idl(property));
var elem = document.createElement('div');
document.getElementById('parent').appendChild(elem);
var style = generate_inline_style(property, generator());

View file

@ -1,9 +1,9 @@
<div id="test" style="display: block; background-color: black; background-position: top left; font-style: italic">test text!</div>
<script>
var id = document.getElementById('test');
/*alert(id.style.display);
alert(id.style.display);
id.style.display = 'none';
alert(id.style.display);*/
alert(id.style.display);
alert(id.style.fontStyle + ' ' + id.style['font-style']);
id.style.background = "black";
alert(document.getElementById('test').style.background);