diff --git a/CLOBBER b/CLOBBER index bfe96ef82ff..13c625b9c9a 100644 --- a/CLOBBER +++ b/CLOBBER @@ -22,5 +22,4 @@ # changes to stick? As of bug 928195, this shouldn't be necessary! Please # don't change CLOBBER for WebIDL changes any more. -Bug 1195388 - Moving location of generated R.java files requires a -clobber. \ No newline at end of file +Bug 1193379 - Moving location of files under dom/bluetooth requires a clobber diff --git a/b2g/config/aries/sources.xml b/b2g/config/aries/sources.xml index 688939b8145..33067f1e763 100644 --- a/b2g/config/aries/sources.xml +++ b/b2g/config/aries/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 50e0d9baac9..37bed501a9f 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 2c18ad41f71..57f6b758beb 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index f44223f5d2d..e3caafecf8c 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 0f4702273c1..a73d7c86e41 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-l/sources.xml b/b2g/config/emulator-l/sources.xml index e09091c4dae..4a63d330850 100644 --- a/b2g/config/emulator-l/sources.xml +++ b/b2g/config/emulator-l/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 2c18ad41f71..57f6b758beb 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 77286abd34f..8ef03879464 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 0b9873f05d0..21adcbac6db 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,9 +1,9 @@ { "git": { - "git_revision": "fa15462b29258fdec8329bfc367e590022dbc9e5", + "git_revision": "7a77326ef8b14ddef4d101efc336d7b26670ef94", "remote": "https://git.mozilla.org/releases/gaia.git", "branch": "" }, - "revision": "b575200962cb9cc340aa6b704b8f1cc1ac680176", + "revision": "6eaf499cb32bdf152ff5bf9f607e896a08b14f9c", "repo_path": "integration/gaia-central" } diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 25702c4cab4..8663930d2ff 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/nexus-5-l/sources.xml b/b2g/config/nexus-5-l/sources.xml index de3eb8ce9aa..7037872e306 100644 --- a/b2g/config/nexus-5-l/sources.xml +++ b/b2g/config/nexus-5-l/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/dom/base/moz.build b/dom/base/moz.build index fc4bae3054e..52120811432 100644 --- a/dom/base/moz.build +++ b/dom/base/moz.build @@ -413,8 +413,8 @@ FAIL_ON_WARNINGS = True LOCAL_INCLUDES += [ '../battery', - '../bluetooth', - '../bluetooth/bluetooth2', + '../bluetooth/common', + '../bluetooth/common/webapi', '../events', '../media', '../network', diff --git a/dom/bindings/moz.build b/dom/bindings/moz.build index 584631143f4..6087a81d64c 100644 --- a/dom/bindings/moz.build +++ b/dom/bindings/moz.build @@ -44,8 +44,7 @@ FAIL_ON_WARNINGS = True LOCAL_INCLUDES += [ '/dom/base', '/dom/battery', - '/dom/bluetooth', - '/dom/bluetooth/bluetooth2', + '/dom/bluetooth/common/webapi', '/dom/camera', '/dom/canvas', '/dom/geolocation', diff --git a/dom/bluetooth/bluedroid/BluetoothPbapManager.cpp b/dom/bluetooth/bluedroid/BluetoothPbapManager.cpp index aee40aa6ad9..6ac9ac7013e 100644 --- a/dom/bluetooth/bluedroid/BluetoothPbapManager.cpp +++ b/dom/bluetooth/bluedroid/BluetoothPbapManager.cpp @@ -12,6 +12,7 @@ #include "BluetoothUuid.h" #include "ObexBase.h" +#include "mozilla/dom/File.h" #include "mozilla/dom/ipc/BlobParent.h" #include "mozilla/RefPtr.h" #include "mozilla/Services.h" diff --git a/dom/bluetooth/bluetooth2/BluetoothRilListener.cpp b/dom/bluetooth/bluetooth2/BluetoothRilListener.cpp deleted file mode 100644 index 06d1c3482e7..00000000000 --- a/dom/bluetooth/bluetooth2/BluetoothRilListener.cpp +++ /dev/null @@ -1,457 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "BluetoothRilListener.h" - -#include "BluetoothHfpManager.h" -#include "nsIIccService.h" -#include "nsIMobileConnectionInfo.h" -#include "nsIMobileConnectionService.h" -#include "nsITelephonyService.h" -#include "nsServiceManagerUtils.h" -#include "nsString.h" -#include "nsQueryObject.h" - -USING_BLUETOOTH_NAMESPACE - -/** - * IccListener - */ -NS_IMPL_ISUPPORTS(IccListener, nsIIccListener) - -NS_IMETHODIMP -IccListener::NotifyIccInfoChanged() -{ - // mOwner would be set to nullptr only in the dtor of BluetoothRilListener - NS_ENSURE_TRUE(mOwner, NS_ERROR_FAILURE); - - BluetoothHfpManager* hfp = BluetoothHfpManager::Get(); - NS_ENSURE_TRUE(hfp, NS_ERROR_FAILURE); - - hfp->HandleIccInfoChanged(mOwner->mClientId); - - return NS_OK; -} - -NS_IMETHODIMP -IccListener::NotifyStkCommand(nsIStkProactiveCmd *aStkProactiveCmd) -{ - return NS_OK; -} - -NS_IMETHODIMP -IccListener::NotifyStkSessionEnd() -{ - return NS_OK; -} - -NS_IMETHODIMP -IccListener::NotifyCardStateChanged() -{ - return NS_OK; -} - -bool -IccListener::Listen(bool aStart) -{ - NS_ENSURE_TRUE(mOwner, false); - - nsCOMPtr service = - do_GetService(ICC_SERVICE_CONTRACTID); - NS_ENSURE_TRUE(service, false); - - nsCOMPtr icc; - service->GetIccByServiceId(mOwner->mClientId, getter_AddRefs(icc)); - NS_ENSURE_TRUE(icc, false); - - nsresult rv; - if (aStart) { - rv = icc->RegisterListener(this); - } else { - rv = icc->UnregisterListener(this); - } - - return NS_SUCCEEDED(rv); -} - -void -IccListener::SetOwner(BluetoothRilListener *aOwner) -{ - mOwner = aOwner; -} - -/** - * MobileConnectionListener - */ -NS_IMPL_ISUPPORTS(MobileConnectionListener, nsIMobileConnectionListener) - -NS_IMETHODIMP -MobileConnectionListener::NotifyVoiceChanged() -{ - BluetoothHfpManager* hfp = BluetoothHfpManager::Get(); - NS_ENSURE_TRUE(hfp, NS_OK); - - hfp->HandleVoiceConnectionChanged(mClientId); - - return NS_OK; -} - -NS_IMETHODIMP -MobileConnectionListener::NotifyDataChanged() -{ - return NS_OK; -} - -NS_IMETHODIMP -MobileConnectionListener::NotifyDataError(const nsAString & message) -{ - return NS_OK; -} - -NS_IMETHODIMP -MobileConnectionListener::NotifyCFStateChanged(uint16_t action, - uint16_t reason, - const nsAString& number, - uint16_t timeSeconds, - uint16_t serviceClass) -{ - return NS_OK; -} - -NS_IMETHODIMP -MobileConnectionListener::NotifyEmergencyCbModeChanged(bool active, - uint32_t timeoutMs) -{ - return NS_OK; -} - -NS_IMETHODIMP -MobileConnectionListener::NotifyOtaStatusChanged(const nsAString & status) -{ - return NS_OK; -} - -NS_IMETHODIMP -MobileConnectionListener::NotifyRadioStateChanged() -{ - return NS_OK; -} - -NS_IMETHODIMP -MobileConnectionListener::NotifyClirModeChanged(uint32_t aMode) -{ - return NS_OK; -} - -NS_IMETHODIMP -MobileConnectionListener::NotifyLastKnownNetworkChanged() -{ - return NS_OK; -} - -NS_IMETHODIMP -MobileConnectionListener::NotifyLastKnownHomeNetworkChanged() -{ - return NS_OK; -} - -NS_IMETHODIMP -MobileConnectionListener::NotifyNetworkSelectionModeChanged() -{ - return NS_OK; -} - -bool -MobileConnectionListener::Listen(bool aStart) -{ - nsCOMPtr service = - do_GetService(NS_MOBILE_CONNECTION_SERVICE_CONTRACTID); - NS_ENSURE_TRUE(service, false); - - nsCOMPtr connection; - service->GetItemByServiceId(mClientId, getter_AddRefs(connection)); - NS_ENSURE_TRUE(connection, false); - - nsresult rv; - if (aStart) { - rv = connection->RegisterListener(this); - } else { - rv = connection->UnregisterListener(this); - } - - return NS_SUCCEEDED(rv); -} - -/** - * TelephonyListener Implementation - */ -NS_IMPL_ISUPPORTS(TelephonyListener, nsITelephonyListener) - -/** - * @param aSend A boolean indicates whether we need to notify headset or not - */ -nsresult -TelephonyListener::HandleCallInfo(nsITelephonyCallInfo* aInfo, bool aSend) -{ - BluetoothHfpManager* hfp = BluetoothHfpManager::Get(); - NS_ENSURE_TRUE(hfp, NS_ERROR_FAILURE); - - uint32_t callIndex; - uint16_t callState; - nsAutoString number; - bool isOutgoing; - bool isConference; - - aInfo->GetCallIndex(&callIndex); - aInfo->GetCallState(&callState); - aInfo->GetNumber(number); - aInfo->GetIsOutgoing(&isOutgoing); - aInfo->GetIsConference(&isConference); - - hfp->HandleCallStateChanged(callIndex, callState, EmptyString(), number, - isOutgoing, isConference, aSend); - return NS_OK; -} - -NS_IMETHODIMP -TelephonyListener::CallStateChanged(uint32_t aLength, - nsITelephonyCallInfo** aAllInfo) -{ - for (uint32_t i = 0; i < aLength; ++i) { - HandleCallInfo(aAllInfo[i], true); - } - return NS_OK; -} - -NS_IMETHODIMP -TelephonyListener::EnumerateCallState(nsITelephonyCallInfo* aInfo) -{ - return HandleCallInfo(aInfo, false); -} - -NS_IMETHODIMP -TelephonyListener::NotifyError(uint32_t aServiceId, - int32_t aCallIndex, - const nsAString& aError) -{ - BluetoothHfpManager* hfp = BluetoothHfpManager::Get(); - NS_ENSURE_TRUE(hfp, NS_ERROR_FAILURE); - - if (aCallIndex > 0) { - // In order to not miss any related call state transition. - // It's possible that 3G network signal lost for unknown reason. - // If a call is released abnormally, NotifyError() will be called, - // instead of CallStateChanged(). We need to reset the call array state - // via setting CALL_STATE_DISCONNECTED - hfp->HandleCallStateChanged(aCallIndex, - nsITelephonyService::CALL_STATE_DISCONNECTED, - aError, EmptyString(), false, false, true); - BT_WARNING("Reset the call state due to call transition ends abnormally"); - } - - BT_WARNING(NS_ConvertUTF16toUTF8(aError).get()); - return NS_OK; -} - -NS_IMETHODIMP -TelephonyListener::ConferenceCallStateChanged(uint16_t aCallState) -{ - return NS_OK; -} - -NS_IMETHODIMP -TelephonyListener::EnumerateCallStateComplete() -{ - return NS_OK; -} - -NS_IMETHODIMP -TelephonyListener::SupplementaryServiceNotification(uint32_t aServiceId, - int32_t aCallIndex, - uint16_t aNotification) -{ - return NS_OK; -} - -NS_IMETHODIMP -TelephonyListener::NotifyConferenceError(const nsAString& aName, - const nsAString& aMessage) -{ - BT_WARNING(NS_ConvertUTF16toUTF8(aName).get()); - BT_WARNING(NS_ConvertUTF16toUTF8(aMessage).get()); - - return NS_OK; -} - -NS_IMETHODIMP -TelephonyListener::NotifyCdmaCallWaiting(uint32_t aServiceId, - const nsAString& aNumber, - uint16_t aNumberPresentation, - const nsAString& aName, - uint16_t aNamePresentation) -{ - BluetoothHfpManager* hfp = BluetoothHfpManager::Get(); - NS_ENSURE_TRUE(hfp, NS_ERROR_FAILURE); - - hfp->UpdateSecondNumber(aNumber); - - return NS_OK; -} - -bool -TelephonyListener::Listen(bool aStart) -{ - nsCOMPtr service = - do_GetService(TELEPHONY_SERVICE_CONTRACTID); - NS_ENSURE_TRUE(service, false); - - nsresult rv; - if (aStart) { - rv = service->RegisterListener(this); - } else { - rv = service->UnregisterListener(this); - } - - return NS_SUCCEEDED(rv); -} - -/** - * BluetoothRilListener - */ -BluetoothRilListener::BluetoothRilListener() -{ - nsCOMPtr service = - do_GetService(NS_MOBILE_CONNECTION_SERVICE_CONTRACTID); - NS_ENSURE_TRUE_VOID(service); - - // Query number of total clients (sim slots) - uint32_t numItems = 0; - if (NS_SUCCEEDED(service->GetNumItems(&numItems))) { - // Init MobileConnectionListener array and IccInfoListener - for (uint32_t i = 0; i < numItems; i++) { - mMobileConnListeners.AppendElement(new MobileConnectionListener(i)); - } - } - - mTelephonyListener = new TelephonyListener(); - mIccListener = new IccListener(); - mIccListener->SetOwner(this); - - // Probe for available client - SelectClient(); -} - -BluetoothRilListener::~BluetoothRilListener() -{ - mIccListener->SetOwner(nullptr); -} - -bool -BluetoothRilListener::Listen(bool aStart) -{ - NS_ENSURE_TRUE(ListenMobileConnAndIccInfo(aStart), false); - NS_ENSURE_TRUE(mTelephonyListener->Listen(aStart), false); - - return true; -} - -void -BluetoothRilListener::SelectClient() -{ - // Reset mClientId - mClientId = mMobileConnListeners.Length(); - - nsCOMPtr service = - do_GetService(NS_MOBILE_CONNECTION_SERVICE_CONTRACTID); - NS_ENSURE_TRUE_VOID(service); - - for (uint32_t i = 0; i < mMobileConnListeners.Length(); i++) { - nsCOMPtr connection; - service->GetItemByServiceId(i, getter_AddRefs(connection)); - if (!connection) { - BT_WARNING("%s: Failed to get mobile connection", __FUNCTION__); - continue; - } - - nsCOMPtr voiceInfo; - connection->GetVoice(getter_AddRefs(voiceInfo)); - if (!voiceInfo) { - BT_WARNING("%s: Failed to get voice connection info", __FUNCTION__); - continue; - } - - nsString regState; - voiceInfo->GetState(regState); - if (regState.EqualsLiteral("registered")) { - // Found available client - mClientId = i; - return; - } - } -} - -void -BluetoothRilListener::ServiceChanged(uint32_t aClientId, bool aRegistered) -{ - // Stop listening - ListenMobileConnAndIccInfo(false); - - /** - * aRegistered: - * - TRUE: service becomes registered. We were listening to all clients - * and one of them becomes available. Select it to listen. - * - FALSE: service becomes un-registered. The client we were listening - * becomes unavailable. Select another registered one to listen. - */ - if (aRegistered) { - mClientId = aClientId; - } else { - SelectClient(); - } - - // Restart listening - ListenMobileConnAndIccInfo(true); - - BT_LOGR("%d client %d. new mClientId %d", aRegistered, aClientId, - (mClientId < mMobileConnListeners.Length()) ? mClientId : -1); -} - -void -BluetoothRilListener::EnumerateCalls() -{ - nsCOMPtr service = - do_GetService(TELEPHONY_SERVICE_CONTRACTID); - NS_ENSURE_TRUE_VOID(service); - - nsCOMPtr listener( - do_QueryObject(mTelephonyListener)); - - service->EnumerateCalls(listener); -} - -bool -BluetoothRilListener::ListenMobileConnAndIccInfo(bool aStart) -{ - /** - * mClientId < number of total clients: - * The client with mClientId is available. Start/Stop listening - * mobile connection and icc info of this client only. - * - * mClientId >= number of total clients: - * All clients are unavailable. Start/Stop listening mobile - * connections of all clients. - */ - if (mClientId < mMobileConnListeners.Length()) { - NS_ENSURE_TRUE(mMobileConnListeners[mClientId]->Listen(aStart), false); - NS_ENSURE_TRUE(mIccListener->Listen(aStart), false); - } else { - for (uint32_t i = 0; i < mMobileConnListeners.Length(); i++) { - NS_ENSURE_TRUE(mMobileConnListeners[i]->Listen(aStart), false); - } - } - - return true; -} diff --git a/dom/bluetooth/BluetoothCommon.h b/dom/bluetooth/common/BluetoothCommon.h similarity index 100% rename from dom/bluetooth/BluetoothCommon.h rename to dom/bluetooth/common/BluetoothCommon.h diff --git a/dom/bluetooth/BluetoothHfpManagerBase.h b/dom/bluetooth/common/BluetoothHfpManagerBase.h similarity index 100% rename from dom/bluetooth/BluetoothHfpManagerBase.h rename to dom/bluetooth/common/BluetoothHfpManagerBase.h diff --git a/dom/bluetooth/BluetoothHidManager.cpp b/dom/bluetooth/common/BluetoothHidManager.cpp similarity index 100% rename from dom/bluetooth/BluetoothHidManager.cpp rename to dom/bluetooth/common/BluetoothHidManager.cpp diff --git a/dom/bluetooth/BluetoothHidManager.h b/dom/bluetooth/common/BluetoothHidManager.h similarity index 100% rename from dom/bluetooth/BluetoothHidManager.h rename to dom/bluetooth/common/BluetoothHidManager.h diff --git a/dom/bluetooth/BluetoothInterface.cpp b/dom/bluetooth/common/BluetoothInterface.cpp similarity index 100% rename from dom/bluetooth/BluetoothInterface.cpp rename to dom/bluetooth/common/BluetoothInterface.cpp diff --git a/dom/bluetooth/BluetoothInterface.h b/dom/bluetooth/common/BluetoothInterface.h similarity index 100% rename from dom/bluetooth/BluetoothInterface.h rename to dom/bluetooth/common/BluetoothInterface.h diff --git a/dom/bluetooth/bluetooth2/BluetoothProfileController.cpp b/dom/bluetooth/common/BluetoothProfileController.cpp similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothProfileController.cpp rename to dom/bluetooth/common/BluetoothProfileController.cpp diff --git a/dom/bluetooth/bluetooth2/BluetoothProfileController.h b/dom/bluetooth/common/BluetoothProfileController.h similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothProfileController.h rename to dom/bluetooth/common/BluetoothProfileController.h diff --git a/dom/bluetooth/BluetoothProfileManagerBase.h b/dom/bluetooth/common/BluetoothProfileManagerBase.h similarity index 100% rename from dom/bluetooth/BluetoothProfileManagerBase.h rename to dom/bluetooth/common/BluetoothProfileManagerBase.h diff --git a/dom/bluetooth/bluetooth2/BluetoothReplyRunnable.cpp b/dom/bluetooth/common/BluetoothReplyRunnable.cpp similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothReplyRunnable.cpp rename to dom/bluetooth/common/BluetoothReplyRunnable.cpp diff --git a/dom/bluetooth/bluetooth2/BluetoothReplyRunnable.h b/dom/bluetooth/common/BluetoothReplyRunnable.h similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothReplyRunnable.h rename to dom/bluetooth/common/BluetoothReplyRunnable.h diff --git a/dom/bluetooth/BluetoothRilListener.cpp b/dom/bluetooth/common/BluetoothRilListener.cpp similarity index 100% rename from dom/bluetooth/BluetoothRilListener.cpp rename to dom/bluetooth/common/BluetoothRilListener.cpp diff --git a/dom/bluetooth/BluetoothRilListener.h b/dom/bluetooth/common/BluetoothRilListener.h similarity index 100% rename from dom/bluetooth/BluetoothRilListener.h rename to dom/bluetooth/common/BluetoothRilListener.h diff --git a/dom/bluetooth/bluetooth2/BluetoothService.cpp b/dom/bluetooth/common/BluetoothService.cpp similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothService.cpp rename to dom/bluetooth/common/BluetoothService.cpp diff --git a/dom/bluetooth/bluetooth2/BluetoothService.h b/dom/bluetooth/common/BluetoothService.h similarity index 99% rename from dom/bluetooth/bluetooth2/BluetoothService.h rename to dom/bluetooth/common/BluetoothService.h index 8b2b18f7404..0c3429a9701 100644 --- a/dom/bluetooth/bluetooth2/BluetoothService.h +++ b/dom/bluetooth/common/BluetoothService.h @@ -9,7 +9,6 @@ #include "BluetoothCommon.h" #include "BluetoothInterface.h" -#include "BluetoothPbapRequestHandle.h" #include "BluetoothProfileManagerBase.h" #include "nsAutoPtr.h" #include "nsClassHashtable.h" diff --git a/dom/bluetooth/BluetoothSocketObserver.h b/dom/bluetooth/common/BluetoothSocketObserver.h similarity index 100% rename from dom/bluetooth/BluetoothSocketObserver.h rename to dom/bluetooth/common/BluetoothSocketObserver.h diff --git a/dom/bluetooth/BluetoothUtils.cpp b/dom/bluetooth/common/BluetoothUtils.cpp similarity index 100% rename from dom/bluetooth/BluetoothUtils.cpp rename to dom/bluetooth/common/BluetoothUtils.cpp diff --git a/dom/bluetooth/BluetoothUtils.h b/dom/bluetooth/common/BluetoothUtils.h similarity index 100% rename from dom/bluetooth/BluetoothUtils.h rename to dom/bluetooth/common/BluetoothUtils.h diff --git a/dom/bluetooth/BluetoothUuid.cpp b/dom/bluetooth/common/BluetoothUuid.cpp similarity index 100% rename from dom/bluetooth/BluetoothUuid.cpp rename to dom/bluetooth/common/BluetoothUuid.cpp diff --git a/dom/bluetooth/BluetoothUuid.h b/dom/bluetooth/common/BluetoothUuid.h similarity index 100% rename from dom/bluetooth/BluetoothUuid.h rename to dom/bluetooth/common/BluetoothUuid.h diff --git a/dom/bluetooth/ObexBase.cpp b/dom/bluetooth/common/ObexBase.cpp similarity index 100% rename from dom/bluetooth/ObexBase.cpp rename to dom/bluetooth/common/ObexBase.cpp diff --git a/dom/bluetooth/ObexBase.h b/dom/bluetooth/common/ObexBase.h similarity index 100% rename from dom/bluetooth/ObexBase.h rename to dom/bluetooth/common/ObexBase.h diff --git a/dom/bluetooth/bluetooth2/BluetoothAdapter.cpp b/dom/bluetooth/common/webapi/BluetoothAdapter.cpp similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothAdapter.cpp rename to dom/bluetooth/common/webapi/BluetoothAdapter.cpp diff --git a/dom/bluetooth/bluetooth2/BluetoothAdapter.h b/dom/bluetooth/common/webapi/BluetoothAdapter.h similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothAdapter.h rename to dom/bluetooth/common/webapi/BluetoothAdapter.h diff --git a/dom/bluetooth/bluetooth2/BluetoothClassOfDevice.cpp b/dom/bluetooth/common/webapi/BluetoothClassOfDevice.cpp similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothClassOfDevice.cpp rename to dom/bluetooth/common/webapi/BluetoothClassOfDevice.cpp diff --git a/dom/bluetooth/bluetooth2/BluetoothClassOfDevice.h b/dom/bluetooth/common/webapi/BluetoothClassOfDevice.h similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothClassOfDevice.h rename to dom/bluetooth/common/webapi/BluetoothClassOfDevice.h diff --git a/dom/bluetooth/bluetooth2/BluetoothDevice.cpp b/dom/bluetooth/common/webapi/BluetoothDevice.cpp similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothDevice.cpp rename to dom/bluetooth/common/webapi/BluetoothDevice.cpp diff --git a/dom/bluetooth/bluetooth2/BluetoothDevice.h b/dom/bluetooth/common/webapi/BluetoothDevice.h similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothDevice.h rename to dom/bluetooth/common/webapi/BluetoothDevice.h diff --git a/dom/bluetooth/bluetooth2/BluetoothDiscoveryHandle.cpp b/dom/bluetooth/common/webapi/BluetoothDiscoveryHandle.cpp similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothDiscoveryHandle.cpp rename to dom/bluetooth/common/webapi/BluetoothDiscoveryHandle.cpp diff --git a/dom/bluetooth/bluetooth2/BluetoothDiscoveryHandle.h b/dom/bluetooth/common/webapi/BluetoothDiscoveryHandle.h similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothDiscoveryHandle.h rename to dom/bluetooth/common/webapi/BluetoothDiscoveryHandle.h diff --git a/dom/bluetooth/bluetooth2/BluetoothGatt.cpp b/dom/bluetooth/common/webapi/BluetoothGatt.cpp similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothGatt.cpp rename to dom/bluetooth/common/webapi/BluetoothGatt.cpp diff --git a/dom/bluetooth/bluetooth2/BluetoothGatt.h b/dom/bluetooth/common/webapi/BluetoothGatt.h similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothGatt.h rename to dom/bluetooth/common/webapi/BluetoothGatt.h diff --git a/dom/bluetooth/bluetooth2/BluetoothGattCharacteristic.cpp b/dom/bluetooth/common/webapi/BluetoothGattCharacteristic.cpp similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothGattCharacteristic.cpp rename to dom/bluetooth/common/webapi/BluetoothGattCharacteristic.cpp diff --git a/dom/bluetooth/bluetooth2/BluetoothGattCharacteristic.h b/dom/bluetooth/common/webapi/BluetoothGattCharacteristic.h similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothGattCharacteristic.h rename to dom/bluetooth/common/webapi/BluetoothGattCharacteristic.h diff --git a/dom/bluetooth/bluetooth2/BluetoothGattDescriptor.cpp b/dom/bluetooth/common/webapi/BluetoothGattDescriptor.cpp similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothGattDescriptor.cpp rename to dom/bluetooth/common/webapi/BluetoothGattDescriptor.cpp diff --git a/dom/bluetooth/bluetooth2/BluetoothGattDescriptor.h b/dom/bluetooth/common/webapi/BluetoothGattDescriptor.h similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothGattDescriptor.h rename to dom/bluetooth/common/webapi/BluetoothGattDescriptor.h diff --git a/dom/bluetooth/bluetooth2/BluetoothGattServer.cpp b/dom/bluetooth/common/webapi/BluetoothGattServer.cpp similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothGattServer.cpp rename to dom/bluetooth/common/webapi/BluetoothGattServer.cpp diff --git a/dom/bluetooth/bluetooth2/BluetoothGattServer.h b/dom/bluetooth/common/webapi/BluetoothGattServer.h similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothGattServer.h rename to dom/bluetooth/common/webapi/BluetoothGattServer.h diff --git a/dom/bluetooth/bluetooth2/BluetoothGattService.cpp b/dom/bluetooth/common/webapi/BluetoothGattService.cpp similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothGattService.cpp rename to dom/bluetooth/common/webapi/BluetoothGattService.cpp diff --git a/dom/bluetooth/bluetooth2/BluetoothGattService.h b/dom/bluetooth/common/webapi/BluetoothGattService.h similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothGattService.h rename to dom/bluetooth/common/webapi/BluetoothGattService.h diff --git a/dom/bluetooth/bluetooth2/BluetoothLeDeviceEvent.cpp b/dom/bluetooth/common/webapi/BluetoothLeDeviceEvent.cpp similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothLeDeviceEvent.cpp rename to dom/bluetooth/common/webapi/BluetoothLeDeviceEvent.cpp diff --git a/dom/bluetooth/bluetooth2/BluetoothLeDeviceEvent.h b/dom/bluetooth/common/webapi/BluetoothLeDeviceEvent.h similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothLeDeviceEvent.h rename to dom/bluetooth/common/webapi/BluetoothLeDeviceEvent.h diff --git a/dom/bluetooth/bluetooth2/BluetoothManager.cpp b/dom/bluetooth/common/webapi/BluetoothManager.cpp similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothManager.cpp rename to dom/bluetooth/common/webapi/BluetoothManager.cpp diff --git a/dom/bluetooth/bluetooth2/BluetoothManager.h b/dom/bluetooth/common/webapi/BluetoothManager.h similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothManager.h rename to dom/bluetooth/common/webapi/BluetoothManager.h diff --git a/dom/bluetooth/bluetooth2/BluetoothPairingHandle.cpp b/dom/bluetooth/common/webapi/BluetoothPairingHandle.cpp similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothPairingHandle.cpp rename to dom/bluetooth/common/webapi/BluetoothPairingHandle.cpp diff --git a/dom/bluetooth/bluetooth2/BluetoothPairingHandle.h b/dom/bluetooth/common/webapi/BluetoothPairingHandle.h similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothPairingHandle.h rename to dom/bluetooth/common/webapi/BluetoothPairingHandle.h diff --git a/dom/bluetooth/bluetooth2/BluetoothPairingListener.cpp b/dom/bluetooth/common/webapi/BluetoothPairingListener.cpp similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothPairingListener.cpp rename to dom/bluetooth/common/webapi/BluetoothPairingListener.cpp diff --git a/dom/bluetooth/bluetooth2/BluetoothPairingListener.h b/dom/bluetooth/common/webapi/BluetoothPairingListener.h similarity index 100% rename from dom/bluetooth/bluetooth2/BluetoothPairingListener.h rename to dom/bluetooth/common/webapi/BluetoothPairingListener.h diff --git a/dom/bluetooth/BluetoothPbapRequestHandle.cpp b/dom/bluetooth/common/webapi/BluetoothPbapRequestHandle.cpp similarity index 100% rename from dom/bluetooth/BluetoothPbapRequestHandle.cpp rename to dom/bluetooth/common/webapi/BluetoothPbapRequestHandle.cpp diff --git a/dom/bluetooth/BluetoothPbapRequestHandle.h b/dom/bluetooth/common/webapi/BluetoothPbapRequestHandle.h similarity index 100% rename from dom/bluetooth/BluetoothPbapRequestHandle.h rename to dom/bluetooth/common/webapi/BluetoothPbapRequestHandle.h diff --git a/dom/bluetooth/bluetooth2/ipc/BluetoothChild.cpp b/dom/bluetooth/ipc/BluetoothChild.cpp similarity index 100% rename from dom/bluetooth/bluetooth2/ipc/BluetoothChild.cpp rename to dom/bluetooth/ipc/BluetoothChild.cpp diff --git a/dom/bluetooth/bluetooth2/ipc/BluetoothChild.h b/dom/bluetooth/ipc/BluetoothChild.h similarity index 100% rename from dom/bluetooth/bluetooth2/ipc/BluetoothChild.h rename to dom/bluetooth/ipc/BluetoothChild.h diff --git a/dom/bluetooth/bluetooth2/ipc/BluetoothMessageUtils.h b/dom/bluetooth/ipc/BluetoothMessageUtils.h similarity index 100% rename from dom/bluetooth/bluetooth2/ipc/BluetoothMessageUtils.h rename to dom/bluetooth/ipc/BluetoothMessageUtils.h diff --git a/dom/bluetooth/bluetooth2/ipc/BluetoothParent.cpp b/dom/bluetooth/ipc/BluetoothParent.cpp similarity index 100% rename from dom/bluetooth/bluetooth2/ipc/BluetoothParent.cpp rename to dom/bluetooth/ipc/BluetoothParent.cpp diff --git a/dom/bluetooth/bluetooth2/ipc/BluetoothParent.h b/dom/bluetooth/ipc/BluetoothParent.h similarity index 100% rename from dom/bluetooth/bluetooth2/ipc/BluetoothParent.h rename to dom/bluetooth/ipc/BluetoothParent.h diff --git a/dom/bluetooth/bluetooth2/ipc/BluetoothServiceChildProcess.cpp b/dom/bluetooth/ipc/BluetoothServiceChildProcess.cpp similarity index 100% rename from dom/bluetooth/bluetooth2/ipc/BluetoothServiceChildProcess.cpp rename to dom/bluetooth/ipc/BluetoothServiceChildProcess.cpp diff --git a/dom/bluetooth/bluetooth2/ipc/BluetoothServiceChildProcess.h b/dom/bluetooth/ipc/BluetoothServiceChildProcess.h similarity index 100% rename from dom/bluetooth/bluetooth2/ipc/BluetoothServiceChildProcess.h rename to dom/bluetooth/ipc/BluetoothServiceChildProcess.h diff --git a/dom/bluetooth/bluetooth2/ipc/BluetoothTypes.ipdlh b/dom/bluetooth/ipc/BluetoothTypes.ipdlh similarity index 100% rename from dom/bluetooth/bluetooth2/ipc/BluetoothTypes.ipdlh rename to dom/bluetooth/ipc/BluetoothTypes.ipdlh diff --git a/dom/bluetooth/bluetooth2/ipc/PBluetooth.ipdl b/dom/bluetooth/ipc/PBluetooth.ipdl similarity index 100% rename from dom/bluetooth/bluetooth2/ipc/PBluetooth.ipdl rename to dom/bluetooth/ipc/PBluetooth.ipdl diff --git a/dom/bluetooth/bluetooth2/ipc/PBluetoothRequest.ipdl b/dom/bluetooth/ipc/PBluetoothRequest.ipdl similarity index 100% rename from dom/bluetooth/bluetooth2/ipc/PBluetoothRequest.ipdl rename to dom/bluetooth/ipc/PBluetoothRequest.ipdl diff --git a/dom/bluetooth/moz.build b/dom/bluetooth/moz.build index 6b74098238c..efbb5126942 100644 --- a/dom/bluetooth/moz.build +++ b/dom/bluetooth/moz.build @@ -10,44 +10,42 @@ if CONFIG['MOZ_B2G_BT']: # Generic code # - SOURCES += [ - 'BluetoothHidManager.cpp', - 'BluetoothInterface.cpp', - 'BluetoothPbapRequestHandle.cpp', - 'BluetoothUtils.cpp', - 'BluetoothUuid.cpp', - 'ObexBase.cpp' - ] - if CONFIG['MOZ_B2G_RIL']: SOURCES += [ - 'BluetoothRilListener.cpp' + 'common/BluetoothRilListener.cpp' ] SOURCES += [ - 'bluetooth2/BluetoothAdapter.cpp', - 'bluetooth2/BluetoothClassOfDevice.cpp', - 'bluetooth2/BluetoothDevice.cpp', - 'bluetooth2/BluetoothDiscoveryHandle.cpp', - 'bluetooth2/BluetoothGatt.cpp', - 'bluetooth2/BluetoothGattCharacteristic.cpp', - 'bluetooth2/BluetoothGattDescriptor.cpp', - 'bluetooth2/BluetoothGattServer.cpp', - 'bluetooth2/BluetoothGattService.cpp', - 'bluetooth2/BluetoothLeDeviceEvent.cpp', - 'bluetooth2/BluetoothManager.cpp', - 'bluetooth2/BluetoothPairingHandle.cpp', - 'bluetooth2/BluetoothPairingListener.cpp', - 'bluetooth2/BluetoothProfileController.cpp', - 'bluetooth2/BluetoothReplyRunnable.cpp', - 'bluetooth2/BluetoothService.cpp', - 'bluetooth2/ipc/BluetoothChild.cpp', - 'bluetooth2/ipc/BluetoothParent.cpp', - 'bluetooth2/ipc/BluetoothServiceChildProcess.cpp', + 'common/BluetoothHidManager.cpp', + 'common/BluetoothInterface.cpp', + 'common/BluetoothProfileController.cpp', + 'common/BluetoothReplyRunnable.cpp', + 'common/BluetoothService.cpp', + 'common/BluetoothUtils.cpp', + 'common/BluetoothUuid.cpp', + 'common/ObexBase.cpp', + 'common/webapi/BluetoothAdapter.cpp', + 'common/webapi/BluetoothClassOfDevice.cpp', + 'common/webapi/BluetoothDevice.cpp', + 'common/webapi/BluetoothDiscoveryHandle.cpp', + 'common/webapi/BluetoothGatt.cpp', + 'common/webapi/BluetoothGattCharacteristic.cpp', + 'common/webapi/BluetoothGattDescriptor.cpp', + 'common/webapi/BluetoothGattServer.cpp', + 'common/webapi/BluetoothGattService.cpp', + 'common/webapi/BluetoothLeDeviceEvent.cpp', + 'common/webapi/BluetoothManager.cpp', + 'common/webapi/BluetoothPairingHandle.cpp', + 'common/webapi/BluetoothPairingListener.cpp', + 'common/webapi/BluetoothPbapRequestHandle.cpp', + 'ipc/BluetoothChild.cpp', + 'ipc/BluetoothParent.cpp', + 'ipc/BluetoothServiceChildProcess.cpp' ] LOCAL_INCLUDES += [ - 'bluetooth2', - 'bluetooth2/ipc', + 'common', + 'common/webapi', + 'ipc' ] # @@ -129,29 +127,29 @@ if CONFIG['MOZ_B2G_BT']: # EXPORTS.mozilla.dom.bluetooth.ipc += [ - 'bluetooth2/ipc/BluetoothMessageUtils.h', + 'ipc/BluetoothMessageUtils.h', ] EXPORTS.mozilla.dom.bluetooth += [ - 'bluetooth2/BluetoothAdapter.h', - 'bluetooth2/BluetoothClassOfDevice.h', - 'bluetooth2/BluetoothDevice.h', - 'bluetooth2/BluetoothDiscoveryHandle.h', - 'bluetooth2/BluetoothGatt.h', - 'bluetooth2/BluetoothGattCharacteristic.h', - 'bluetooth2/BluetoothGattDescriptor.h', - 'bluetooth2/BluetoothGattServer.h', - 'bluetooth2/BluetoothGattService.h', - 'bluetooth2/BluetoothLeDeviceEvent.h', - 'bluetooth2/BluetoothManager.h', - 'bluetooth2/BluetoothPairingHandle.h', - 'bluetooth2/BluetoothPairingListener.h', - 'BluetoothCommon.h', - 'BluetoothPbapRequestHandle.h', + 'common/BluetoothCommon.h', + 'common/webapi/BluetoothAdapter.h', + 'common/webapi/BluetoothClassOfDevice.h', + 'common/webapi/BluetoothDevice.h', + 'common/webapi/BluetoothDiscoveryHandle.h', + 'common/webapi/BluetoothGatt.h', + 'common/webapi/BluetoothGattCharacteristic.h', + 'common/webapi/BluetoothGattDescriptor.h', + 'common/webapi/BluetoothGattServer.h', + 'common/webapi/BluetoothGattService.h', + 'common/webapi/BluetoothLeDeviceEvent.h', + 'common/webapi/BluetoothManager.h', + 'common/webapi/BluetoothPairingHandle.h', + 'common/webapi/BluetoothPairingListener.h', + 'common/webapi/BluetoothPbapRequestHandle.h' ] IPDL_SOURCES += [ - 'bluetooth2/ipc/BluetoothTypes.ipdlh', - 'bluetooth2/ipc/PBluetooth.ipdl', - 'bluetooth2/ipc/PBluetoothRequest.ipdl', + 'ipc/BluetoothTypes.ipdlh', + 'ipc/PBluetooth.ipdl', + 'ipc/PBluetoothRequest.ipdl' ] FAIL_ON_WARNINGS = True @@ -159,7 +157,7 @@ FAIL_ON_WARNINGS = True LOCAL_INCLUDES += [ '../base', '../network', - '../system/gonk', + '../system/gonk' ] include('/ipc/chromium/chromium-config.mozbuild') diff --git a/dom/bluetooth/bluetooth2/tests/marionette/head.js b/dom/bluetooth/tests/marionette/head.js similarity index 100% rename from dom/bluetooth/bluetooth2/tests/marionette/head.js rename to dom/bluetooth/tests/marionette/head.js diff --git a/dom/bluetooth/bluetooth2/tests/marionette/manifest.ini b/dom/bluetooth/tests/marionette/manifest.ini similarity index 100% rename from dom/bluetooth/bluetooth2/tests/marionette/manifest.ini rename to dom/bluetooth/tests/marionette/manifest.ini diff --git a/dom/bluetooth/bluetooth2/tests/marionette/test_dom_BluetoothAdapter_discovery_API2.js b/dom/bluetooth/tests/marionette/test_dom_BluetoothAdapter_discovery.js similarity index 100% rename from dom/bluetooth/bluetooth2/tests/marionette/test_dom_BluetoothAdapter_discovery_API2.js rename to dom/bluetooth/tests/marionette/test_dom_BluetoothAdapter_discovery.js diff --git a/dom/bluetooth/bluetooth2/tests/marionette/test_dom_BluetoothAdapter_enable_API2.js b/dom/bluetooth/tests/marionette/test_dom_BluetoothAdapter_enable.js similarity index 100% rename from dom/bluetooth/bluetooth2/tests/marionette/test_dom_BluetoothAdapter_enable_API2.js rename to dom/bluetooth/tests/marionette/test_dom_BluetoothAdapter_enable.js diff --git a/dom/bluetooth/bluetooth2/tests/marionette/test_dom_BluetoothAdapter_pair_API2.js b/dom/bluetooth/tests/marionette/test_dom_BluetoothAdapter_pair.js similarity index 100% rename from dom/bluetooth/bluetooth2/tests/marionette/test_dom_BluetoothAdapter_pair_API2.js rename to dom/bluetooth/tests/marionette/test_dom_BluetoothAdapter_pair.js diff --git a/dom/bluetooth/bluetooth2/tests/marionette/test_dom_BluetoothAdapter_setters_API2.js b/dom/bluetooth/tests/marionette/test_dom_BluetoothAdapter_setters.js similarity index 100% rename from dom/bluetooth/bluetooth2/tests/marionette/test_dom_BluetoothAdapter_setters_API2.js rename to dom/bluetooth/tests/marionette/test_dom_BluetoothAdapter_setters.js diff --git a/dom/bluetooth/bluetooth2/tests/marionette/test_dom_BluetoothDevice_API2.js b/dom/bluetooth/tests/marionette/test_dom_BluetoothDevice.js similarity index 100% rename from dom/bluetooth/bluetooth2/tests/marionette/test_dom_BluetoothDevice_API2.js rename to dom/bluetooth/tests/marionette/test_dom_BluetoothDevice.js diff --git a/dom/bluetooth/bluetooth2/tests/marionette/test_dom_BluetoothManager_API2.js b/dom/bluetooth/tests/marionette/test_dom_BluetoothManager.js similarity index 100% rename from dom/bluetooth/bluetooth2/tests/marionette/test_dom_BluetoothManager_API2.js rename to dom/bluetooth/tests/marionette/test_dom_BluetoothManager.js diff --git a/dom/ipc/moz.build b/dom/ipc/moz.build index 112250e0edf..cfc0b2763d8 100644 --- a/dom/ipc/moz.build +++ b/dom/ipc/moz.build @@ -128,9 +128,8 @@ LOCAL_INCLUDES += [ '/chrome', '/docshell/base', '/dom/base', - '/dom/bluetooth', - '/dom/bluetooth/bluetooth2', - '/dom/bluetooth/bluetooth2/ipc', + '/dom/bluetooth/common', + '/dom/bluetooth/ipc', '/dom/devicestorage', '/dom/filesystem', '/dom/fmradio/ipc', diff --git a/dom/system/gonk/moz.build b/dom/system/gonk/moz.build index 1e3d11d5722..55705325bec 100644 --- a/dom/system/gonk/moz.build +++ b/dom/system/gonk/moz.build @@ -119,8 +119,7 @@ include('/ipc/chromium/chromium-config.mozbuild') LOCAL_INCLUDES += [ '/dom/base', - '/dom/bluetooth', - '/dom/bluetooth/bluetooth2', + '/dom/bluetooth/common', '/dom/geolocation', '/dom/wifi', ] diff --git a/js/xpconnect/src/moz.build b/js/xpconnect/src/moz.build index 90198b2d0cc..399da1ddbcd 100644 --- a/js/xpconnect/src/moz.build +++ b/js/xpconnect/src/moz.build @@ -72,6 +72,5 @@ LOCAL_INCLUDES += [ if CONFIG['MOZ_B2G_BT']: LOCAL_INCLUDES += [ - '/dom/bluetooth', - '/dom/bluetooth/bluetooth2', + '/dom/bluetooth/common', ] diff --git a/layout/base/AccessibleCaretManager.cpp b/layout/base/AccessibleCaretManager.cpp index 94c4a83af46..1f50d6716ce 100644 --- a/layout/base/AccessibleCaretManager.cpp +++ b/layout/base/AccessibleCaretManager.cpp @@ -335,20 +335,21 @@ AccessibleCaretManager::SelectWordOrShortcut(const nsPoint& aPoint) return NS_ERROR_FAILURE; } - nsIFrame* focusedFrame = ChangeFocus(ptFrame); + nsIFrame* focusableFrame = GetFocusableFrame(ptFrame); #ifdef DEBUG_FRAME_DUMP AC_LOG("%s: Found %s under (%d, %d)", __FUNCTION__, ptFrame->ListTag().get(), aPoint.x, aPoint.y); - AC_LOG("%s: Focused on %s", __FUNCTION__, - focusedFrame ? focusedFrame->ListTag().get() : "no frame"); + AC_LOG("%s: Found %s focusable", __FUNCTION__, + focusableFrame ? focusableFrame->ListTag().get() : "no frame"); #endif // Firstly check long press on an empty editable content. Element* newFocusEditingHost = ptFrame->GetContent()->GetEditingHost(); - if (focusedFrame && newFocusEditingHost && + if (focusableFrame && newFocusEditingHost && !nsContentUtils::HasNonEmptyTextContent( newFocusEditingHost, nsContentUtils::eRecurseIntoChildren)) { + ChangeFocusToOrClearOldFocus(focusableFrame); // We need to update carets to get correct information before dispatching // CaretStateChangedEvent. UpdateCarets(); @@ -356,6 +357,21 @@ AccessibleCaretManager::SelectWordOrShortcut(const nsPoint& aPoint) return NS_OK; } + bool selectable = false; + ptFrame->IsSelectable(&selectable, nullptr); + +#ifdef DEBUG_FRAME_DUMP + AC_LOG("%s: %s %s selectable.", __FUNCTION__, ptFrame->ListTag().get(), + selectable ? "is" : "is NOT"); +#endif + + if (!selectable) { + return NS_ERROR_FAILURE; + } + + // ptFrame is selectable. Now change the focus. + ChangeFocusToOrClearOldFocus(focusableFrame); + // Then try select a word under point. nsPoint ptInFrame = aPoint; nsLayoutUtils::TransformPoint(rootFrame, ptFrame, ptInFrame); @@ -508,7 +524,7 @@ AccessibleCaretManager::GetCaretMode() const } nsIFrame* -AccessibleCaretManager::ChangeFocus(nsIFrame* aFrame) const +AccessibleCaretManager::GetFocusableFrame(nsIFrame* aFrame) const { // This implementation is similar to EventStateManager::PostHandleEvent(). // Look for the nearest enclosing focusable frame. @@ -519,14 +535,17 @@ AccessibleCaretManager::ChangeFocus(nsIFrame* aFrame) const } focusableFrame = focusableFrame->GetParent(); } + return focusableFrame; +} - // If a focusable frame is found, move focus to it. Otherwise, clear the old - // focus then re-focus the window. +void +AccessibleCaretManager::ChangeFocusToOrClearOldFocus(nsIFrame* aFrame) const +{ nsFocusManager* fm = nsFocusManager::GetFocusManager(); MOZ_ASSERT(fm); - if (focusableFrame) { - nsIContent* focusableContent = focusableFrame->GetContent(); + if (aFrame) { + nsIContent* focusableContent = aFrame->GetContent(); MOZ_ASSERT(focusableContent, "Focusable frame must have content!"); nsCOMPtr focusableElement = do_QueryInterface(focusableContent); fm->SetFocus(focusableElement, nsIFocusManager::FLAG_BYMOUSE); @@ -537,19 +556,11 @@ AccessibleCaretManager::ChangeFocus(nsIFrame* aFrame) const fm->SetFocusedWindow(win); } } - - return focusableFrame; } nsresult AccessibleCaretManager::SelectWord(nsIFrame* aFrame, const nsPoint& aPoint) const { - bool selectable; - aFrame->IsSelectable(&selectable, nullptr); - if (!selectable) { - return NS_ERROR_FAILURE; - } - SetSelectionDragState(true); nsFrame* frame = static_cast(aFrame); nsresult rs = frame->SelectByTypeAtPoint(mPresShell->GetPresContext(), aPoint, diff --git a/layout/base/AccessibleCaretManager.h b/layout/base/AccessibleCaretManager.h index 55c661a86c2..94e477392ae 100644 --- a/layout/base/AccessibleCaretManager.h +++ b/layout/base/AccessibleCaretManager.h @@ -115,9 +115,13 @@ protected: void UpdateCaretsForSelectionMode(); void UpdateCaretsForTilt(); - // Change focus to the nearest enclosing focusable frame of aFrame. + // Get the nearest enclosing focusable frame of aFrame. // @return focusable frame if there is any; nullptr otherwise. - nsIFrame* ChangeFocus(nsIFrame* aFrame) const; + nsIFrame* GetFocusableFrame(nsIFrame* aFrame) const; + + // Change focus to aFrame if it isn't nullptr. Otherwise, clear the old focus + // then re-focus the window. + void ChangeFocusToOrClearOldFocus(nsIFrame* aFrame) const; nsresult SelectWord(nsIFrame* aFrame, const nsPoint& aPoint) const; void SetSelectionDragState(bool aState) const; diff --git a/layout/build/moz.build b/layout/build/moz.build index dfc3583298e..ca320d21b91 100644 --- a/layout/build/moz.build +++ b/layout/build/moz.build @@ -106,8 +106,7 @@ if CONFIG['MOZ_B2G_FM']: if CONFIG['MOZ_B2G_BT']: LOCAL_INCLUDES += [ - '/dom/bluetooth', - '/dom/bluetooth/bluetooth2', + '/dom/bluetooth/common', ] if CONFIG['MOZ_WEBSPEECH']: diff --git a/testing/config/mozharness/b2g_emulator_config.py b/testing/config/mozharness/b2g_emulator_config.py new file mode 100644 index 00000000000..89edfa60020 --- /dev/null +++ b/testing/config/mozharness/b2g_emulator_config.py @@ -0,0 +1,148 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +# XXX Bug 1181261 - Please update config in testing/mozharness/config +# instead. This file is still needed for mulet mochitests, but should +# be removed once bug 1188330 is finished. + +config = { + "suite_definitions": { + "cppunittest": { + "options": [ + "--dm_trans=adb", + "--symbols-path=%(symbols_path)s", + "--xre-path=%(xre_path)s", + "--addEnv", + "LD_LIBRARY_PATH=/vendor/lib:/system/lib:/system/b2g", + "--with-b2g-emulator=%(b2gpath)s", + "." + ], + "run_filename": "remotecppunittests.py", + "testsdir": "cppunittest" + }, + "crashtest": { + "options": [ + "--adbpath=%(adbpath)s", + "--b2gpath=%(b2gpath)s", + "--emulator=%(emulator)s", + "--emulator-res=800x1000", + "--logdir=%(logcat_dir)s", + "--remote-webserver=%(remote_webserver)s", + "--ignore-window-size", + "--xre-path=%(xre_path)s", + "--symbols-path=%(symbols_path)s", + "--busybox=%(busybox)s", + "--total-chunks=%(total_chunks)s", + "--this-chunk=%(this_chunk)s", + "tests/testing/crashtest/crashtests.list" + ], + "run_filename": "runreftestb2g.py", + "testsdir": "reftest" + }, + "jsreftest": { + "options": [ + "--adbpath=%(adbpath)s", + "--b2gpath=%(b2gpath)s", + "--emulator=%(emulator)s", + "--emulator-res=800x1000", + "--logdir=%(logcat_dir)s", + "--remote-webserver=%(remote_webserver)s", + "--ignore-window-size", + "--xre-path=%(xre_path)s", + "--symbols-path=%(symbols_path)s", + "--busybox=%(busybox)s", + "--total-chunks=%(total_chunks)s", + "--this-chunk=%(this_chunk)s", + "--extra-profile-file=jsreftest/tests/user.js", + "jsreftest/tests/jstests.list" + ], + "run_filename": "remotereftest.py", + "testsdir": "reftest" + }, + "mochitest": { + "options": [ + "--adbpath=%(adbpath)s", + "--b2gpath=%(b2gpath)s", + "--emulator=%(emulator)s", + "--logdir=%(logcat_dir)s", + "--remote-webserver=%(remote_webserver)s", + "--xre-path=%(xre_path)s", + "--symbols-path=%(symbols_path)s", + "--busybox=%(busybox)s", + "--total-chunks=%(total_chunks)s", + "--this-chunk=%(this_chunk)s", + "--quiet", + "--log-raw=%(raw_log_file)s", + "--log-errorsummary=%(error_summary_file)s", + "--certificate-path=%(certificate_path)s", + "--screenshot-on-fail", + "%(test_path)s" + ], + "run_filename": "runtestsb2g.py", + "testsdir": "mochitest" + }, + "mochitest-chrome": { + "options": [ + "--adbpath=%(adbpath)s", + "--b2gpath=%(b2gpath)s", + "--emulator=%(emulator)s", + "--logdir=%(logcat_dir)s", + "--remote-webserver=%(remote_webserver)s", + "--xre-path=%(xre_path)s", + "--symbols-path=%(symbols_path)s", + "--busybox=%(busybox)s", + "--total-chunks=%(total_chunks)s", + "--this-chunk=%(this_chunk)s", + "--quiet", + "--chrome", + "--log-raw=%(raw_log_file)s", + "--log-errorsummary=%(error_summary_file)s", + "--certificate-path=%(certificate_path)s", + "--screenshot-on-fail", + "%(test_path)s" + ], + "run_filename": "runtestsb2g.py", + "testsdir": "mochitest" + }, + "reftest": { + "options": [ + "--adbpath=%(adbpath)s", + "--b2gpath=%(b2gpath)s", + "--emulator=%(emulator)s", + "--emulator-res=800x1000", + "--logdir=%(logcat_dir)s", + "--remote-webserver=%(remote_webserver)s", + "--ignore-window-size", + "--xre-path=%(xre_path)s", + "--symbols-path=%(symbols_path)s", + "--busybox=%(busybox)s", + "--total-chunks=%(total_chunks)s", + "--this-chunk=%(this_chunk)s", + "--enable-oop", + "tests/layout/reftests/reftest.list" + ], + "run_filename": "runreftestsb2g.py", + "testsdir": "reftest" + }, + "xpcshell": { + "options": [ + "--adbpath=%(adbpath)s", + "--b2gpath=%(b2gpath)s", + "--emulator=%(emulator)s", + "--logdir=%(logcat_dir)s", + "--manifest=tests/xpcshell.ini", + "--use-device-libs", + "--testing-modules-dir=%(modules_dir)s", + "--symbols-path=%(symbols_path)s", + "--busybox=%(busybox)s", + "--total-chunks=%(total_chunks)s", + "--this-chunk=%(this_chunk)s", + "--log-raw=%(raw_log_file)s", + "--log-errorsummary=%(error_summary_file)s", + ], + "run_filename": "runtestsb2g.py", + "testsdir": "xpcshell" + } + } +} diff --git a/testing/marionette/client/marionette/tests/webapi-tests.ini b/testing/marionette/client/marionette/tests/webapi-tests.ini index 7868a4d0df1..a0cfcb94610 100644 --- a/testing/marionette/client/marionette/tests/webapi-tests.ini +++ b/testing/marionette/client/marionette/tests/webapi-tests.ini @@ -12,7 +12,7 @@ b2g = true skip = false ; webapi tests -[include:../../../../../dom/bluetooth/bluetooth2/tests/marionette/manifest.ini] +[include:../../../../../dom/bluetooth/tests/marionette/manifest.ini] [include:../../../../../dom/telephony/test/marionette/manifest.ini] [include:../../../../../dom/voicemail/test/marionette/manifest.ini] [include:../../../../../dom/battery/test/marionette/manifest.ini] diff --git a/testing/taskcluster/tasks/branches/alder/job_flags.yml b/testing/taskcluster/tasks/branches/alder/job_flags.yml index 124453d451b..116c8d0f06d 100644 --- a/testing/taskcluster/tasks/branches/alder/job_flags.yml +++ b/testing/taskcluster/tasks/branches/alder/job_flags.yml @@ -39,21 +39,6 @@ tests: allowed_build_tasks: tasks/builds/b2g_desktop_opt.yml: task: tasks/tests/b2g_linter.yml - gaia-ui-test-accessibility: - allowed_build_tasks: - tasks/builds/b2g_desktop_opt.yml: - task: tasks/tests/b2g_gaia_ui_test_accessibility.yml - tasks/builds/b2g_emulator.yml: - task: tasks/tests/b2g_emulator_gaia_ui_test_accessibility.yml - gaia-ui-test-functional: - allowed_build_tasks: - tasks/builds/b2g_desktop_opt.yml: - task: tasks/tests/b2g_gaia_ui_test_functional.yml - chunks: 3 - gaia-ui-test-unit: - allowed_build_tasks: - tasks/builds/b2g_desktop_opt.yml: - task: tasks/tests/b2g_gaia_ui_test_unit.yml gaia-unit: allowed_build_tasks: tasks/builds/b2g_desktop_opt.yml: diff --git a/testing/taskcluster/tasks/branches/base_job_flags.yml b/testing/taskcluster/tasks/branches/base_job_flags.yml index bfee8a86f46..36a0d8df780 100644 --- a/testing/taskcluster/tasks/branches/base_job_flags.yml +++ b/testing/taskcluster/tasks/branches/base_job_flags.yml @@ -42,8 +42,6 @@ flags: - gaia-unit - gaia-unit-oop - gaia-ui-test-sanity - - gaia-ui-test-oop - - gaia-ui-test-accessibility - gaia-ui-test-functional - gaia-ui-test-functional-dsds - gaia-ui-test-unit diff --git a/testing/taskcluster/tasks/branches/base_jobs.yml b/testing/taskcluster/tasks/branches/base_jobs.yml index f76fbafcb6a..a44c633e319 100644 --- a/testing/taskcluster/tasks/branches/base_jobs.yml +++ b/testing/taskcluster/tasks/branches/base_jobs.yml @@ -122,18 +122,8 @@ tests: task: tasks/tests/b2g_linter.yml tasks/builds/mulet_linux.yml: task: tasks/tests/mulet_linter.yml - gaia-ui-test-accessibility: - allowed_build_tasks: - tasks/builds/b2g_desktop_opt.yml: - task: tasks/tests/b2g_gaia_ui_test_accessibility.yml - tasks/builds/b2g_desktop_debug.yml: - task: tasks/tests/b2g_gaia_ui_test_accessibility.yml gaia-ui-test-functional: allowed_build_tasks: - tasks/builds/b2g_desktop_opt.yml: - task: tasks/tests/b2g_gaia_ui_test_functional.yml - tasks/builds/b2g_desktop_debug.yml: - task: tasks/tests/b2g_gaia_ui_test_functional.yml tasks/builds/b2g_flame_kk_eng.yml: task: tasks/tests/flame_kk_gaia_ui_test_functional.yml gaia-ui-test-functional-dsds: @@ -146,10 +136,6 @@ tests: task: tasks/tests/flame_kk_gaia_ui_test_sanity.yml gaia-ui-test-unit: allowed_build_tasks: - tasks/builds/b2g_desktop_opt.yml: - task: tasks/tests/b2g_gaia_ui_test_unit.yml - tasks/builds/b2g_desktop_debug.yml: - task: tasks/tests/b2g_gaia_ui_test_unit.yml tasks/builds/b2g_flame_kk_eng.yml: task: tasks/tests/flame_kk_gaia_ui_test_unit.yml gaia-unit: diff --git a/testing/taskcluster/tasks/branches/cedar/job_flags.yml b/testing/taskcluster/tasks/branches/cedar/job_flags.yml index c361b8e7d72..b0c98d0d14e 100644 --- a/testing/taskcluster/tasks/branches/cedar/job_flags.yml +++ b/testing/taskcluster/tasks/branches/cedar/job_flags.yml @@ -84,23 +84,6 @@ tests: allowed_build_tasks: tasks/builds/b2g_desktop_opt.yml: task: tasks/tests/b2g_gaia_unit.yml - gaia-ui-test-accessibility: - allowed_build_tasks: - tasks/builds/b2g_desktop_opt.yml: - task: tasks/tests/b2g_gaia_ui_test_accessibility.yml - gaia-ui-test-functional: - allowed_build_tasks: - tasks/builds/b2g_desktop_opt.yml: - task: tasks/tests/b2g_gaia_ui_test_functional.yml - chunks: 3 - gaia-ui-test-unit: - allowed_build_tasks: - tasks/builds/b2g_desktop_opt.yml: - task: tasks/tests/b2g_gaia_ui_test_unit.yml - gaia-ui-test-oop: - allowed_build_tasks: - tasks/builds/b2g_desktop_opt.yml: - task: tasks/tests/b2g_gip_oop.yml jsreftest: allowed_build_tasks: tasks/builds/b2g_emulator_ics_opt.yml: diff --git a/testing/taskcluster/tasks/branches/try/job_flags.yml b/testing/taskcluster/tasks/branches/try/job_flags.yml index b91a6937f85..7f6765eaa10 100644 --- a/testing/taskcluster/tasks/branches/try/job_flags.yml +++ b/testing/taskcluster/tasks/branches/try/job_flags.yml @@ -231,24 +231,6 @@ tests: task: tasks/tests/b2g_linter.yml tasks/builds/mulet_linux.yml: task: tasks/tests/mulet_linter.yml - gaia-ui-test-accessibility: - allowed_build_tasks: - tasks/builds/b2g_desktop_opt.yml: - task: tasks/tests/b2g_gaia_ui_test_accessibility.yml - tasks/builds/b2g_desktop_debug.yml: - task: tasks/tests/b2g_gaia_ui_test_accessibility.yml - gaia-ui-test-functional: - allowed_build_tasks: - tasks/builds/b2g_desktop_opt.yml: - task: tasks/tests/b2g_gaia_ui_test_functional.yml - tasks/builds/b2g_desktop_debug.yml: - task: tasks/tests/b2g_gaia_ui_test_functional.yml - gaia-ui-test-unit: - allowed_build_tasks: - tasks/builds/b2g_desktop_opt.yml: - task: tasks/tests/b2g_gaia_ui_test_unit.yml - tasks/builds/b2g_desktop_debug.yml: - task: tasks/tests/b2g_gaia_ui_test_unit.yml gaia-unit: allowed_build_tasks: tasks/builds/b2g_desktop_opt.yml: diff --git a/testing/taskcluster/tasks/tests/b2g_gaia_ui_test_accessibility.yml b/testing/taskcluster/tasks/tests/b2g_gaia_ui_test_accessibility.yml deleted file mode 100644 index 35cf88de32d..00000000000 --- a/testing/taskcluster/tasks/tests/b2g_gaia_ui_test_accessibility.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -$inherits: - from: 'tasks/test.yml' -task: - metadata: - name: '[TC] - Gaia Python Accessibility Integration Tests' - description: Gaia Python Accessibility Integration Tests run {{chunk}} - - payload: - command: - - entrypoint # entrypoint ensures we are running in xvfb - - ./bin/pull_gaia.sh && - - > - python ./mozharness/scripts/marionette.py - --no-read-buildbot-config - --config-file marionette/gaia_ui_test_prod_config.py - --config-file ./mozharness_configs/gaia_integration_override.py - --config-file ./mozharness_configs/remove_executables.py - --no-pull - --installer-url {{build_url}} - --test-packages-url {{test_packages_url}} - --download-symbols ondemand - --gip-suite accessibility - --gaia-repo https://hg.mozilla.org/integration/gaia-central - --gaia-dir /home/worker - --xre-url https://queue.taskcluster.net/v1/task/wXAHAaxDQpqxoWF1iljJjg/runs/0/artifacts/public/cache/xulrunner-sdk-40.zip - artifacts: - 'public/build': - type: directory - path: '/home/worker/artifacts/' - expires: '{{#from_now}}1 year{{/from_now}}' - - extra: - treeherderEnv: - - production - - staging - treeherder: - groupName: Gaia Python Integration Tests - groupSymbol: Gip - symbol: 'a' - productName: b2g diff --git a/testing/taskcluster/tasks/tests/b2g_gaia_ui_test_functional.yml b/testing/taskcluster/tasks/tests/b2g_gaia_ui_test_functional.yml deleted file mode 100644 index c566102cee3..00000000000 --- a/testing/taskcluster/tasks/tests/b2g_gaia_ui_test_functional.yml +++ /dev/null @@ -1,45 +0,0 @@ ---- -$inherits: - from: 'tasks/test.yml' -task: - metadata: - name: '[TC] - Gaia Python Functional Integration Tests' - description: Gaia Python Functional Integration Tests run {{chunk}} - - payload: - command: - - entrypoint # entrypoint ensures we are running in xvfb - - ./bin/pull_gaia.sh && - - > - python ./mozharness/scripts/marionette.py - --no-read-buildbot-config - --config-file marionette/gaia_ui_test_prod_config.py - --config-file ./mozharness_configs/gaia_integration_override.py - --config-file ./mozharness_configs/remove_executables.py - --no-pull - --installer-url {{build_url}} - --test-packages-url {{test_packages_url}} - --download-symbols ondemand - --gip-suite functional - --total-chunk {{total_chunks}} - --this-chunk {{chunk}} - --gaia-repo https://hg.mozilla.org/integration/gaia-central - --gaia-dir /home/worker - --xre-url https://queue.taskcluster.net/v1/task/wXAHAaxDQpqxoWF1iljJjg/runs/0/artifacts/public/cache/xulrunner-sdk-40.zip - artifacts: - 'public/build': - type: directory - path: '/home/worker/artifacts/' - expires: '{{#from_now}}1 year{{/from_now}}' - - extra: - chunks: - total: 15 - treeherderEnv: - - production - - staging - treeherder: - groupName: Gaia Python Integration Tests - groupSymbol: Gip - symbol: 'f{{chunk}}' - productName: b2g diff --git a/testing/taskcluster/tasks/tests/b2g_gaia_ui_test_unit.yml b/testing/taskcluster/tasks/tests/b2g_gaia_ui_test_unit.yml deleted file mode 100644 index bb060244af7..00000000000 --- a/testing/taskcluster/tasks/tests/b2g_gaia_ui_test_unit.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -$inherits: - from: 'tasks/test.yml' -task: - metadata: - name: '[TC] - Gaia Python Integration Unit Tests' - description: Gaia Python Integration Unit Tests run {{chunk}} - - payload: - command: - - entrypoint # entrypoint ensures we are running in xvfb - - ./bin/pull_gaia.sh && - - > - python ./mozharness/scripts/marionette.py - --no-read-buildbot-config - --config-file marionette/gaia_ui_test_prod_config.py - --config-file ./mozharness_configs/gaia_integration_override.py - --config-file ./mozharness_configs/remove_executables.py - --installer-url {{build_url}} - --no-pull - --test-packages-url {{test_packages_url}} - --download-symbols ondemand - --gip-suite unit - --gaia-repo https://hg.mozilla.org/integration/gaia-central - --gaia-dir /home/worker - --xre-url https://queue.taskcluster.net/v1/task/wXAHAaxDQpqxoWF1iljJjg/runs/0/artifacts/public/cache/xulrunner-sdk-40.zip - artifacts: - 'public/build': - type: directory - path: '/home/worker/artifacts/' - expires: '{{#from_now}}1 year{{/from_now}}' - - extra: - treeherderEnv: - - production - - staging - treeherder: - groupName: Gaia Python Integration Tests - groupSymbol: Gip - symbol: 'u' - productName: b2g diff --git a/testing/taskcluster/tasks/tests/b2g_gip_oop.yml b/testing/taskcluster/tasks/tests/b2g_gip_oop.yml deleted file mode 100644 index c3e5cfd1090..00000000000 --- a/testing/taskcluster/tasks/tests/b2g_gip_oop.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -$inherits: - from: 'tasks/test.yml' -task: - metadata: - name: '[TC] Gaia Python Integration Tests OOP' - description: Gaia Python Functional Integration Tests OOP test run - - payload: - command: - - entrypoint # entrypoint ensures we are running in xvfb - - ./bin/pull_gaia.sh && - - > - python ./mozharness/scripts/marionette.py - --no-read-buildbot-config - --config-file marionette/gaia_ui_test_prod_config.py - --config-file ./mozharness_configs/gaia_integration_override.py - --config-file ./mozharness_configs/remove_executables.py - --no-pull - --app-arg -oop - --installer-url {{build_url}} - --test-packages-url {{test_packages_url}} - --download-symbols ondemand - --gaia-repo https://hg.mozilla.org/integration/gaia-central - --gaia-dir /home/worker - --xre-url https://queue.taskcluster.net/v1/task/wXAHAaxDQpqxoWF1iljJjg/runs/0/artifacts/public/cache/xulrunner-sdk-40.zip - artifacts: - 'public/build': - type: directory - path: '/home/worker/artifacts/' - expires: '{{#from_now}}1 year{{/from_now}}' - - extra: - treeherder: - groupName: Gaia Python Integration Tests OOP - groupSymbol: tc-Gip-oop - symbol: 'Gip-oop' - productName: b2g