Skip to content

Commit

Permalink
Bug 1139904 - Add initial test runtime files for mochitest browser-ch…
Browse files Browse the repository at this point in the history
…rome and devtools
  • Loading branch information
rmottola committed Jul 6, 2019
1 parent 97dc41f commit 9837c79
Show file tree
Hide file tree
Showing 32 changed files with 139 additions and 1 deletion.
91 changes: 91 additions & 0 deletions 293c4b5fad634bcfe5922bf48f27afe25c61bf8f.diff
@@ -0,0 +1,91 @@
diff --git a/dom/media/webrtc/MediaEngineCameraVideoSource.cpp b/dom/media/webrtc/MediaEngineCameraVideoSource.cpp
index 9c318c6ef978..b82e96774dca 100644
--- a/dom/media/webrtc/MediaEngineCameraVideoSource.cpp
+++ b/dom/media/webrtc/MediaEngineCameraVideoSource.cpp
@@ -116,10 +116,16 @@ MediaEngineCameraVideoSource::FitnessDistance(double n,
MediaEngineCameraVideoSource::GetFitnessDistance(const webrtc::CaptureCapability& aCandidate,
const MediaTrackConstraintSet &aConstraints)
{
+ // Treat width|height|frameRate == 0 on capability as "can do any".
+ // This allows for orthogonal capabilities that are not in discrete steps.
+
uint64_t distance =
- uint64_t(FitnessDistance(int32_t(aCandidate.width), aConstraints.mWidth)) +
- uint64_t(FitnessDistance(int32_t(aCandidate.height), aConstraints.mHeight)) +
- uint64_t(FitnessDistance(double(aCandidate.maxFPS), aConstraints.mFrameRate));
+ uint64_t(aCandidate.width? FitnessDistance(int32_t(aCandidate.width),
+ aConstraints.mWidth) : 0) +
+ uint64_t(aCandidate.height? FitnessDistance(int32_t(aCandidate.height),
+ aConstraints.mHeight) : 0) +
+ uint64_t(aCandidate.maxFPS? FitnessDistance(double(aCandidate.maxFPS),
+ aConstraints.mFrameRate) : 0);
return uint32_t(std::min(distance, uint64_t(UINT32_MAX)));
}

diff --git a/dom/media/webrtc/MediaEngineWebRTCVideo.cpp b/dom/media/webrtc/MediaEngineWebRTCVideo.cpp
index 150b215255d9..6e291e1080fa 100644
--- a/dom/media/webrtc/MediaEngineWebRTCVideo.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTCVideo.cpp
@@ -162,27 +162,43 @@ MediaEngineWebRTCVideoSource::NumCapabilities()
if (num > 0) {
return num;
}
- // Mac doesn't support capabilities.
- //
- // Hardcode generic desktop capabilities modeled on OSX camera.
- // Note: Values are empirically picked to be OSX friendly, as on OSX, values
- // other than these cause the source to not produce.
-
- if (mHardcodedCapabilities.IsEmpty()) {
- for (int i = 0; i < 9; i++) {
- webrtc::CaptureCapability c;
- c.width = 1920 - i*128;
- c.height = 1080 - i*72;
- c.maxFPS = 30;
- mHardcodedCapabilities.AppendElement(c);
- }
- for (int i = 0; i < 16; i++) {
+
+ switch (mMediaSource) {
+#ifdef XP_MACOSX
+ case dom::MediaSourceEnum::Camera:
+ // Mac doesn't support capabilities.
+ //
+ // Hardcode generic desktop capabilities modeled on OSX camera.
+ // Note: Values are empirically picked to be OSX friendly, as on OSX,
+ // values other than these cause the source to not produce.
+
+ if (mHardcodedCapabilities.IsEmpty()) {
+ for (int i = 0; i < 9; i++) {
+ webrtc::CaptureCapability c;
+ c.width = 1920 - i*128;
+ c.height = 1080 - i*72;
+ c.maxFPS = 30;
+ mHardcodedCapabilities.AppendElement(c);
+ }
+ for (int i = 0; i < 16; i++) {
+ webrtc::CaptureCapability c;
+ c.width = 640 - i*40;
+ c.height = 480 - i*30;
+ c.maxFPS = 30;
+ mHardcodedCapabilities.AppendElement(c);
+ }
+ }
+ break;
+#endif
+ default:
+ // The default for devices that don't return discrete capabilities: treat
+ // them as supporting all capabilities orthogonally. E.g. screensharing.
webrtc::CaptureCapability c;
- c.width = 640 - i*40;
- c.height = 480 - i*30;
- c.maxFPS = 30;
+ c.width = 0; // 0 = accept any value
+ c.height = 0;
+ c.maxFPS = 0;
mHardcodedCapabilities.AppendElement(c);
- }
+ break;
}
return mHardcodedCapabilities.Length();
}
1 change: 0 additions & 1 deletion browser/base/content/aboutDialog.css
Expand Up @@ -32,7 +32,6 @@

#distribution,
#distributionId {
font-weight: bold;
display: none;
margin-top: 0;
margin-bottom: 0;
Expand Down
11 changes: 11 additions & 0 deletions testing/runtimes/README.md
@@ -0,0 +1,11 @@
Test Runtimes
=============

These files contain test runtimes for various suites across different platforms. Each JSON file
corresponds to a single test job in production and has the following format:

{ '<test id>': <average runtime> }

These files are being used to normalize chunk durations so all chunks take roughly the same length
of time. They are still experimental and their format and/or file structure are subject to change
without notice.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions testing/runtimes/moz.build
@@ -0,0 +1,9 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

TEST_HARNESS_FILES.testing.mochitest.runtimes += [
'**/mochitest-*.runtimes.json',
]

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions toolkit/toolkit.mozbuild
Expand Up @@ -183,6 +183,7 @@ if CONFIG['ENABLE_TESTS']:
'/testing/profiles',
'/testing/mozbase',
'/testing/modules',
'/testing/runtimes',
'/testing/web-platform',
]

Expand Down

0 comments on commit 9837c79

Please sign in to comment.