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 | |
8 test(function() { | 6 test(function() { |
9 var image = new MediaImage({}); | 7 var image = new MediaImage({}); |
10 assert_true(image != null); | 8 assert_not_equals(image, null); |
11 | 9 |
12 var exception = false; | 10 var exception = false; |
13 try { | 11 try { |
14 image = new MediaImage("foobar"); | 12 image = new MediaImage("foobar"); |
15 } catch (e) { | 13 } catch (e) { |
16 exception = true; | 14 exception = true; |
17 } | 15 } |
18 assert_true(exception); | 16 assert_true(exception); |
19 | 17 |
20 exception = false; | 18 exception = false; |
(...skipping 18 matching lines...) Expand all Loading... |
39 assert_equals(image.src, document.URL); | 37 assert_equals(image.src, document.URL); |
40 assert_equals(image.sizes, ''); | 38 assert_equals(image.sizes, ''); |
41 assert_equals(image.type, ''); | 39 assert_equals(image.type, ''); |
42 }, 'Test the default values for MediaImage'); | 40 }, 'Test the default values for MediaImage'); |
43 | 41 |
44 test (function() { | 42 test (function() { |
45 var image = new MediaMetadata({ randomValueThatWillNotBeAdded: '... hopefull
y ;)' }); | 43 var image = new MediaMetadata({ randomValueThatWillNotBeAdded: '... hopefull
y ;)' }); |
46 assert_equals(image.randomValueThatWillNotBeAdded, undefined); | 44 assert_equals(image.randomValueThatWillNotBeAdded, undefined); |
47 }, 'Test that passing unknown values to the dictionary is a no-op'); | 45 }, 'Test that passing unknown values to the dictionary is a no-op'); |
48 </script> | 46 </script> |
OLD | NEW |