Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>MediaImage interface</title> | 2 <title>MediaImage interface</title> |
| 3 <script src="../../resources/testharness.js"></script> | 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> | 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 <script> | 5 <script> |
| 6 console.warn("dummy log entry to avoid an empty -expected.txt in virtual/"); | |
| 7 | 6 |
| 8 test(function() { | 7 test(function() { |
|
whywhat
2016/10/10 20:45:09
is this change accidental? seems unrelated from th
Zhiqiang Zhang (Slow)
2016/10/11 10:56:03
Aha! I found the indentation in this file is prett
whywhat
2016/10/11 14:58:33
Usually reformatting is done in separate cls since
Zhiqiang Zhang (Slow)
2016/10/11 16:59:05
OK, reverted the indenting.
| |
| 9 var image = new MediaImage({}); | 8 var image = new MediaImage({}); |
| 10 assert_true(image != null); | 9 assert_true(image != null); |
|
mlamouri (slow - plz ping)
2016/10/10 20:30:34
`assert_not_equals(image, null)`?
Zhiqiang Zhang (Slow)
2016/10/11 10:56:03
Done.
| |
| 11 | 10 |
| 12 var exception = false; | 11 var exception = false; |
| 13 try { | 12 try { |
| 14 image = new MediaImage("foobar"); | 13 image = new MediaImage("foobar"); |
| 15 } catch (e) { | 14 } catch (e) { |
| 16 exception = true; | 15 exception = true; |
| 17 } | 16 } |
| 18 assert_true(exception); | 17 assert_true(exception); |
| 19 | 18 |
| 20 exception = false; | 19 exception = false; |
|
mlamouri (slow - plz ping)
2016/10/10 20:30:34
style: I might misunderstand the diff but is this
Zhiqiang Zhang (Slow)
2016/10/11 10:56:03
Done.
| |
| 21 try { | 20 try { |
| 22 image = new MediaImage(42); | 21 image = new MediaImage(42); |
| 23 } catch (e) { | 22 } catch (e) { |
| 24 exception = true; | 23 exception = true; |
| 25 } | 24 } |
|
mlamouri (slow - plz ping)
2016/10/10 20:30:34
ditto
Zhiqiang Zhang (Slow)
2016/10/11 10:56:03
Done.
| |
| 26 assert_true(exception); | 25 assert_true(exception); |
| 27 }, 'Test that MediaImage is constructed using a dictionary'); | 26 }, 'Test that MediaImage is constructed using a dictionary'); |
| 28 | 27 |
| 29 test (function() { | 28 test(function() { |
| 30 var image = new MediaImage({ | 29 var image = new MediaImage({ |
| 31 src: 'foo', sizes: 'bar', type: 'plop'}); | 30 src: 'foo', sizes: 'bar', type: 'plop'}); |
| 32 assert_greater_than(image.src.indexOf('foo'), -1); | 31 assert_greater_than(image.src.indexOf('foo'), -1); |
| 33 assert_equals(image.sizes, 'bar'); | 32 assert_equals(image.sizes, 'bar'); |
| 34 assert_equals(image.type, 'plop'); | 33 assert_equals(image.type, 'plop'); |
| 35 }, 'Test the different values allowed in MediaImage init dictionary'); | 34 }, 'Test the different values allowed in MediaImage init dictionary'); |
| 36 | 35 |
| 37 test (function() { | 36 test (function() { |
| 38 var image = new MediaImage({}); | 37 var image = new MediaImage({}); |
| 39 assert_equals(image.src, document.URL); | 38 assert_equals(image.src, document.URL); |
| 40 assert_equals(image.sizes, ''); | 39 assert_equals(image.sizes, ''); |
| 41 assert_equals(image.type, ''); | 40 assert_equals(image.type, ''); |
| 42 }, 'Test the default values for MediaImage'); | 41 }, 'Test the default values for MediaImage'); |
| 43 | 42 |
| 44 test (function() { | 43 test (function() { |
| 45 var image = new MediaMetadata({ randomValueThatWillNotBeAdded: '... hopefull y ;)' }); | 44 var image = new MediaMetadata({ randomValueThatWillNotBeAdded: '... hopefully ;)' }); |
| 46 assert_equals(image.randomValueThatWillNotBeAdded, undefined); | 45 assert_equals(image.randomValueThatWillNotBeAdded, undefined); |
| 47 }, 'Test that passing unknown values to the dictionary is a no-op'); | 46 }, 'Test that passing unknown values to the dictionary is a no-op'); |
| 47 | |
| 48 </script> | 48 </script> |
| OLD | NEW |