Commit 11d7a45e authored by davve@opera.com's avatar davve@opera.com

Add MediaSession runtime flag along with stub MediaSession object

Implementation of the MediaSession specification will happen behind
the runtime flag 'MediaSession'.

Add a virtual testsuite for running tests with MediaSession flag. This
way we don't have to have the flag enabled when running LayoutTests in
general, only when running MediaSession tests.

Intent to implement:

https://groups.google.com/a/chromium.org/d/msg/blink-dev/dLWDxYgxzQ8/vXt0ntWFNBwJ

BUG=497735

Review URL: https://codereview.chromium.org/1206283002

git-svn-id: svn://svn.chromium.org/blink/trunk@198049 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent c76c015d
......@@ -131,5 +131,10 @@
"prefix": "pointerevent",
"base": "imported/web-platform-tests/pointerevents",
"args": ["--enable-blink-features=PointerEvent"]
},
{
"prefix": "mediasession",
"base": "media/mediasession",
"args": ["--enable-blink-features=MediaSession"]
}
]
This is a testharness.js-based test.
FAIL MediaSession() constructor assert_true: Run either manually by passing the MediaSession flag or as part of the virtual mediasession testsuite. expected true got false
Harness: the test ran to completion.
<!DOCTYPE html>
<title>MediaSession() constructor</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(function() {
assert_true(!window.internals || window.internals.runtimeFlags.mediaSessionEnabled,
"Run either manually by passing the MediaSession flag or as part of the virtual mediasession testsuite.");
console.warn("dummy log entry to avoid an empty -expected.txt in virtual/");
var mediaSession = new MediaSession();
assert_true(mediaSession instanceof MediaSession);
});
</script>
# This suite runs the tests in media/mediasession with
# --enable-blink-features=MediaSession
# For details on MediaSession implementation plan, see: http://crbug.com/497735 .
CONSOLE WARNING: line 10: dummy log entry to avoid an empty -expected.txt in virtual/
This is a testharness.js-based test.
PASS MediaSession() constructor
Harness: the test ran to completion.
include_rules = [
"+bindings",
"-modules",
"+modules/mediasession",
"+platform",
]
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "config.h"
#include "modules/mediasession/MediaSession.h"
namespace blink {
MediaSession::MediaSession()
{
}
RefPtrWillBeRawPtr<MediaSession> MediaSession::create()
{
return adoptRefWillBeNoop(new MediaSession());
}
void MediaSession::activate()
{
}
void MediaSession::deactivate()
{
}
}
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MediaSession_h
#define MediaSession_h
#include "bindings/core/v8/ScriptWrappable.h"
#include "platform/heap/Handle.h"
namespace blink {
class MediaSession : public ScriptWrappable, public RefCountedWillBeNoBase<MediaSession> {
DEFINE_WRAPPERTYPEINFO();
public:
static RefPtrWillBeRawPtr<MediaSession> create();
void activate();
void deactivate();
private:
MediaSession();
};
}
#endif // MediaSession_h
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
Constructor(),
RuntimeEnabled=MediaSession,
] interface MediaSession {
void activate();
void deactivate();
};
avayvod@chromium.org
davve@opera.com
mlamouri@chromium.org
philipj@opera.com
......@@ -107,6 +107,7 @@
'mediasource/TrackDefault.idl',
'mediasource/TrackDefaultList.idl',
'mediasource/VideoPlaybackQuality.idl',
'mediasession/MediaSession.idl',
'mediastream/MediaDeviceInfo.idl',
'mediastream/MediaDevices.idl',
'mediastream/MediaStream.idl',
......@@ -935,6 +936,8 @@
'indexeddb/WebIDBDatabaseCallbacksImpl.h',
'indexeddb/WorkerGlobalScopeIndexedDatabase.cpp',
'indexeddb/WorkerGlobalScopeIndexedDatabase.h',
'mediasession/MediaSession.h',
'mediasession/MediaSession.cpp',
'mediasource/HTMLVideoElementMediaSource.cpp',
'mediasource/HTMLVideoElementMediaSource.h',
'mediasource/MediaSource.cpp',
......
......@@ -90,6 +90,7 @@ GlobalFetch status=stable
Media status=stable
MediaCapture
MediaController depends_on=Media, status=experimental
MediaSession
MediaSource status=stable
MediaSourceExperimental depends_on=MediaSource, status=experimental
MediaStreamSpeech status=experimental
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment