dom/browser-element/mochitest/priority/test_Simple.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/browser-element/mochitest/priority/test_Simple.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,50 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +A simple test of the process priority manager.
     1.8 +
     1.9 +https://bugzilla.mozilla.org/show_bug.cgi?id=844323
    1.10 +
    1.11 +Note: If you run this test alone (i.e. not as part of the larger mochitest
    1.12 +suite), you may see some IPC assertions, e.g. "Can't allocate graphics
    1.13 +resources."
    1.14 +
    1.15 +What appears to be happening is that we close the Firefox window before the
    1.16 +frame we create in this tab finishes starting up.  Then the frame finishes
    1.17 +loading, and it tries to show itself.  But it's too late to show a remote frame
    1.18 +at that point, so we kill the child process.
    1.19 +
    1.20 +In other words, I think these errors are nothing to worry about.
    1.21 +-->
    1.22 +<head>
    1.23 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.24 +  <script type="application/javascript" src="../browserElementTestHelpers.js"></script>
    1.25 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.26 +</head>
    1.27 +<body>
    1.28 +
    1.29 +<script type="application/javascript;version=1.7">
    1.30 +"use strict";
    1.31 +
    1.32 +SimpleTest.waitForExplicitFinish();
    1.33 +browserElementTestHelpers.setEnabledPref(true);
    1.34 +browserElementTestHelpers.addPermission();
    1.35 +browserElementTestHelpers.enableProcessPriorityManager();
    1.36 +
    1.37 +function runTest() {
    1.38 +  var iframe = document.createElement('iframe');
    1.39 +  iframe.setAttribute('mozbrowser', true);
    1.40 +  iframe.src = browserElementTestHelpers.emptyPage1;
    1.41 +
    1.42 +  expectProcessCreated().then(function(childID) {
    1.43 +    return expectPriorityChange(childID, 'FOREGROUND');
    1.44 +  }).then(SimpleTest.finish);
    1.45 +
    1.46 +  document.body.appendChild(iframe);
    1.47 +}
    1.48 +
    1.49 +addEventListener('testready', runTest);
    1.50 +
    1.51 +</script>
    1.52 +</body>
    1.53 +</html>

mercurial