content/media/test/test_access_control.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/media/test/test_access_control.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,52 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=451958
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 451958</title>
    1.11 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.12 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.13 +  <script type="text/javascript" src="manifest.js"></script>
    1.14 +</head>
    1.15 +<body>
    1.16 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=451958">Mozilla Bug 451958</a>
    1.17 +<p id="display"></p>
    1.18 +<div id="content" style="display: none">
    1.19 +</div>
    1.20 +<pre id="test">
    1.21 +<script type="application/javascript">
    1.22 +
    1.23 +/** Test for Bug 451958 **/
    1.24 +
    1.25 +function run() {
    1.26 +  window.open("http://example.org:80/tests/content/media/test/file_access_controls.html", "", "width=500,height=500");
    1.27 +}
    1.28 +
    1.29 +function done() {
    1.30 +  mediaTestCleanup();
    1.31 +  SimpleTest.finish();
    1.32 +}
    1.33 +
    1.34 +addLoadEvent(run);
    1.35 +SimpleTest.waitForExplicitFinish();
    1.36 +
    1.37 +
    1.38 +window.addEventListener("message", receiveMessage, false);
    1.39 +
    1.40 +function receiveMessage(event)
    1.41 +{
    1.42 +  if (event.origin !== "http://example.org") {
    1.43 +    ok(false, "Received message from wrong domain");
    1.44 +    return;
    1.45 +  }
    1.46 +
    1.47 +  if (event.data.done == "true")
    1.48 +    return done();
    1.49 +
    1.50 +  ok(event.data.result, event.data.message);
    1.51 +}
    1.52 +</script>
    1.53 +</pre>
    1.54 +</body>
    1.55 +</html>

mercurial