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

Side by Side Diff: third_party/WebKit/LayoutTests/media/mediasession/mediaimage.html

Issue 2394223002: Rename MediaArtwork -> MediaImage (Closed)
Patch Set: rebased Created 4 years, 2 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
(Empty)
1 <!DOCTYPE html>
2 <title>MediaImage interface</title>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <script>
6 console.warn("dummy log entry to avoid an empty -expected.txt in virtual/");
7
8 test(function() {
9 var image = new MediaImage({});
10 assert_true(image != null);
11
12 var exception = false;
13 try {
14 image = new MediaImage("foobar");
15 } catch (e) {
16 exception = true;
17 }
18 assert_true(exception);
19
20 exception = false;
21 try {
22 image = new MediaImage(42);
23 } catch (e) {
24 exception = true;
25 }
26 assert_true(exception);
27 }, 'Test that MediaImage is constructed using a dictionary');
28
29 test (function() {
30 var image = new MediaImage({
31 src: 'foo', sizes: 'bar', type: 'plop'});
32 assert_greater_than(image.src.indexOf('foo'), -1);
33 assert_equals(image.sizes, 'bar');
34 assert_equals(image.type, 'plop');
35 }, 'Test the different values allowed in MediaImage init dictionary');
36
37 test (function() {
38 var image = new MediaImage({});
39 assert_equals(image.src, document.URL);
40 assert_equals(image.sizes, '');
41 assert_equals(image.type, '');
42 }, 'Test the default values for MediaImage');
43
44 test (function() {
45 var image = new MediaMetadata({ randomValueThatWillNotBeAdded: '... hopefull y ;)' });
46 assert_equals(image.randomValueThatWillNotBeAdded, undefined);
47 }, 'Test that passing unknown values to the dictionary is a no-op');
48 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698