Index: third_party/WebKit/LayoutTests/media/mediasession/mediaartwork.html |
diff --git a/third_party/WebKit/LayoutTests/media/mediasession/mediaartwork.html b/third_party/WebKit/LayoutTests/media/mediasession/mediaartwork.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9cb813df43dfb21bd07974ce37778cb8413ea2be |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/media/mediasession/mediaartwork.html |
@@ -0,0 +1,48 @@ |
+<!DOCTYPE html> |
+<title>MediaArtwork interface</title> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script> |
+ console.warn("dummy log entry to avoid an empty -expected.txt in virtual/"); |
+ |
+ test(function() { |
+ var artwork = new MediaArtwork({}); |
+ assert_true(artwork != null); |
+ |
+ var exception = false; |
+ try { |
+ artwork = new MediaArtwork("foobar"); |
+ } catch (e) { |
+ exception = true; |
+ } |
+ assert_true(exception); |
+ |
+ exception = false; |
+ try { |
+ artwork = new MediaArtwork(42); |
+ } catch (e) { |
+ exception = true; |
+ } |
+ assert_true(exception); |
+ }, 'Test that MediaArtwork is constructed using a dictionary'); |
+ |
+test (function() { |
+ var artwork = new MediaArtwork({ |
+ src: 'foo', sizes: 'bar', type: 'plop'}); |
+ assert_greater_than(artwork.src.indexOf('foo'), -1); |
+ assert_equals(artwork.sizes, 'bar'); |
+ assert_equals(artwork.type, 'plop'); |
+}, 'Test the different values allowed in MediaArtwork init dictionary'); |
+ |
+test (function() { |
+ var artwork = new MediaArtwork({}); |
+ assert_equals(artwork.src, document.URL); |
+ assert_equals(artwork.sizes, ''); |
+ assert_equals(artwork.type, ''); |
+}, 'Test the default values for MediaArtwork'); |
+ |
+test (function() { |
+ var artwork = new MediaMetadata({ randomValueThatWillNotBeAdded: '... hopefully ;)' }); |
+ assert_equals(artwork.randomValueThatWillNotBeAdded, undefined); |
+}, 'Test that passing unknown values to the dictionary is a no-op'); |
+</script> |