Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: third_party/WebKit/LayoutTests/typedcssom/computedstyle/computedStylePropertyMap.html

Issue 2906023002: [CSS Typed OM] Fix test bug errors, remove forgotten expectation files (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src='../../resources/testharness.js'></script> 2 <script src='../../resources/testharness.js'></script>
3 <script src='../../resources/testharnessreport.js'></script> 3 <script src='../../resources/testharnessreport.js'></script>
4 4
5 <div id="testElement"></div> 5 <div id="testElement"></div>
6 6
7 <script> 7 <script>
8 8
9 var computedStyleMap = getComputedStyleMap(testElement); 9 var computedStyleMap = getComputedStyleMap(testElement);
10 var computedStyle = getComputedStyle(testElement); 10 var computedStyle = getComputedStyle(testElement);
(...skipping 19 matching lines...) Expand all
30 assert_equals(styleValue.cssText, testElement.style.border); 30 assert_equals(styleValue.cssText, testElement.style.border);
31 }, 'Unsupported but serializable property returns a base CSSStyleValue.'); 31 }, 'Unsupported but serializable property returns a base CSSStyleValue.');
32 32
33 test(function() { 33 test(function() {
34 testElement.style.border = ''; 34 testElement.style.border = '';
35 testElement.style.borderBottomColor = 'green'; 35 testElement.style.borderBottomColor = 'green';
36 assert_equals(computedStyleMap.get('border'), null); 36 assert_equals(computedStyleMap.get('border'), null);
37 }, 'Unsupported and unserializable property returns null.'); 37 }, 'Unsupported and unserializable property returns null.');
38 38
39 test(function() { 39 test(function() {
40 assert_throws(null, function() { computedStyleMap.get('bananas'); }); 40 assert_throws(new TypeError(), function() { computedStyleMap.get('bananas'); } );
41 }, 'get() throws for an invalid property.'); 41 }, 'get() throws for an invalid property.');
42 42
43 test(function() { 43 test(function() {
44 assert_false(computedStyleMap.has('-webkit-mask')); 44 assert_false(computedStyleMap.has('-webkit-mask'));
45 }, 'has() return false for an unsupported property.'); 45 }, 'has() return false for an unsupported property.');
46 46
47 test(function() { 47 test(function() {
48 assert_throws(null, function() { computedStyleMap.has('bananas'); }); 48 assert_throws(new TypeError(), function() { computedStyleMap.has('bananas'); } );
49 }, 'has() throws for an invalid property.'); 49 }, 'has() throws for an invalid property.');
50 50
51 test(function() { 51 test(function() {
52 testElement.style.border = '1px solid black'; 52 testElement.style.border = '1px solid black';
53 assert_true(computedStyleMap.has('border')); 53 assert_true(computedStyleMap.has('border'));
54 }, 'has() returns true for an unsupported but serializable shorthand property.') ; 54 }, 'has() returns true for an unsupported but serializable shorthand property.') ;
55 55
56 test(function() { 56 test(function() {
57 testElement.style.border = ''; 57 testElement.style.border = '';
58 testElement.style.borderTopColor = 'red'; 58 testElement.style.borderTopColor = 'red';
59 assert_false(computedStyleMap.has('border')); 59 assert_false(computedStyleMap.has('border'));
60 }, 'has() return false for unsupported and unserializable shorthand properties.' ); 60 }, 'has() return false for unsupported and unserializable shorthand properties.' );
61 61
62 test(function() { 62 test(function() {
63 assert_true(computedStyleMap.has('width')); 63 assert_true(computedStyleMap.has('width'));
64 }, 'has() returns true for a supported property.'); 64 }, 'has() returns true for a supported property.');
65 65
66 test(function() { 66 test(function() {
67 testElement.style.width = '100px'; 67 testElement.style.width = '100px';
68 assert_equals(computedStyleMap.get('width').cssText, '100px'); 68 assert_equals(computedStyleMap.get('width').cssText, '100px');
69 testElement.style.display = 'none'; 69 testElement.style.display = 'none';
70 assert_equals(computedStyleMap.get('width').cssText, '100px'); 70 assert_equals(computedStyleMap.get('width').cssText, '100px');
71 }, 'get() returns correct values for an element with display: none.'); 71 }, 'get() returns correct values for an element with display: none.');
72 72
73 </script> 73 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698