Modified: trunk/LayoutTests/http/tests/media/media-stream/get-display-media-prompt-expected.txt (256840 => 256841)
--- trunk/LayoutTests/http/tests/media/media-stream/get-display-media-prompt-expected.txt 2020-02-18 18:39:55 UTC (rev 256840)
+++ trunk/LayoutTests/http/tests/media/media-stream/get-display-media-prompt-expected.txt 2020-02-18 18:58:04 UTC (rev 256841)
@@ -6,10 +6,9 @@
PASS numberOfTimesGetUserMediaPromptHasBeenCalled() is 0
** Request an audio-only stream, the user should not be prompted **
-PASS numberOfTimesGetUserMediaPromptHasBeenCalled() is 0
-PASS stream is undefined.
-PASS err instanceof Error is true
-PASS err.name is "TypeError"
+PASS numberOfTimesGetUserMediaPromptHasBeenCalled() is 1
+PASS stream.getAudioTracks().length is 0
+PASS stream.getVideoTracks().length is 1
** Request an video-only stream, the user should be prompted **
PASS numberOfTimesGetUserMediaPromptHasBeenCalled() is 1
@@ -17,35 +16,35 @@
PASS stream.getVideoTracks().length is 1
** Request a stream with audio and video, the user should be prompted but no audio track should be created **
-PASS numberOfTimesGetUserMediaPromptHasBeenCalled() is 2
+PASS numberOfTimesGetUserMediaPromptHasBeenCalled() is 1
PASS stream.getAudioTracks().length is 0
PASS stream.getVideoTracks().length is 1
** Request a stream with 'max' constraints, the user should not be prompted **
-PASS numberOfTimesGetUserMediaPromptHasBeenCalled() is 2
+PASS numberOfTimesGetUserMediaPromptHasBeenCalled() is 0
PASS stream is undefined.
PASS err instanceof Error is true
PASS err.name is "TypeError"
** Request a stream with 'min' constraints, the user should not be prompted **
-PASS numberOfTimesGetUserMediaPromptHasBeenCalled() is 2
+PASS numberOfTimesGetUserMediaPromptHasBeenCalled() is 0
PASS stream is undefined.
PASS err instanceof Error is true
PASS err.name is "TypeError"
** Request a stream with 'advanced' constraints, the user should not be prompted **
-PASS numberOfTimesGetUserMediaPromptHasBeenCalled() is 2
+PASS numberOfTimesGetUserMediaPromptHasBeenCalled() is 0
PASS stream is undefined.
PASS err instanceof Error is true
PASS err.name is "TypeError"
** Request a stream with valid constraints, the user should be prompted **
-PASS numberOfTimesGetUserMediaPromptHasBeenCalled() is 3
+PASS numberOfTimesGetUserMediaPromptHasBeenCalled() is 1
PASS stream.getAudioTracks().length is 0
PASS stream.getVideoTracks().length is 1
** Request a stream with an exact audio constraint, it should be ignored **
-PASS numberOfTimesGetUserMediaPromptHasBeenCalled() is 4
+PASS numberOfTimesGetUserMediaPromptHasBeenCalled() is 1
PASS stream.getAudioTracks().length is 0
PASS stream.getVideoTracks().length is 1
Modified: trunk/LayoutTests/http/tests/media/media-stream/get-display-media-prompt.html (256840 => 256841)
--- trunk/LayoutTests/http/tests/media/media-stream/get-display-media-prompt.html 2020-02-18 18:39:55 UTC (rev 256840)
+++ trunk/LayoutTests/http/tests/media/media-stream/get-display-media-prompt.html 2020-02-18 18:58:04 UTC (rev 256841)
@@ -27,16 +27,16 @@
async function promptForAudioOnly() {
debug("<br>** Request an audio-only stream, the user should not be prompted **");
- stream = await callGetDisplayMedia({ audio: true })
- .catch((e) => { err = e; });
- shouldBe("numberOfTimesGetUserMediaPromptHasBeenCalled()", "0");
- shouldBeUndefined("stream");
- shouldBeTrue("err instanceof Error ");
- shouldBeEqualToString("err.name", "TypeError");
+ testRunner.resetUserMediaPermissionRequestCountForOrigin(document.location.href, document.location.href);
+ stream = await callGetDisplayMedia({ audio: true });
+ shouldBe("numberOfTimesGetUserMediaPromptHasBeenCalled()", "1");
+ shouldBe("stream.getAudioTracks().length", "0");
+ shouldBe("stream.getVideoTracks().length", "1");
}
async function promptForVideoOnly() {
debug("<br>** Request an video-only stream, the user should be prompted **");
+ testRunner.resetUserMediaPermissionRequestCountForOrigin(document.location.href, document.location.href);
stream = await callGetDisplayMedia({ video: true });
shouldBe("numberOfTimesGetUserMediaPromptHasBeenCalled()", "1");
shouldBe("stream.getAudioTracks().length", "0");
@@ -45,8 +45,9 @@
async function promptForAudioAndVideo() {
debug("<br>** Request a stream with audio and video, the user should be prompted but no audio track should be created **");
+ testRunner.resetUserMediaPermissionRequestCountForOrigin(document.location.href, document.location.href);
stream = await callGetDisplayMedia({ video: true, audio: true });
- shouldBe("numberOfTimesGetUserMediaPromptHasBeenCalled()", "2");
+ shouldBe("numberOfTimesGetUserMediaPromptHasBeenCalled()", "1");
shouldBe("stream.getAudioTracks().length", "0");
shouldBe("stream.getVideoTracks().length", "1");
}
@@ -54,11 +55,12 @@
async function promptWithExactVideoConstraints() {
debug("<br>** Request a stream with 'max' constraints, the user should not be prompted **");
+ testRunner.resetUserMediaPermissionRequestCountForOrigin(document.location.href, document.location.href);
stream = null;
stream = await callGetDisplayMedia({ video: {width: {exact: 640}, height: {exact: 480}} })
.catch((e) => { err = e; });
- shouldBe("numberOfTimesGetUserMediaPromptHasBeenCalled()", "2");
+ shouldBe("numberOfTimesGetUserMediaPromptHasBeenCalled()", "0");
shouldBeUndefined("stream");
shouldBeTrue("err instanceof Error ");
shouldBeEqualToString("err.name", "TypeError");
@@ -67,10 +69,11 @@
async function promptWithMinVideoConstraints() {
debug("<br>** Request a stream with 'min' constraints, the user should not be prompted **");
+ testRunner.resetUserMediaPermissionRequestCountForOrigin(document.location.href, document.location.href);
stream = null;
stream = await callGetDisplayMedia({ video: {width: {min: 640}, height: {min: 480}} })
.catch((e) => { err = e; });
- shouldBe("numberOfTimesGetUserMediaPromptHasBeenCalled()", "2");
+ shouldBe("numberOfTimesGetUserMediaPromptHasBeenCalled()", "0");
shouldBeUndefined("stream");
shouldBeTrue("err instanceof Error ");
shouldBeEqualToString("err.name", "TypeError");
@@ -79,10 +82,11 @@
async function promptWithAdvancedVideoConstraints() {
debug("<br>** Request a stream with 'advanced' constraints, the user should not be prompted **");
+ testRunner.resetUserMediaPermissionRequestCountForOrigin(document.location.href, document.location.href);
stream = null;
stream = await callGetDisplayMedia({ video: { width: 640, height: 480, advanced: [ { width: 1920, height: 1280 } ] } })
.catch((e) => { err = e; });
- shouldBe("numberOfTimesGetUserMediaPromptHasBeenCalled()", "2");
+ shouldBe("numberOfTimesGetUserMediaPromptHasBeenCalled()", "0");
shouldBeUndefined("stream");
shouldBeTrue("err instanceof Error ");
shouldBeEqualToString("err.name", "TypeError");
@@ -91,11 +95,12 @@
async function promptWithValidVideoConstraints() {
debug("<br>** Request a stream with valid constraints, the user should be prompted **");
+ testRunner.resetUserMediaPermissionRequestCountForOrigin(document.location.href, document.location.href);
stream = null;
stream = await callGetDisplayMedia({ video: {width: 640, height: 480} })
.catch((e) => { err = e; });
- shouldBe("numberOfTimesGetUserMediaPromptHasBeenCalled()", "3");
+ shouldBe("numberOfTimesGetUserMediaPromptHasBeenCalled()", "1");
shouldBe("stream.getAudioTracks().length", "0");
shouldBe("stream.getVideoTracks().length", "1");
}
@@ -103,9 +108,10 @@
async function promptWithInvalidAudioConstraint() {
debug("<br>** Request a stream with an exact audio constraint, it should be ignored **");
+ testRunner.resetUserMediaPermissionRequestCountForOrigin(document.location.href, document.location.href);
stream = null;
stream = await callGetDisplayMedia({ video: true, audio: { volume: { exact: 0.5 } } });
- shouldBe("numberOfTimesGetUserMediaPromptHasBeenCalled()", "4");
+ shouldBe("numberOfTimesGetUserMediaPromptHasBeenCalled()", "1");
shouldBe("stream.getAudioTracks().length", "0");
shouldBe("stream.getVideoTracks().length", "1");
}