mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 11:26:09 +00:00
Bug 868816 - Remove the notifications for the displayed app when we go out of the lock screen. r=jlebar
This commit is contained in:
parent
8d70ccdda9
commit
dea3562c47
@ -769,7 +769,7 @@ BrowserElementChild.prototype = {
|
||||
var visible = this._forcedVisible && this._ownerVisible;
|
||||
if (docShell.isActive !== visible) {
|
||||
docShell.isActive = visible;
|
||||
sendAsyncMsg('visibility-change', {visible: visible});
|
||||
sendAsyncMsg('visibilitychange', {visible: visible});
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -119,7 +119,7 @@ function BrowserElementParent(frameLoader, hasRemoteFrame) {
|
||||
"rollback-fullscreen": this._remoteFrameFullscreenReverted,
|
||||
"exit-fullscreen": this._exitFullscreen,
|
||||
"got-visible": this._gotDOMRequestResult,
|
||||
"visibility-change": this._childVisibilityChange,
|
||||
"visibilitychange": this._childVisibilityChange,
|
||||
}
|
||||
|
||||
this._mm.addMessageListener('browser-element-api:call', function(aMsg) {
|
||||
@ -576,6 +576,8 @@ BrowserElementParent.prototype = {
|
||||
_childVisibilityChange: function(data) {
|
||||
debug("_childVisibilityChange(" + data.json.visible + ")");
|
||||
this._frameLoader.visible = data.json.visible;
|
||||
|
||||
this._fireEventFromMsg(data);
|
||||
},
|
||||
|
||||
_exitFullscreen: function() {
|
||||
|
@ -160,6 +160,8 @@ MOCHITEST_FILES = \
|
||||
test_browserElement_inproc_PurgeHistory.html \
|
||||
browserElement_DocumentFirstPaint.js \
|
||||
test_browserElement_inproc_DocumentFirstPaint.html \
|
||||
browserElement_VisibilityChange.js \
|
||||
test_browserElement_inproc_VisibilityChange.html \
|
||||
$(NULL)
|
||||
|
||||
# Disabled due to https://bugzilla.mozilla.org/show_bug.cgi?id=774100
|
||||
@ -233,6 +235,7 @@ MOCHITEST_FILES += \
|
||||
test_browserElement_oop_ReloadPostRequest.html \
|
||||
test_browserElement_oop_PurgeHistory.html \
|
||||
test_browserElement_oop_DocumentFirstPaint.html \
|
||||
test_browserElement_oop_VisibilityChange.html \
|
||||
$(NULL)
|
||||
|
||||
endif #}
|
||||
|
@ -0,0 +1,43 @@
|
||||
/* Any copyright is dedicated to the public domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Test that the onmozbrowservisibilitychange event works.
|
||||
'use strict';
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
browserElementTestHelpers.setEnabledPref(true);
|
||||
browserElementTestHelpers.addPermission();
|
||||
|
||||
var iframe1 = null;
|
||||
function runTest() {
|
||||
iframe1 = document.createElement('iframe');
|
||||
SpecialPowers.wrap(iframe1).mozbrowser = true;
|
||||
document.body.appendChild(iframe1);
|
||||
|
||||
iframe1.src = 'data:text/html,<html><head><title>Title</title></head><body></body></html>';
|
||||
checkVisibilityFalse();
|
||||
}
|
||||
|
||||
function checkVisibilityFalse() {
|
||||
iframe1.addEventListener('mozbrowservisibilitychange', function onvisibilitychange(e) {
|
||||
iframe1.removeEventListener(e.type, onvisibilitychange);
|
||||
|
||||
is(e.detail.visible, false, 'Visibility should be false');
|
||||
checkVisibilityTrue();
|
||||
});
|
||||
|
||||
iframe1.setVisible(false);
|
||||
}
|
||||
|
||||
function checkVisibilityTrue() {
|
||||
iframe1.addEventListener('mozbrowservisibilitychange', function onvisibilitychange(e) {
|
||||
iframe1.removeEventListener(e.type, onvisibilitychange);
|
||||
|
||||
is(e.detail.visible, true, 'Visibility should be true');
|
||||
SimpleTest.finish();
|
||||
});
|
||||
|
||||
iframe1.setVisible(true);
|
||||
}
|
||||
|
||||
addEventListener('testready', runTest);
|
@ -0,0 +1,19 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=868816
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 868816</title>
|
||||
<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>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=868816">Mozilla Bug 868816</a>
|
||||
|
||||
<script type="application/javascript;version=1.7" src='browserElement_VisibilityChange.js'>
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,19 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=868816
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 868816</title>
|
||||
<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>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=868816">Mozilla Bug 868816</a>
|
||||
|
||||
<script type="application/javascript;version=1.7" src='browserElement_VisibilityChange.js'>
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user