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

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

Issue 2612003002: Media Session: use dictionary instead of an interface for MediaImage. (Closed)
Patch Set: rebase Created 3 years, 11 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/mediasession/mediasessionmetadata.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 test(function() {
7 var image = new MediaImage({});
8 assert_not_equals(image, null);
9
10 var exception = false;
11 try {
12 image = new MediaImage("foobar");
13 } catch (e) {
14 exception = true;
15 }
16 assert_true(exception);
17
18 exception = false;
19 try {
20 image = new MediaImage(42);
21 } catch (e) {
22 exception = true;
23 }
24 assert_true(exception);
25 }, 'Test that MediaImage is constructed using a dictionary');
26
27 test (function() {
28 var image = new MediaImage({
29 src: 'foo', sizes: 'bar', type: 'plop'});
30 assert_greater_than(image.src.indexOf('foo'), -1);
31 assert_equals(image.sizes, 'bar');
32 assert_equals(image.type, 'plop');
33 }, 'Test the different values allowed in MediaImage init dictionary');
34
35 test (function() {
36 var image = new MediaImage({});
37 assert_equals(image.src, document.URL);
38 assert_equals(image.sizes, '');
39 assert_equals(image.type, '');
40 }, 'Test the default values for MediaImage');
41
42 test (function() {
43 var image = new MediaMetadata({ randomValueThatWillNotBeAdded: '... hopefull y ;)' });
44 assert_equals(image.randomValueThatWillNotBeAdded, undefined);
45 }, 'Test that passing unknown values to the dictionary is a no-op');
46 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/mediasession/mediasessionmetadata.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698