OLD | NEW |
---|---|
(Empty) | |
1 'use strict'; | |
suzyh_UTC10 (ex-contributor)
2017/05/22 01:46:20
My comments on https://codereview.chromium.org/288
| |
2 | |
3 function assert_valid_value(property, value) { | |
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"); | |
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); | |
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"); | |
27 } | |
OLD | NEW |