mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-12 22:28:59 +02:00
From 7bb0fbba24f4f65d3fa83efe223b1431cd71fdb6 Mon Sep 17 00:00:00 2001 --- dom/apps/tests/test_third_party_homescreen.html | 8 +- .../test/test_messagemanager_assertpermission.html | 4 +- dom/base/test/test_messagemanager_targetchain.html | 16 +-- ...rowserElement_AllowEmbedAppsInNestedOOIframe.js | 11 +- .../mochitest/browserElement_CopyPaste.js | 9 +- .../browserElement_DisallowEmbedAppsInOOP.js | 9 +- .../mochitest/browserElement_Proxy.js | 10 +- .../browserElement_SetInputMethodActive.js | 3 +- .../mochitest/browserElement_SetVisibleFrames.js | 17 ++-- .../mochitest/browserElement_SetVisibleFrames2.js | 16 +-- .../priority/test_ExpectingSystemMessage2.html | 16 +-- .../mochitest/priority/test_NestedFrames.html | 16 +-- dom/cache/test/mochitest/driver.js | 11 +- .../test/mochitest/test_cache_orphaned_body.html | 33 +----- .../test/mochitest/test_cache_orphaned_cache.html | 33 +----- dom/cache/test/mochitest/test_cache_restart.html | 11 +- dom/cache/test/mochitest/test_cache_shrink.html | 33 +----- dom/indexedDB/test/file.js | 12 +-- dom/indexedDB/test/helpers.js | 9 +- dom/indexedDB/test/webapp_clearBrowserData.js | 6 +- dom/inputmethod/mochitest/test_bug1043828.html | 5 +- dom/inputmethod/mochitest/test_bug944397.html | 5 +- .../mochitest/test_focus_blur_manage_events.html | 5 +- .../mochitest/test_input_registry_events.html | 5 +- .../mochitest/test_simple_manage_events.html | 5 +- .../tests/test_permission_for_nested_oop_app.html | 3 +- .../tests/test_permission_for_two_oop_apps.html | 3 +- dom/ipc/tests/test_permission_helper.js | 21 ++-- .../test_permission_when_oop_app_crashes.html | 3 +- dom/tv/test/mochitest/head.js | 5 +- .../test_SpecialPowersPushAppPermissions.html | 14 ++- .../tests/Harness_sanity/test_bug816847.html | 6 +- .../components/SpecialPowersObserver.js | 4 +- .../content/SpecialPowersObserverAPI.js | 24 +---- testing/specialpowers/content/specialpowersAPI.js | 111 ++++++++------------- 35 files changed, 173 insertions(+), 329 deletions(-)
80 lines
3 KiB
HTML
80 lines
3 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<!--
|
|
Test changing the visibility of an <iframe mozbrowser> changes the visibility
|
|
(and thus the priority) of any <iframe mozbrowser>s it contains.
|
|
-->
|
|
<head>
|
|
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<script type="application/javascript" src="../browserElementTestHelpers.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
</head>
|
|
<body>
|
|
|
|
<script type="application/javascript;version=1.7">
|
|
"use strict";
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
browserElementTestHelpers.setEnabledPref(true);
|
|
browserElementTestHelpers.addPermission();
|
|
browserElementTestHelpers.enableProcessPriorityManager();
|
|
|
|
// Give our origin permission to open browsers, and remove it when the test is complete.
|
|
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
|
SpecialPowers.addPermission("browser", true, {url: SpecialPowers.wrap(principal.URI).spec,
|
|
originAttributes: {
|
|
appId: principal.appId,
|
|
inBrowser: true
|
|
}});
|
|
|
|
addEventListener('unload', function() {
|
|
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
|
SpecialPowers.removePermission("browser", {url: SpecialPowers.wrap(principal.URI).spec,
|
|
originAttributes: {
|
|
appId: principal.appId,
|
|
inBrowser: true
|
|
}});
|
|
});
|
|
|
|
function runTest() {
|
|
// Set up the following hierarchy of frames:
|
|
//
|
|
// <iframe mozbrowser remote=false src='file_NestedFramesOuter.html'>
|
|
// <iframe mozbrowser remote=true src='file_empty.html'>
|
|
//
|
|
// When we change the visibility of the outer iframe, it should change the
|
|
// priority of the inner one.
|
|
|
|
var iframe = document.createElement('iframe');
|
|
iframe.setAttribute('mozbrowser', true);
|
|
iframe.setAttribute('remote', false);
|
|
iframe.src = 'file_NestedFramesOuter.html#' + browserElementTestHelpers.emptyPage1;
|
|
|
|
// Note that this is the process corresponding to the /inner/ iframe. The
|
|
// outer iframe runs in-process (because it has remote=false).
|
|
var childID = null;
|
|
Promise.all(
|
|
[expectOnlyOneProcessCreated('FOREGROUND').then(function(child) {
|
|
childID = child;
|
|
}),
|
|
expectMozbrowserEvent(iframe, 'loadend')]
|
|
).then(function() {
|
|
// Send the outer iframe into the background. This should change the
|
|
// priority of the inner frame's process to BACKGROUND.
|
|
var p = expectPriorityChange(childID, 'BACKGROUND');
|
|
iframe.setVisible(false);
|
|
return p;
|
|
}).then(function() {
|
|
var p = expectPriorityChange(childID, 'FOREGROUND');
|
|
iframe.setVisible(true);
|
|
return p;
|
|
}).then(SimpleTest.finish);
|
|
|
|
document.body.appendChild(iframe);
|
|
}
|
|
|
|
addEventListener('testready', runTest);
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|