Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 'use strict'; | |
|
suzyh_UTC10 (ex-contributor)
2017/05/22 01:11:45
Consider naming this file something like testcommo
Eric Willigers
2017/05/22 07:13:39
Done.
| |
| 2 | |
| 3 function assert_valid_value(property, value) { | |
|
suzyh_UTC10 (ex-contributor)
2017/05/22 01:11:45
I find it slightly surprising that a function name
Eric Willigers
2017/05/22 07:13:40
Done.
I also came across another option, but I do
| |
| 4 var stringifiedValue = JSON.stringify(value); | |
| 5 | |
| 6 test(function(){ | |
| 7 var div = document.createElement('div'); | |
| 8 div.style[property] = value; | |
| 9 assert_not_equals(div.style[property], ""); | |
| 10 }, "e.style['" + property + "'] = " + stringifiedValue + " should set the va lue"); | |
|
suzyh_UTC10 (ex-contributor)
2017/05/22 01:11:44
Is 'sets the value' exactly synonymous with 'parse
Eric Willigers
2017/05/22 07:13:39
I have changed the function to accept an optional
| |
| 11 | |
| 12 test(function(){ | |
| 13 var div = document.createElement('div'); | |
| 14 div.style[property] = value; | |
| 15 assert_equals(div.style[property], value); | |
| 16 }, "Serialization should round-trip after setting e.style['" + property + "' ] = " + stringifiedValue); | |
|
suzyh_UTC10 (ex-contributor)
2017/05/22 01:11:45
Are we likely to want to test that X is a valid va
| |
| 17 } | |
| 18 | |
| 19 function assert_invalid_value(property, value) { | |
| 20 var stringifiedValue = JSON.stringify(value); | |
| 21 | |
| 22 test(function(){ | |
| 23 var div = document.createElement('div'); | |
| 24 div.style[property] = value; | |
| 25 assert_equals(div.style[property], ""); | |
| 26 }, "e.style['" + property + "'] = " + stringifiedValue + " should not set th e value"); | |
|
suzyh_UTC10 (ex-contributor)
2017/05/22 01:11:45
I find this test description (and to a lesser exte
| |
| 27 } | |
| OLD | NEW |