mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-17 22:32:51 +00:00
Bug 1120222 - Part 2 - Add tests r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D102797
This commit is contained in:
parent
11d4046786
commit
92dd73d18c
@ -22,6 +22,7 @@ support-files =
|
||||
[test_bug945152.html]
|
||||
[test_bug1008126.html]
|
||||
[test_bug1016960.html]
|
||||
[test_bug1120222.html]
|
||||
[test_anchor_target_blank_referrer.html]
|
||||
[test_domrequesthelper.xhtml]
|
||||
[test_fragment_sanitization.xhtml]
|
||||
|
31
dom/base/test/test_bug1120222.html
Normal file
31
dom/base/test/test_bug1120222.html
Normal file
@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1120222
|
||||
-->
|
||||
<head>
|
||||
<meta charset=utf-8>
|
||||
<title>Test document-title-changed observer</title>
|
||||
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
const obsSvc = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
|
||||
|
||||
const observer = {
|
||||
observe: (aSubject, aTopic, aData) => {
|
||||
if (aTopic === "document-title-changed") {
|
||||
SimpleTest.ok(true, "document-title-changed was received.");
|
||||
obsSvc.removeObserver(observer, "document-title-changed");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
obsSvc.addObserver(observer, "document-title-changed");
|
||||
document.title = "Changed title";
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -88,6 +88,9 @@ static char const* cubeb_mock_get_backend_id(cubeb* context);
|
||||
|
||||
static int cubeb_mock_stream_set_volume(cubeb_stream* stream, float volume);
|
||||
|
||||
static int cubeb_mock_stream_set_name(cubeb_stream* stream,
|
||||
char const* stream_name);
|
||||
|
||||
static int cubeb_mock_get_min_latency(cubeb* context,
|
||||
cubeb_stream_params params,
|
||||
uint32_t* latency_ms);
|
||||
@ -113,7 +116,7 @@ cubeb_ops const mock_ops = {
|
||||
/*.stream_get_latency =*/NULL,
|
||||
/*.stream_get_input_latency =*/NULL,
|
||||
/*.stream_set_volume =*/cubeb_mock_stream_set_volume,
|
||||
/*.stream_set_name =*/NULL,
|
||||
/*.stream_set_name =*/cubeb_mock_stream_set_name,
|
||||
/*.stream_get_current_device =*/NULL,
|
||||
/*.stream_device_destroy =*/NULL,
|
||||
/*.stream_register_device_changed_callback =*/NULL,
|
||||
@ -443,6 +446,11 @@ static int cubeb_mock_stream_set_volume(cubeb_stream* stream, float volume) {
|
||||
return CUBEB_OK;
|
||||
}
|
||||
|
||||
static int cubeb_mock_stream_set_name(cubeb_stream* stream,
|
||||
char const* stream_name) {
|
||||
return CUBEB_OK;
|
||||
}
|
||||
|
||||
int cubeb_mock_get_min_latency(cubeb* context, cubeb_stream_params params,
|
||||
uint32_t* latency_ms) {
|
||||
*latency_ms = 10;
|
||||
|
@ -746,6 +746,7 @@ skip-if = (android_version == '25' && debug) # android(bug 1232305)
|
||||
[test_bug919265.html]
|
||||
skip-if = (android_version == '25' && debug) # android(bug 1232305)
|
||||
[test_bug1113600.html]
|
||||
[test_bug1120222.html]
|
||||
tags=capturestream
|
||||
[test_bug1242338.html]
|
||||
[test_bug1248229.html]
|
||||
|
42
dom/media/test/test_bug1120222.html
Normal file
42
dom/media/test/test_bug1120222.html
Normal file
@ -0,0 +1,42 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1120222
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 1120222</title>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<script type="text/javascript" src="manifest.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
var manager = new MediaTestManager;
|
||||
|
||||
let count = 0;
|
||||
|
||||
function startTest(test, token) {
|
||||
manager.started(token);
|
||||
var elemType = /^audio/.test(test.type) ? "audio" : "video";
|
||||
var v = document.createElement(elemType);
|
||||
v.token = token;
|
||||
v.src = test.name;
|
||||
|
||||
v.addEventListener("play", (e) => {
|
||||
document.title = `Test Title ${count++}`;
|
||||
ok(true, "changed title while media was playing")
|
||||
removeNodeAndSource(e.target);
|
||||
manager.finished(e.target.token);
|
||||
});
|
||||
|
||||
document.body.appendChild(v);
|
||||
v.play();
|
||||
}
|
||||
|
||||
manager.runTests(gSmallTests, startTest);
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user