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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/media/mediasession/mediaimage.html
diff --git a/third_party/WebKit/LayoutTests/media/mediasession/mediaimage.html b/third_party/WebKit/LayoutTests/media/mediasession/mediaimage.html
new file mode 100644
index 0000000000000000000000000000000000000000..dcf76e5f5db2783c7db52642014cee1a921341e2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/mediasession/mediaimage.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>MediaImage 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 image = new MediaImage({});
+ assert_true(image != null);
+
+ var exception = false;
+ try {
+ image = new MediaImage("foobar");
+ } catch (e) {
+ exception = true;
+ }
+ assert_true(exception);
+
+ exception = false;
+ try {
+ image = new MediaImage(42);
+ } catch (e) {
+ exception = true;
+ }
+ assert_true(exception);
+ }, 'Test that MediaImage is constructed using a dictionary');
+
+test (function() {
+ var image = new MediaImage({
+ src: 'foo', sizes: 'bar', type: 'plop'});
+ assert_greater_than(image.src.indexOf('foo'), -1);
+ assert_equals(image.sizes, 'bar');
+ assert_equals(image.type, 'plop');
+}, 'Test the different values allowed in MediaImage init dictionary');
+
+test (function() {
+ var image = new MediaImage({});
+ assert_equals(image.src, document.URL);
+ assert_equals(image.sizes, '');
+ assert_equals(image.type, '');
+}, 'Test the default values for MediaImage');
+
+test (function() {
+ var image = new MediaMetadata({ randomValueThatWillNotBeAdded: '... hopefully ;)' });
+ assert_equals(image.randomValueThatWillNotBeAdded, undefined);
+}, 'Test that passing unknown values to the dictionary is a no-op');
+</script>

Powered by Google App Engine
This is Rietveld 408576698