Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 'use strict'; | |
| 2 | |
| 3 function assert_valid_value(property, value, serializedValue) { | |
| 4 if (arguments.length < 3) | |
| 5 serializedValue = value; | |
| 6 | |
| 7 var stringifiedValue = JSON.stringify(value); | |
| 8 | |
| 9 test(function(){ | |
| 10 var div = document.createElement('div'); | |
| 11 div.style[property] = value; | |
| 12 assert_not_equals(div.style[property], ""); | |
| 13 }, "e.style['" + property + "'] = " + stringifiedValue + " should set the va lue"); | |
|
suzyh_UTC10 (ex-contributor)
2017/05/25 01:55:38
I believe you modified this description in the ver
Eric Willigers
2017/05/25 11:43:12
Done.
| |
| 14 | |
| 15 test(function(){ | |
| 16 var div = document.createElement('div'); | |
| 17 div.style[property] = value; | |
| 18 var readValue = div.style[property]; | |
| 19 assert_equals(readValue, serializedValue); | |
| 20 div.style[property] = readValue; | |
| 21 assert_equals(div.style[property], readValue); | |
| 22 }, "Serialization should round-trip after setting e.style['" + property + "' ] = " + stringifiedValue); | |
| 23 } | |
| 24 | |
| 25 function assert_invalid_value(property, value) { | |
| 26 var stringifiedValue = JSON.stringify(value); | |
| 27 | |
| 28 test(function(){ | |
| 29 var div = document.createElement('div'); | |
| 30 div.style[property] = value; | |
| 31 assert_equals(div.style[property], ""); | |
| 32 }, "e.style['" + property + "'] = " + stringifiedValue + " should not set th e value"); | |
| 33 } | |
| OLD | NEW |