зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1509310 [wpt PR 14181] - Media Capabilities: switch MediaCapabilitiesInfo to a dictionary., a=testonly
Automatic update from web-platform-tests Media Capabilities: switch MediaCapabilitiesInfo to a dictionary. This required to create a custom callback class as CallbackPromiseAdapter does not work well with dictionaries. This is also updating the media-capabilities.idl file in WPT, based on: https://raw.githubusercontent.com/tidoust/reffy-reports/master/whatwg/idl/media-capabilities.idl Bug: 907704 Change-Id: I13bb3c43a7461398f7866f033527bd3ce1bed140 Reviewed-on: https://chromium-review.googlesource.com/c/1347001 Commit-Queue: Mounir Lamouri <mlamouri@chromium.org> Reviewed-by: Philip Jägenstedt <foolip@chromium.org> Cr-Commit-Position: refs/heads/master@{#610655} -- wpt-commits: c7a5c87e5c315051c40c6769952214f5c819df93 wpt-pr: 14181
This commit is contained in:
Родитель
3a9770dc26
Коммит
c5706e3482
|
@ -10,6 +10,7 @@ dictionary MediaConfiguration {
|
|||
|
||||
dictionary MediaDecodingConfiguration : MediaConfiguration {
|
||||
required MediaDecodingType type;
|
||||
MediaCapabilitiesKeySystemConfiguration keySystemConfiguration;
|
||||
};
|
||||
|
||||
dictionary MediaEncodingConfiguration : MediaConfiguration {
|
||||
|
@ -41,11 +42,25 @@ dictionary AudioConfiguration {
|
|||
unsigned long samplerate;
|
||||
};
|
||||
|
||||
[Exposed=(Window, Worker)]
|
||||
interface MediaCapabilitiesInfo {
|
||||
readonly attribute boolean supported;
|
||||
readonly attribute boolean smooth;
|
||||
readonly attribute boolean powerEfficient;
|
||||
dictionary MediaCapabilitiesKeySystemConfiguration {
|
||||
required DOMString keySystem;
|
||||
DOMString initDataType = "";
|
||||
DOMString audioRobustness = "";
|
||||
DOMString videoRobustness = "";
|
||||
MediaKeysRequirement distinctiveIdentifier = "optional";
|
||||
MediaKeysRequirement persistentState = "optional";
|
||||
sequence<DOMString> sessionTypes;
|
||||
};
|
||||
|
||||
dictionary MediaCapabilitiesInfo {
|
||||
required boolean supported;
|
||||
required boolean smooth;
|
||||
required boolean powerEfficient;
|
||||
|
||||
};
|
||||
|
||||
dictionary MediaCapabilitiesDecodingInfo : MediaCapabilitiesInfo {
|
||||
required MediaKeySystemAccess keySystemAccess;
|
||||
};
|
||||
|
||||
[Exposed=Window]
|
||||
|
@ -60,7 +75,7 @@ partial interface WorkerNavigator {
|
|||
|
||||
[Exposed=(Window, Worker)]
|
||||
interface MediaCapabilities {
|
||||
[NewObject] Promise<MediaCapabilitiesInfo> decodingInfo(MediaDecodingConfiguration configuration);
|
||||
[NewObject] Promise<MediaCapabilitiesDecodingInfo> decodingInfo(MediaDecodingConfiguration configuration);
|
||||
[NewObject] Promise<MediaCapabilitiesInfo> encodingInfo(MediaEncodingConfiguration configuration);
|
||||
};
|
||||
|
||||
|
|
|
@ -283,9 +283,9 @@ promise_test(t => {
|
|||
video: minimalVideoConfiguration,
|
||||
audio: minimalAudioConfiguration,
|
||||
}).then(ability => {
|
||||
assert_idl_attribute(ability, 'supported');
|
||||
assert_idl_attribute(ability, 'smooth');
|
||||
assert_idl_attribute(ability, 'powerEfficient');
|
||||
assert_equals(typeof ability.supported, "boolean");
|
||||
assert_equals(typeof ability.smooth, "boolean");
|
||||
assert_equals(typeof ability.powerEfficient, "boolean");
|
||||
});
|
||||
}, "Test that decodingInfo returns a valid MediaCapabilitiesInfo objects");
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<title>MediaCapabilities.decodingInfo()</title>
|
||||
<title>MediaCapabilities.encodingInfo()</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
|
@ -283,9 +283,9 @@ promise_test(t => {
|
|||
video: minimalVideoConfiguration,
|
||||
audio: minimalAudioConfiguration,
|
||||
}).then(ability => {
|
||||
assert_idl_attribute(ability, 'supported');
|
||||
assert_idl_attribute(ability, 'smooth');
|
||||
assert_idl_attribute(ability, 'powerEfficient');
|
||||
assert_equals(typeof ability.supported, "boolean");
|
||||
assert_equals(typeof ability.smooth, "boolean");
|
||||
assert_equals(typeof ability.powerEfficient, "boolean");
|
||||
});
|
||||
}, "Test that encodingInfo returns a valid MediaCapabilitiesInfo objects");
|
||||
|
||||
|
|
|
@ -6,26 +6,6 @@
|
|||
'use strict';
|
||||
|
||||
promise_test(async () => {
|
||||
try {
|
||||
const video = {
|
||||
contentType: 'video/webm; codecs="vp09.00.10.08"',
|
||||
width: 800,
|
||||
height: 600,
|
||||
bitrate: 3000,
|
||||
framerate: 24,
|
||||
};
|
||||
self.decodingInfo = await navigator.mediaCapabilities.decodingInfo({
|
||||
type: 'file',
|
||||
video: video,
|
||||
});
|
||||
self.encodingInfo = await navigator.mediaCapabilities.encodingInfo({
|
||||
type: 'record',
|
||||
video: video
|
||||
});
|
||||
} catch (e) {
|
||||
// Will be surfaced when encodingInfo/decodingInfo is undefined below.
|
||||
}
|
||||
|
||||
idl_test(
|
||||
['media-capabilities'],
|
||||
['html', 'cssom-view'],
|
||||
|
@ -37,7 +17,6 @@ promise_test(async () => {
|
|||
}
|
||||
idl_array.add_objects({
|
||||
MediaCapabilities: ['navigator.mediaCapabilities'],
|
||||
MediaCapabilitiesInfo: ['decodingInfo', 'encodingInfo'],
|
||||
Screen: ['screen'],
|
||||
ScreenLuminance: ['screen.luminance'],
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче