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

Unified Diff: third_party/WebKit/LayoutTests/media/mediasession/mojo/metadata-propagated-twice.html

Issue 2401013002: Make MediaSession per frame as an attribute of Navigator (Closed)
Patch Set: split mojo tests 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/mojo/metadata-propagated-twice.html
diff --git a/third_party/WebKit/LayoutTests/media/mediasession/mojo/metadata-propagated-twice.html b/third_party/WebKit/LayoutTests/media/mediasession/mojo/metadata-propagated-twice.html
new file mode 100644
index 0000000000000000000000000000000000000000..2715ed04df63126fdb130bcd1a51fbeef73811ae
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/mediasession/mojo/metadata-propagated-twice.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>MediaSession Mojo Test</title>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script src="../../../resources/mojo-helpers.js"></script>
+<script src="resources/mediasessionservice-mock.js"></script>
+<script src="resources/utils.js"></script>
+<script>
+
+async_test(function(t) {
+ mediaSessionServiceMock.then(m => {
+ var dontCareMetadata = new MediaMetadata({});
+
+ m.setMetadataCallback(t.step_func(function() {
+ var metadata = new MediaMetadata({
+ title: "title2",
+ artist: "artist2",
+ album: "album2",
+ artwork: [
+ { src: "http://foo.com/bar.jpg", type: "image/jpeg", sizes: "256x256"}
+ ]});
+
+ m.setMetadataCallback(t.step_func(function(receivedMetadata) {
+ assert_metadata_equals(metadata, receivedMetadata);
+ t.done();
+ }));
+ window.navigator.mediaSession.metadata = metadata;
+ }));
+ window.navigator.mediaSession.metadata = dontCareMetadata;
+ });
+}, "test that MediaMetadata is correctly propagated twice");
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698