dom/browser-element/mochitest/test_browserElement_NoAttr.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/browser-element/mochitest/test_browserElement_NoAttr.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,46 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=710231
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 710231</title>
    1.11 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.12 +  <script type="application/javascript" src="browserElementTestHelpers.js"></script>
    1.13 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.14 +</head>
    1.15 +<body>
    1.16 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=710231">Mozilla Bug 710231</a>
    1.17 +
    1.18 +<!--
    1.19 +  Test that an iframe without the |mozbrowser| attribute does not emit
    1.20 +  mozbrowserX events.
    1.21 +-->
    1.22 +
    1.23 +<script type="application/javascript;version=1.7">
    1.24 +"use strict";
    1.25 +
    1.26 +SimpleTest.waitForExplicitFinish();
    1.27 +
    1.28 +function runTest() {
    1.29 +  var iframe = document.getElementById('iframe');
    1.30 +  iframe.addEventListener('mozbrowserloadstart', function() {
    1.31 +    ok(false, 'Should not send mozbrowserloadstart event.');
    1.32 +  });
    1.33 +
    1.34 +  iframe.addEventListener('load', function() {
    1.35 +    ok(true, 'Got iframe load event.');
    1.36 +    SimpleTest.finish();
    1.37 +  });
    1.38 +
    1.39 +  iframe.src = browserElementTestHelpers.emptyPage1;
    1.40 +}
    1.41 +
    1.42 +addEventListener('load', function() { SimpleTest.executeSoon(runTest); });
    1.43 +
    1.44 +</script>
    1.45 +
    1.46 +<iframe id='iframe'></iframe>
    1.47 +
    1.48 +</body>
    1.49 +</html>

mercurial