diff --git a/config/writemozinfo.py b/config/writemozinfo.py index d5ddc8557a9..3a131e6ec67 100755 --- a/config/writemozinfo.py +++ b/config/writemozinfo.py @@ -65,6 +65,9 @@ def build_dict(env=os.environ): # crashreporter d["crashreporter"] = 'MOZ_CRASHREPORTER' in env and env['MOZ_CRASHREPORTER'] == '1' + + # per-window private browsing + d["perwindowprivatebrowsing"] = 'MOZ_PER_WINDOW_PRIVATE_BROWSING' in env and env['MOZ_PER_WINDOW_PRIVATE_BROWSING'] == '1' return d #TODO: replace this with the json module when Python >= 2.6 is a requirement. diff --git a/configure.in b/configure.in index dadb9e9bef8..d8b471ef080 100644 --- a/configure.in +++ b/configure.in @@ -8885,6 +8885,7 @@ MOZ_DEBUG=${MOZ_DEBUG} \ MOZ_WIDGET_TOOLKIT=${MOZ_WIDGET_TOOLKIT} \ UNIVERSAL_BINARY=${UNIVERSAL_BINARY} \ MOZ_CRASHREPORTER=${MOZ_CRASHREPORTER} \ +MOZ_PER_WINDOW_PRIVATE_BROWSING=${MOZ_PER_WINDOW_PRIVATE_BROWSING} \ $PYTHON ${_topsrcdir}/config/writemozinfo.py ./mozinfo.json.tmp if cmp -s ./mozinfo.json.tmp ./mozinfo.json; then rm ./mozinfo.json.tmp diff --git a/content/media/gstreamer/Makefile.in b/content/media/gstreamer/Makefile.in index 90d7f4e12b4..806dd6c4869 100644 --- a/content/media/gstreamer/Makefile.in +++ b/content/media/gstreamer/Makefile.in @@ -17,6 +17,7 @@ LIBXUL_LIBRARY = 1 EXPORTS += \ GStreamerDecoder.h \ + GStreamerReader.h \ $(NULL) CPPSRCS = \ diff --git a/content/media/ogg/Makefile.in b/content/media/ogg/Makefile.in index 056cdb9b320..76cf22507d9 100644 --- a/content/media/ogg/Makefile.in +++ b/content/media/ogg/Makefile.in @@ -18,6 +18,7 @@ LIBXUL_LIBRARY = 1 EXPORTS += \ OggDecoder.h \ OggCodecState.h \ + OggReader.h \ $(NULL) CPPSRCS = \ diff --git a/content/media/omx/Makefile.in b/content/media/omx/Makefile.in index 78cb00f703b..c439db803b1 100644 --- a/content/media/omx/Makefile.in +++ b/content/media/omx/Makefile.in @@ -15,6 +15,7 @@ LIBXUL_LIBRARY = 1 EXPORTS += \ MediaOmxDecoder.h \ + MediaOmxReader.h \ $(NULL) CPPSRCS = \ diff --git a/content/media/plugins/Makefile.in b/content/media/plugins/Makefile.in index 8bee356266c..dc3d5839e9b 100644 --- a/content/media/plugins/Makefile.in +++ b/content/media/plugins/Makefile.in @@ -17,6 +17,7 @@ EXPORTS += \ MPAPI.h \ MediaPluginHost.h \ MediaPluginDecoder.h \ + MediaPluginReader.h \ $(NULL) CPPSRCS = \ diff --git a/content/media/wave/Makefile.in b/content/media/wave/Makefile.in index 0e3266416b5..8c8adfa2195 100644 --- a/content/media/wave/Makefile.in +++ b/content/media/wave/Makefile.in @@ -17,6 +17,7 @@ LIBXUL_LIBRARY = 1 EXPORTS += \ WaveDecoder.h \ + WaveReader.h \ $(NULL) CPPSRCS = \ diff --git a/content/media/webm/Makefile.in b/content/media/webm/Makefile.in index 00c01209e11..7464c80f93a 100644 --- a/content/media/webm/Makefile.in +++ b/content/media/webm/Makefile.in @@ -17,6 +17,7 @@ LIBXUL_LIBRARY = 1 EXPORTS += \ WebMDecoder.h \ + WebMReader.h \ $(NULL) CPPSRCS = \ diff --git a/dom/imptests/testharnessreport.js b/dom/imptests/testharnessreport.js index 7e2ed31abb7..ecd218f8f35 100644 --- a/dom/imptests/testharnessreport.js +++ b/dom/imptests/testharnessreport.js @@ -197,7 +197,7 @@ var W3CTest = { add_completion_callback(W3CTest.finish.bind(W3CTest)); setup({ "output": false, - "timeout": 1000000 + "explicit_timeout": true }); } catch (e) { W3CTest.logFailure("Unexpected exception: " + e); diff --git a/dom/telephony/test/marionette/manifest.ini b/dom/telephony/test/marionette/manifest.ini index a5e0c680be0..aaf8bb854c7 100644 --- a/dom/telephony/test/marionette/manifest.ini +++ b/dom/telephony/test/marionette/manifest.ini @@ -36,4 +36,5 @@ disabled = Bug 806138 [test_incoming_onstatechange.js] [test_outgoing_onstatechange.js] [test_redundant_operations.js] +[test_multiple_hold.js] diff --git a/dom/telephony/test/marionette/test_multiple_hold.js b/dom/telephony/test/marionette/test_multiple_hold.js new file mode 100644 index 00000000000..888ad95ca72 --- /dev/null +++ b/dom/telephony/test/marionette/test_multiple_hold.js @@ -0,0 +1,289 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +MARIONETTE_TIMEOUT = 15000; + +SpecialPowers.addPermission("telephony", true, document); + +let telephony = window.navigator.mozTelephony; +let inNumber = "5555551111"; +let outNumber = "5555552222"; +let incomingCall; +let outgoingCall; + +function verifyInitialState() { + log("Verifying initial state."); + ok(telephony); + is(telephony.active, null); + ok(telephony.calls); + is(telephony.calls.length, 0); + + runEmulatorCmd("gsm list", function(result) { + log("Initial call list: " + result); + is(result[0], "OK"); + simulateIncoming(); + }); +} + +function simulateIncoming() { + log("Simulating an incoming call."); + + telephony.onincoming = function onincoming(event) { + log("Received 'incoming' call event."); + incomingCall = event.call; + ok(incomingCall); + is(incomingCall.number, inNumber); + is(incomingCall.state, "incoming"); + + is(telephony.calls.length, 1); + is(telephony.calls[0], incomingCall); + + runEmulatorCmd("gsm list", function(result) { + log("Call list is now: " + result); + is(result[0], "inbound from " + inNumber + " : incoming"); + is(result[1], "OK"); + answerIncoming(); + }); + }; + runEmulatorCmd("gsm call " + inNumber); +} + +function answerIncoming() { + log("Answering the incoming call."); + + let gotConnecting = false; + incomingCall.onconnecting = function onconnectingIn(event) { + log("Received 'connecting' call event for original (incoming) call."); + is(incomingCall, event.call); + is(incomingCall.state, "connecting"); + gotConnecting = true; + }; + + incomingCall.onconnected = function onconnectedIn(event) { + log("Received 'connected' call event for original (incoming) call."); + is(incomingCall, event.call); + is(incomingCall.state, "connected"); + ok(gotConnecting); + is(incomingCall, telephony.active); + + runEmulatorCmd("gsm list", function(result) { + log("Call list is now: " + result); + is(result[0], "inbound from " + inNumber + " : active"); + is(result[1], "OK"); + holdCall(); + }); + }; + incomingCall.answer(); +} + +// Put the original (incoming) call on hold +function holdCall() { + log("Putting the original (incoming) call on hold."); + + let gotHolding = false; + incomingCall.onholding = function onholding(event) { + log("Received 'holding' call event"); + is(incomingCall, event.call); + is(incomingCall.state, "holding"); + gotHolding = true; + }; + + incomingCall.onheld = function onheld(event) { + log("Received 'held' call event"); + is(incomingCall, event.call); + is(incomingCall.state, "held"); + ok(gotHolding); + + is(telephony.active, null); + is(telephony.calls.length, 1); + is(telephony.calls[0], incomingCall); + + runEmulatorCmd("gsm list", function(result) { + log("Call list is now: " + result); + is(result[0], "inbound from " + inNumber + " : held"); + is(result[1], "OK"); + dial(); + }); + }; + incomingCall.hold(); +} + +// With one call on hold, make outgoing call +function dial() { + log("Making an outgoing call (while have one call already held)."); + + outgoingCall = telephony.dial(outNumber); + ok(outgoingCall); + is(outgoingCall.number, outNumber); + is(outgoingCall.state, "dialing"); + is(outgoingCall, telephony.active); + is(telephony.calls.length, 2); + is(telephony.calls[0], incomingCall); + is(telephony.calls[1], outgoingCall); + + outgoingCall.onalerting = function onalerting(event) { + log("Received 'onalerting' call event."); + is(outgoingCall, event.call); + is(outgoingCall.state, "alerting"); + + runEmulatorCmd("gsm list", function(result) { + log("Call list is now: " + result); + is(result[0], "inbound from " + inNumber + " : held"); + is(result[1], "outbound to " + outNumber + " : ringing"); + is(result[2], "OK"); + answerOutgoing(); + }); + }; +} + +// Have the outgoing call answered +function answerOutgoing() { + log("Answering the outgoing/2nd call"); + + // We get no "connecting" event when the remote party answers the call. + outgoingCall.onconnected = function onconnectedOut(event) { + log("Received 'connected' call event for outgoing/2nd call."); + is(outgoingCall, event.call); + is(outgoingCall.state, "connected"); + is(outgoingCall, telephony.active); + + runEmulatorCmd("gsm list", function(result) { + log("Call list is now: " + result); + is(result[0], "inbound from " + inNumber + " : held"); + is(result[1], "outbound to " + outNumber + " : active"); + is(result[2], "OK"); + holdSecondCall(); + }); + }; + runEmulatorCmd("gsm accept " + outNumber); +} + +// With one held call and one active, hold the active one; expect the first +// (held) call to automatically become active, and the 2nd call to go on hold +function holdSecondCall() { + let firstCallReconnected = false; + let secondCallHeld = false; + + log("Putting the 2nd (outgoing) call on hold."); + + // Since first call will become connected again, setup handler + incomingCall.onconnected = function onreconnected(event) { + log("Received 'connected' call event for original (incoming) call."); + is(incomingCall, event.call); + is(incomingCall.state, "connected"); + is(incomingCall, telephony.active); + firstCallReconnected = true; + if (firstCallReconnected && secondCallHeld) { + verifyCalls(); + } + }; + + // Handlers for holding 2nd call + let gotHolding = false; + outgoingCall.onholding = function onholdingOut(event) { + log("Received 'holding' call event for 2nd call."); + is(outgoingCall, event.call); + is(outgoingCall.state, "holding"); + gotHolding = true; + }; + + outgoingCall.onheld = function onheldOut(event) { + log("Received 'held' call event for 2nd call."); + is(outgoingCall, event.call); + is(outgoingCall.state, "held"); + ok(gotHolding); + secondCallHeld = true; + if (firstCallReconnected && secondCallHeld) { + verifyCalls(); + } + }; + outgoingCall.hold(); +} + +function verifyCalls() { + is(telephony.active, incomingCall); + is(telephony.calls.length, 2); + is(telephony.calls[0], incomingCall); + is(telephony.calls[1], outgoingCall); + + runEmulatorCmd("gsm list", function(result) { + log("Call list is now: " + result); + is(result[0], "inbound from " + inNumber + " : active"); + is(result[1], "outbound to " + outNumber + " : held"); + is(result[2], "OK"); + hangUpIncoming(); + }); +} + +// Hang-up the original incoming call, which is now active +function hangUpIncoming() { + log("Hanging up the original incoming (now active) call."); + + let gotDisconnecting = false; + incomingCall.ondisconnecting = function ondisconnectingIn(event) { + log("Received 'disconnecting' call event for original (incoming) call."); + is(incomingCall, event.call); + is(incomingCall.state, "disconnecting"); + gotDisconnecting = true; + }; + + incomingCall.ondisconnected = function ondisconnectedIn(event) { + log("Received 'disconnected' call event for original (incoming) call."); + is(incomingCall, event.call); + is(incomingCall.state, "disconnected"); + ok(gotDisconnecting); + + // Now back to one call + is(telephony.active, null); + is(telephony.calls.length, 1); + is(telephony.calls[0], outgoingCall); + + runEmulatorCmd("gsm list", function(result) { + log("Call list is now: " + result); + is(result[0], "outbound to " + outNumber + " : held"); + is(result[1], "OK"); + hangUpOutgoing(); + }); + }; + incomingCall.hangUp(); +} + +// Hang-up the remaining (outgoing) call, which is held +function hangUpOutgoing() { + log("Hanging up the remaining (outgoing) held call."); + + let gotDisconnecting = false; + outgoingCall.ondisconnecting = function ondisconnectingOut(event) { + log("Received 'disconnecting' call event for remaining (outgoing) call."); + is(outgoingCall, event.call); + is(outgoingCall.state, "disconnecting"); + gotDisconnecting = true; + }; + + outgoingCall.ondisconnected = function ondisconnectedOut(event) { + log("Received 'disconnected' call event for remaining (outgoing) call."); + is(outgoingCall, event.call); + is(outgoingCall.state, "disconnected"); + ok(gotDisconnecting); + + // Now no calls + is(telephony.active, null); + is(telephony.calls.length, 0); + + runEmulatorCmd("gsm list", function(result) { + log("Call list is now: " + result); + is(result[0], "OK"); + cleanUp(); + }); + }; + outgoingCall.hangUp(); +} + +function cleanUp() { + telephony.onincoming = null; + SpecialPowers.removePermission("telephony", document); + finish(); +} + +// Start the test +verifyInitialState(); diff --git a/mobile/android/base/GeckoApp.java b/mobile/android/base/GeckoApp.java index e97484f5ab1..d9a344b631a 100644 --- a/mobile/android/base/GeckoApp.java +++ b/mobile/android/base/GeckoApp.java @@ -161,7 +161,6 @@ abstract public class GeckoApp public View getView() { return mGeckoLayout; } public SurfaceView cameraView; public static GeckoApp mAppContext; - public boolean mDOMFullScreen = false; protected MenuPresenter mMenuPresenter; protected MenuPanel mMenuPanel; protected Menu mMenu; @@ -991,9 +990,17 @@ abstract public class GeckoApp } else if (event.equals("ToggleChrome:Focus")) { focusChrome(); } else if (event.equals("DOMFullScreen:Start")) { - mDOMFullScreen = true; + // Local ref to layerView for thread safety + LayerView layerView = mLayerView; + if (layerView != null) { + layerView.setFullScreen(true); + } } else if (event.equals("DOMFullScreen:Stop")) { - mDOMFullScreen = false; + // Local ref to layerView for thread safety + LayerView layerView = mLayerView; + if (layerView != null) { + layerView.setFullScreen(false); + } } else if (event.equals("Permissions:Data")) { String host = message.getString("host"); JSONArray permissions = message.getJSONArray("permissions"); @@ -2504,7 +2511,7 @@ abstract public class GeckoApp return; } - if (mDOMFullScreen) { + if (mLayerView.isFullScreen()) { GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("FullScreen:Exit", null)); return; } diff --git a/mobile/android/base/gfx/GeckoLayerClient.java b/mobile/android/base/gfx/GeckoLayerClient.java index dac50a934c6..19d2a60da33 100644 --- a/mobile/android/base/gfx/GeckoLayerClient.java +++ b/mobile/android/base/gfx/GeckoLayerClient.java @@ -650,6 +650,11 @@ public class GeckoLayerClient return mZoomConstraints; } + /** Implementation of PanZoomTarget */ + public boolean isFullScreen() { + return mView.isFullScreen(); + } + /** Implementation of PanZoomTarget */ public void setAnimationTarget(ImmutableViewportMetrics metrics) { if (mGeckoIsReady) { diff --git a/mobile/android/base/gfx/LayerRenderer.java b/mobile/android/base/gfx/LayerRenderer.java index b16f1fa5bf7..bcc06ab8501 100644 --- a/mobile/android/base/gfx/LayerRenderer.java +++ b/mobile/android/base/gfx/LayerRenderer.java @@ -454,9 +454,9 @@ public class LayerRenderer implements Tabs.OnTabsChangedListener { Layer rootLayer = mView.getLayerClient().getRoot(); - if (!mPageContext.fuzzyEquals(mLastPageContext)) { - // the viewport or page changed, so show the scrollbars again - // as per UX decision + if (!mPageContext.fuzzyEquals(mLastPageContext) && !mView.isFullScreen()) { + // The viewport or page changed, so show the scrollbars again + // as per UX decision. Don't do this if we're in full-screen mode though. mVertScrollLayer.unfade(); mHorizScrollLayer.unfade(); mFadeRunnable.scheduleStartFade(ScrollbarLayer.FADE_DELAY); diff --git a/mobile/android/base/gfx/LayerView.java b/mobile/android/base/gfx/LayerView.java index 095af187584..ea1096edb28 100644 --- a/mobile/android/base/gfx/LayerView.java +++ b/mobile/android/base/gfx/LayerView.java @@ -54,6 +54,7 @@ public class LayerView extends FrameLayout { private int mPaintState; private int mCheckerboardColor; private boolean mCheckerboardShouldShowChecks; + private boolean mFullScreen; private SurfaceView mSurfaceView; private TextureView mTextureView; @@ -426,4 +427,12 @@ public class LayerView extends FrameLayout { super.onFocusChanged(gainFocus, direction, previouslyFocusedRect); GeckoAccessibility.onLayerViewFocusChanged(this, gainFocus); } + + public void setFullScreen(boolean fullScreen) { + mFullScreen = fullScreen; + } + + public boolean isFullScreen() { + return mFullScreen; + } } diff --git a/mobile/android/base/ui/PanZoomController.java b/mobile/android/base/ui/PanZoomController.java index 2f00a5887fb..aa32ba883bb 100644 --- a/mobile/android/base/ui/PanZoomController.java +++ b/mobile/android/base/ui/PanZoomController.java @@ -315,7 +315,8 @@ public class PanZoomController return false; case TOUCHING: - if (panDistance(event) < PAN_THRESHOLD) { + // Don't allow panning if there is an element in full-screen mode. See bug 775511. + if (mTarget.isFullScreen() || panDistance(event) < PAN_THRESHOLD) { return false; } cancelTouch(); @@ -831,7 +832,7 @@ public class PanZoomController @Override public boolean onScale(SimpleScaleGestureDetector detector) { - if (GeckoApp.mAppContext == null || GeckoApp.mAppContext.mDOMFullScreen) + if (mTarget.isFullScreen()) return false; if (mState != PanZoomState.PINCHING) diff --git a/mobile/android/base/ui/PanZoomTarget.java b/mobile/android/base/ui/PanZoomTarget.java index ef8a641bf5e..aa13f3331cd 100644 --- a/mobile/android/base/ui/PanZoomTarget.java +++ b/mobile/android/base/ui/PanZoomTarget.java @@ -13,6 +13,7 @@ import android.graphics.PointF; public interface PanZoomTarget { public ImmutableViewportMetrics getViewportMetrics(); public ZoomConstraints getZoomConstraints(); + public boolean isFullScreen(); public void setAnimationTarget(ImmutableViewportMetrics viewport); public void setViewportMetrics(ImmutableViewportMetrics viewport);