Merge mozilla-central to fx-team

This commit is contained in:
Carsten "Tomcat" Book 2014-06-30 15:49:06 +02:00
commit 0a68a97bbf
91 changed files with 735 additions and 461 deletions

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="de14e61098b742251b34f856e48649db8bed552c"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bc3bbf42d2a606f6b7038881cff5ec3795fdf953"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="de14e61098b742251b34f856e48649db8bed552c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="bc3bbf42d2a606f6b7038881cff5ec3795fdf953"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="7f9ec13a30f1b2cc8bdb1a199b7da54b9ab8860f"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="276ce45e78b09c4a4ee643646f691d22804754c1">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="de14e61098b742251b34f856e48649db8bed552c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="bc3bbf42d2a606f6b7038881cff5ec3795fdf953"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="de14e61098b742251b34f856e48649db8bed552c"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bc3bbf42d2a606f6b7038881cff5ec3795fdf953"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="de14e61098b742251b34f856e48649db8bed552c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="bc3bbf42d2a606f6b7038881cff5ec3795fdf953"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="7f9ec13a30f1b2cc8bdb1a199b7da54b9ab8860f"/>

View File

@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
"revision": "b6c6dcfdef46399b88637c93a4f76d4425f7c096",
"revision": "2c2f2fa0a101f07cbb206cca2e69ef3a7b18244c",
"repo_path": "/integration/gaia-central"
}

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="de14e61098b742251b34f856e48649db8bed552c"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bc3bbf42d2a606f6b7038881cff5ec3795fdf953"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -15,7 +15,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="de14e61098b742251b34f856e48649db8bed552c"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bc3bbf42d2a606f6b7038881cff5ec3795fdf953"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="de14e61098b742251b34f856e48649db8bed552c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="bc3bbf42d2a606f6b7038881cff5ec3795fdf953"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="7f9ec13a30f1b2cc8bdb1a199b7da54b9ab8860f"/>

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="de14e61098b742251b34f856e48649db8bed552c"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bc3bbf42d2a606f6b7038881cff5ec3795fdf953"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -2243,31 +2243,10 @@ nsresult MediaDecoderStateMachine::RunStateMachine()
StopPlayback();
}
// Put a task in the decode queue to abort any decoding operations.
// The reader is not supposed to put any tasks to deliver samples into
// the queue after we call this (unless we request another sample from it).
RefPtr<nsIRunnable> task;
task = NS_NewRunnableMethod(mReader, &MediaDecoderReader::ResetDecode);
mDecodeTaskQueue->Dispatch(task);
{
// Wait for the thread decoding to abort decoding operations and run
// any pending callbacks. This is important, as we don't want any
// pending tasks posted to the task queue by the reader to deliver
// any samples after we've posted the reader Shutdown() task below,
// as the sample-delivery tasks will keep video frames alive until
// after we've called Reader::Shutdown(), and shutdown on B2G will
// fail as there are outstanding video frames alive.
ReentrantMonitorAutoExit exitMon(mDecoder->GetReentrantMonitor());
mDecodeTaskQueue->Flush();
}
// We must reset playback so that all references to frames queued
// in the state machine are dropped, else the Shutdown() call below
// can fail on B2G.
ResetPlayback();
FlushDecoding();
// Put a task in the decode queue to shutdown the reader.
RefPtr<nsIRunnable> task;
task = NS_NewRunnableMethod(mReader, &MediaDecoderReader::Shutdown);
mDecodeTaskQueue->Dispatch(task);
@ -2325,6 +2304,7 @@ nsresult MediaDecoderStateMachine::RunStateMachine()
if (IsPlaying()) {
StopPlayback();
}
FlushDecoding();
StopAudioThread();
// Now that those threads are stopped, there's no possibility of
// mPendingWakeDecoder being needed again. Revoke it.
@ -2467,6 +2447,38 @@ nsresult MediaDecoderStateMachine::RunStateMachine()
return NS_OK;
}
void
MediaDecoderStateMachine::FlushDecoding()
{
NS_ASSERTION(OnStateMachineThread() || OnDecodeThread(),
"Should be on state machine or decode thread.");
mDecoder->GetReentrantMonitor().AssertNotCurrentThreadIn();
// Put a task in the decode queue to abort any decoding operations.
// The reader is not supposed to put any tasks to deliver samples into
// the queue after we call this (unless we request another sample from it).
RefPtr<nsIRunnable> task;
task = NS_NewRunnableMethod(mReader, &MediaDecoderReader::ResetDecode);
mDecodeTaskQueue->Dispatch(task);
{
// Wait for the thread decoding to abort decoding operations and run
// any pending callbacks. This is important, as we don't want any
// pending tasks posted to the task queue by the reader to deliver
// any samples after we've posted the reader Shutdown() task below,
// as the sample-delivery tasks will keep video frames alive until
// after we've called Reader::Shutdown(), and shutdown on B2G will
// fail as there are outstanding video frames alive.
ReentrantMonitorAutoExit exitMon(mDecoder->GetReentrantMonitor());
mDecodeTaskQueue->Flush();
}
// We must reset playback so that all references to frames queued
// in the state machine are dropped, else subsequent calls to Shutdown()
// or ReleaseMediaResources() can fail on B2G.
ResetPlayback();
}
void MediaDecoderStateMachine::RenderVideoFrame(VideoData* aData,
TimeStamp aTarget)
{

View File

@ -445,6 +445,11 @@ protected:
// Resets playback timing data. Called when we seek, on the decode thread.
void ResetPlayback();
// Orders the Reader to stop decoding, and blocks until the Reader
// has stopped decoding and finished delivering samples, then calls
// ResetPlayback() to discard all enqueued data.
void FlushDecoding();
// Returns the audio clock, if we have audio, or -1 if we don't.
// Called on the state machine thread.
int64_t GetAudioClock();

View File

@ -420,5 +420,26 @@ GMPParent::ReadGMPMetaData()
return NS_OK;
}
bool
GMPParent::CanBeSharedCrossOrigin() const
{
return mOrigin.IsEmpty();
}
bool
GMPParent::CanBeUsedFrom(const nsAString& aOrigin) const
{
return (mOrigin.IsEmpty() && State() == GMPStateNotLoaded) ||
mOrigin.Equals(aOrigin);
}
void
GMPParent::SetOrigin(const nsAString& aOrigin)
{
MOZ_ASSERT(!aOrigin.IsEmpty());
MOZ_ASSERT(CanBeUsedFrom(aOrigin));
mOrigin = aOrigin;
}
} // namespace gmp
} // namespace mozilla

View File

@ -56,6 +56,27 @@ public:
nsIThread* GMPThread();
#endif
// A GMP can either be a single instance shared across all origins (like
// in the OpenH264 case), or we can require a new plugin instance for every
// origin running the plugin (as in the EME plugin case).
//
// Plugins are associated with an origin by calling SetOrigin() before
// loading.
//
// If a plugin has no origin specified and it is loaded, it is assumed to
// be shared across origins.
// Specifies that a GMP can only work with the specified origin.
void SetOrigin(const nsAString& aOrigin);
// Returns true if a plugin can be or is being used across multiple origins.
bool CanBeSharedCrossOrigin() const;
// A GMP can be used from an origin if it's already been set to work with
// that origin, or if it's not been set to work with any origin and has
// not yet been loaded (i.e. it's not shared across origins).
bool CanBeUsedFrom(const nsAString& aOrigin) const;
private:
~GMPParent();
bool EnsureProcessLoaded();
@ -80,6 +101,9 @@ private:
#ifdef DEBUG
nsCOMPtr<nsIThread> mGMPThread;
#endif
// Origin the plugin is assigned to, or empty if the the plugin is not
// assigned to an origin.
nsAutoString mOrigin;
};
} // namespace gmp

View File

@ -191,16 +191,23 @@ GeckoMediaPluginService::GetThread(nsIThread** aThread)
}
NS_IMETHODIMP
GeckoMediaPluginService::GetGMPVideoDecoderVP8(GMPVideoHost** aOutVideoHost, GMPVideoDecoder** aGMPVD)
GeckoMediaPluginService::GetGMPVideoDecoder(nsTArray<nsCString>* aTags,
const nsAString& aOrigin,
GMPVideoHost** aOutVideoHost,
GMPVideoDecoder** aGMPVD)
{
MOZ_ASSERT(NS_GetCurrentThread() == mGMPThread);
NS_ENSURE_ARG(aTags && aTags->Length() > 0);
NS_ENSURE_ARG(aOutVideoHost);
NS_ENSURE_ARG(aGMPVD);
if (mShuttingDownOnGMPThread) {
return NS_ERROR_FAILURE;
}
nsRefPtr<GMPParent> gmp = SelectPluginForAPI(NS_LITERAL_CSTRING("decode-video"),
NS_LITERAL_CSTRING("vp8"));
nsRefPtr<GMPParent> gmp = SelectPluginForAPI(aOrigin,
NS_LITERAL_CSTRING("decode-video"),
*aTags);
if (!gmp) {
return NS_ERROR_FAILURE;
}
@ -218,16 +225,23 @@ GeckoMediaPluginService::GetGMPVideoDecoderVP8(GMPVideoHost** aOutVideoHost, GMP
}
NS_IMETHODIMP
GeckoMediaPluginService::GetGMPVideoEncoderVP8(GMPVideoHost** aOutVideoHost, GMPVideoEncoder** aGMPVE)
GeckoMediaPluginService::GetGMPVideoEncoder(nsTArray<nsCString>* aTags,
const nsAString& aOrigin,
GMPVideoHost** aOutVideoHost,
GMPVideoEncoder** aGMPVE)
{
MOZ_ASSERT(NS_GetCurrentThread() == mGMPThread);
NS_ENSURE_ARG(aTags && aTags->Length() > 0);
NS_ENSURE_ARG(aOutVideoHost);
NS_ENSURE_ARG(aGMPVE);
if (mShuttingDownOnGMPThread) {
return NS_ERROR_FAILURE;
}
nsRefPtr<GMPParent> gmp = SelectPluginForAPI(NS_LITERAL_CSTRING("encode-video"),
NS_LITERAL_CSTRING("vp8"));
nsRefPtr<GMPParent> gmp = SelectPluginForAPI(aOrigin,
NS_LITERAL_CSTRING("encode-video"),
*aTags);
if (!gmp) {
return NS_ERROR_FAILURE;
}
@ -259,30 +273,50 @@ GeckoMediaPluginService::UnloadPlugins()
}
GMPParent*
GeckoMediaPluginService::SelectPluginForAPI(const nsCString& aAPI,
const nsCString& aTag)
GeckoMediaPluginService::SelectPluginForAPI(const nsAString& aOrigin,
const nsCString& aAPI,
const nsTArray<nsCString>& aTags)
{
MOZ_ASSERT(NS_GetCurrentThread() == mGMPThread);
GMPParent* gmp = SelectPluginFromListForAPI(aAPI, aTag);
GMPParent* gmp = SelectPluginFromListForAPI(aOrigin, aAPI, aTags);
if (gmp) {
return gmp;
}
RefreshPluginList();
return SelectPluginFromListForAPI(aAPI, aTag);
return SelectPluginFromListForAPI(aOrigin, aAPI, aTags);
}
GMPParent*
GeckoMediaPluginService::SelectPluginFromListForAPI(const nsCString& aAPI,
const nsCString& aTag)
GeckoMediaPluginService::SelectPluginFromListForAPI(const nsAString& aOrigin,
const nsCString& aAPI,
const nsTArray<nsCString>& aTags)
{
MOZ_ASSERT(NS_GetCurrentThread() == mGMPThread);
for (uint32_t i = 0; i < mPlugins.Length(); i++) {
GMPParent* gmp = mPlugins[i];
if (gmp->SupportsAPI(aAPI, aTag)) {
bool supportsAllTags = true;
for (uint32_t t = 0; t < aTags.Length(); t++) {
const nsCString& tag = aTags[t];
if (!gmp->SupportsAPI(aAPI, tag)) {
supportsAllTags = false;
break;
}
}
if (!supportsAllTags) {
continue;
}
if (aOrigin.IsEmpty()) {
if (gmp->CanBeSharedCrossOrigin()) {
return gmp;
}
} else if (gmp->CanBeUsedFrom(aOrigin)) {
if (!aOrigin.IsEmpty()) {
gmp->SetOrigin(aOrigin);
}
return gmp;
}
}

View File

@ -38,8 +38,12 @@ public:
private:
~GeckoMediaPluginService();
GMPParent* SelectPluginFromListForAPI(const nsCString& aAPI, const nsCString& aTag);
GMPParent* SelectPluginForAPI(const nsCString& aAPI, const nsCString& aTag);
GMPParent* SelectPluginFromListForAPI(const nsAString& aOrigin,
const nsCString& aAPI,
const nsTArray<nsCString>& aTags);
GMPParent* SelectPluginForAPI(const nsAString& aOrigin,
const nsCString& aAPI,
const nsTArray<nsCString>& aTags);
void UnloadPlugins();
void RefreshPluginList();

View File

@ -96,7 +96,7 @@ GMPVideoHostImpl::ActorDestroyed()
mEncodedFrames[i - 1]->ActorDestroyed();
mEncodedFrames.RemoveElementAt(i - 1);
}
mSharedMemMgr = nullptr;
mSharedMemMgr = nullptr;
}
void

View File

@ -5,8 +5,11 @@
#include "nsISupports.idl"
#include "nsIThread.idl"
#include "nsIPrincipal.idl"
%{C++
#include "nsTArray.h"
#include "nsStringGlue.h"
class GMPVideoDecoder;
class GMPVideoEncoder;
class GMPVideoHost;
@ -16,6 +19,7 @@ class GMPVideoHost;
[ptr] native GMPVideoEncoder(GMPVideoEncoder);
[ptr] native GMPVideoHost(GMPVideoHost);
[ptr] native MessageLoop(MessageLoop);
[ptr] native TagArray(nsTArray<nsCString>);
[uuid(BF5A9086-70F5-4D38-832D-1609BBF963CD)]
interface mozIGeckoMediaPluginService : nsISupports
@ -24,11 +28,19 @@ interface mozIGeckoMediaPluginService : nsISupports
// Callable from any thread.
readonly attribute nsIThread thread;
// Returns a video decoder API object that should support VP8.
// Returns a video decoder that supports the specified tags.
// The array of tags should at least contain a codec tag, and optionally
// other tags such as for EME keysystem.
// Callable only on GMP thread.
GMPVideoDecoder getGMPVideoDecoderVP8(out GMPVideoHost outVideoHost);
GMPVideoDecoder getGMPVideoDecoder(in TagArray tags,
[optional] in AString origin,
out GMPVideoHost outVideoHost);
// Returns a video encoder API object that should support VP8.
// Returns a video encoder that supports the specified tags.
// The array of tags should at least contain a codec tag, and optionally
// other tags.
// Callable only on GMP thread.
GMPVideoEncoder getGMPVideoEncoderVP8(out GMPVideoHost outVideoHost);
GMPVideoEncoder getGMPVideoEncoder(in TagArray tags,
[optional] in AString origin,
out GMPVideoHost outVideoHost);
};

View File

@ -39,23 +39,23 @@ function startup() {
db.createTable("test", "id TEXT, value INTEGER");
var stmt = db.createStatement("INSERT INTO test (id, value) VALUES (?,?)");
stmt.bindStringParameter(0, "test1");
stmt.bindInt32Parameter(1, 0);
stmt.bindByIndex(0, "test1");
stmt.bindByIndex(1, 0);
stmt.execute();
stmt.bindStringParameter(0, "test2");
stmt.bindInt32Parameter(1, 2147483647);
stmt.bindByIndex(0, "test2");
stmt.bindByIndex(1, 2147483647);
stmt.execute();
stmt.bindStringParameter(0, "test3");
stmt.bindInt32Parameter(1, -2147483648);
stmt.bindByIndex(0, "test3");
stmt.bindByIndex(1, -2147483648);
stmt.execute();
stmt.bindStringParameter(0, "test4");
stmt.bindInt64Parameter(1, 0);
stmt.bindByIndex(0, "test4");
stmt.bindByIndex(1, 0);
stmt.execute();
stmt.bindStringParameter(0, "test5");
stmt.bindInt64Parameter(1, 3147483647);
stmt.bindByIndex(0, "test5");
stmt.bindByIndex(1, 3147483647);
stmt.execute();
stmt.bindStringParameter(0, "test6");
stmt.bindInt64Parameter(1, -3147483648);
stmt.bindByIndex(0, "test6");
stmt.bindByIndex(1, -3147483648);
stmt.execute();
stmt.finalize();

View File

@ -11,7 +11,6 @@ const Cr = Components.results;
Cu.import("resource://gre/modules/osfile.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Promise.jsm");

View File

@ -145,6 +145,12 @@ function startTest() {
var gCount = 0;
var gFrameMsgCounts = {
'input': 0,
'im0': 0,
'im1': 0
};
function next(msg) {
let wrappedMsg = SpecialPowers.wrap(msg);
let from = wrappedMsg.data.from;
@ -156,21 +162,49 @@ function next(msg) {
return;
}
gCount++;
let fromId = from;
if (from === 'im') {
fromId += value[1];
}
gFrameMsgCounts[fromId]++;
// The texts sent from the first and the second input method are '#0' and
// '#1' respectively.
switch (gCount) {
case 1:
is(from, 'im', 'Message sequence unexpected (1).');
is(value, '#0true', 'First frame should get the context first.');
// Do nothing and wait for the input to show up in input frame.
break;
case 0:
switch (fromId) {
case 'im0':
if (gFrameMsgCounts.im0 === 1) {
is(value, '#0true', 'First frame should get the context first.');
} else {
ok(false, 'Unexpected multiple messages from im0.')
}
case 2:
is(from, 'input', 'Message sequence unexpected (2).');
is(value, '#0hello',
'Failed to get correct input from the first iframe.');
break;
case 'im1':
is(false, 'Shouldn\'t be hearing anything from second frame.');
break;
case 'input':
if (gFrameMsgCounts.input === 1) {
is(value, '#0hello',
'Failed to get correct input from the first iframe.');
} else {
ok(false, 'Unexpected multiple messages from input.')
}
break;
}
if (gFrameMsgCounts.input !== 1 ||
gFrameMsgCounts.im0 !== 1 ||
gFrameMsgCounts.im1 !== 0) {
return;
}
gCount++;
let req0 = gFrames[0].setInputMethodActive(false);
req0.onsuccess = function() {
@ -181,43 +215,64 @@ function next(msg) {
};
let req1 = gFrames[1].setInputMethodActive(true);
req1.onsuccess = function() {
ok(true, 'setInputMethodActive succeeded (1).');
ok(true, 'setInputMethodActive succeeded (1).');
};
req1.onerror = function() {
ok(false, 'setInputMethodActive failed (1): ' + this.error.name);
ok(false, 'setInputMethodActive failed (1): ' + this.error.name);
};
break;
case 3:
is(from, 'im', 'Message sequence unexpected (3).');
is(value, '#0false', 'First frame should have the context removed.');
// Do nothing and wait for the second frame to get the context;
break;
case 1:
switch (fromId) {
case 'im0':
if (gFrameMsgCounts.im0 === 2) {
is(value, '#0false', 'First frame should have the context removed.');
} else {
ok(false, 'Unexpected multiple messages from im0.')
}
break;
case 4:
is(from, 'im', 'Message sequence unexpected (4).');
is(value, '#1true', 'Second frame should get the context.');
// Do nothing and wait for the input to show up in input frame.
break;
case 'im1':
if (gFrameMsgCounts.im1 === 1) {
is(value, '#1true', 'Second frame should get the context.');
} else {
ok(false, 'Unexpected multiple messages from im0.')
}
case 5:
is(from, 'input', 'Message sequence unexpected (5).');
is(value, '#0#1hello',
'Failed to get correct input from the second iframe.');
break;
case 'input':
if (gFrameMsgCounts.input === 2) {
is(value, '#0#1hello',
'Failed to get correct input from the second iframe.');
} else {
ok(false, 'Unexpected multiple messages from input.')
}
break;
}
if (gFrameMsgCounts.input !== 2 ||
gFrameMsgCounts.im0 !== 2 ||
gFrameMsgCounts.im1 !== 1) {
return;
}
gCount++;
// Receive the second input from the second iframe.
// Deactive the second iframe.
let req3 = gFrames[1].setInputMethodActive(false);
req3.onsuccess = function() {
ok(true, 'setInputMethodActive(false) succeeded (3).');
ok(true, 'setInputMethodActive(false) succeeded (2).');
};
req3.onerror = function() {
ok(false, 'setInputMethodActive(false) failed (3): ' + this.error.name);
ok(false, 'setInputMethodActive(false) failed (2): ' + this.error.name);
};
break;
case 6:
is(from, 'im', 'Message sequence unexpected (6).');
case 2:
is(fromId, 'im1', 'Message sequence unexpected (3).');
is(value, '#1false', 'Second frame should have the context removed.');
tearDown();

View File

@ -15,9 +15,11 @@ const Cu = Components.utils;
const Cc = Components.classes;
const Ci = Components.interfaces;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/IndexedDBHelper.jsm");
Cu.import("resource://gre/modules/PhoneNumberUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PhoneNumberUtils",
"resource://gre/modules/PhoneNumberUtils.jsm");
Cu.importGlobalProperties(["indexedDB"]);
/* all exported symbols need to be bound to this on B2G - Bug 961777 */

View File

@ -15,8 +15,11 @@ this.EXPORTED_SYMBOLS = ["ContactService"];
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/ContactDB.jsm");
Cu.import("resource://gre/modules/PhoneNumberUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ContactDB",
"resource://gre/modules/ContactDB.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PhoneNumberUtils",
"resource://gre/modules/PhoneNumberUtils.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "ppmm",
"@mozilla.org/parentprocessmessagemanager;1",

View File

@ -371,13 +371,13 @@ UpgradeSchemaFrom4To5(mozIStorageConnection* aConnection)
{
mozStorageStatementScoper scoper(stmt);
rv = stmt->BindStringParameter(0, name);
rv = stmt->BindStringByName(NS_LITERAL_CSTRING("name"), name);
NS_ENSURE_SUCCESS(rv, rv);
rv = stmt->BindInt32Parameter(1, intVersion);
rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("version"), intVersion);
NS_ENSURE_SUCCESS(rv, rv);
rv = stmt->BindInt64Parameter(2, dataVersion);
rv = stmt->BindInt64ByName(NS_LITERAL_CSTRING("dataVersion"), dataVersion);
NS_ENSURE_SUCCESS(rv, rv);
rv = stmt->Execute();

View File

@ -11,8 +11,11 @@ Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/PhoneNumberUtils.jsm");
Cu.importGlobalProperties(["indexedDB"]);
var RIL = {};
Cu.import("resource://gre/modules/ril_consts.js", RIL);
XPCOMUtils.defineLazyGetter(this, "RIL", function () {
let obj = {};
Cu.import("resource://gre/modules/ril_consts.js", obj);
return obj;
});
const RIL_GETMESSAGESCURSOR_CID =
Components.ID("{484d1ad8-840e-4782-9dc4-9ebc4d914937}");

View File

@ -8,9 +8,13 @@
this.EXPORTED_SYMBOLS = ["PhoneNumber"];
Components.utils.import("resource://gre/modules/PhoneNumberMetaData.jsm");
Components.utils.import("resource://gre/modules/PhoneNumberNormalizer.jsm");
const Cu = Components.utils;
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
XPCOMUtils.defineLazyModuleGetter(this, "PHONE_NUMBER_META_DATA",
"resource://gre/modules/PhoneNumberMetaData.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PhoneNumberNormalizer",
"resource://gre/modules/PhoneNumberNormalizer.jsm");
this.PhoneNumber = (function (dataBase) {
// Use strict in our context only - users might not want it
'use strict';

View File

@ -14,8 +14,10 @@ const Ci = Components.interfaces;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
Cu.import("resource://gre/modules/PhoneNumberNormalizer.jsm");
Cu.import("resource://gre/modules/mcc_iso3166_table.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PhoneNumberNormalizer",
"resource://gre/modules/PhoneNumberNormalizer.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "MCC_ISO3166_TABLE",
"resource://gre/modules/mcc_iso3166_table.jsm");
#ifdef MOZ_B2G_RIL
XPCOMUtils.defineLazyServiceGetter(this, "mobileConnection",
@ -196,7 +198,8 @@ this.PhoneNumberUtils = {
let inParent = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime)
.processType == Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
if (inParent) {
Cu.import("resource://gre/modules/PhoneNumber.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PhoneNumber",
"resource://gre/modules/PhoneNumber.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "ppmm",
"@mozilla.org/parentprocessmessagemanager;1",
"nsIMessageListenerManager");

View File

@ -3199,12 +3199,16 @@ PluginInstanceChild::PaintRectToSurface(const nsIntRect& aRect,
#endif
if (mIsTransparent && !CanPaintOnBackground()) {
// Clear surface content for transparent rendering
nsRefPtr<gfxContext> ctx = new gfxContext(renderSurface);
ctx->SetDeviceColor(aColor);
ctx->SetOperator(gfxContext::OPERATOR_SOURCE);
ctx->Rectangle(GfxFromNsRect(plPaintRect));
ctx->Fill();
RefPtr<DrawTarget> dt = CreateDrawTargetForSurface(renderSurface);
gfx::Rect rect(plPaintRect.x, plPaintRect.y,
plPaintRect.width, plPaintRect.height);
// Moz2D treats OP_SOURCE operations as unbounded, so we need to
// clip to the rect that we want to fill:
dt->PushClipRect(rect);
dt->FillRect(rect, ColorPattern(ToColor(aColor)),
DrawOptions(1.f, CompositionOp::OP_SOURCE));
dt->PopClip();
dt->Flush();
}
PaintRectToPlatformSurface(plPaintRect, renderSurface);

View File

@ -22,8 +22,11 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
let NFC = {};
Cu.import("resource://gre/modules/nfc_consts.js", NFC);
XPCOMUtils.defineLazyGetter(this, "NFC", function () {
let obj = {};
Cu.import("resource://gre/modules/nfc_consts.js", obj);
return obj;
});
Cu.import("resource://gre/modules/systemlibs.js");
const NFC_ENABLED = libcutils.property_get("ro.moz.nfc.enabled", "false") === "true";

View File

@ -23,8 +23,11 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/DOMRequestHelper.jsm");
let NFC = {};
Cu.import("resource://gre/modules/nfc_consts.js", NFC);
XPCOMUtils.defineLazyGetter(this, "NFC", function () {
let obj = {};
Cu.import("resource://gre/modules/nfc_consts.js", obj);
return obj;
});
Cu.import("resource://gre/modules/systemlibs.js");
const NFC_ENABLED = libcutils.property_get("ro.moz.nfc.enabled", "false") === "true";

View File

@ -21,8 +21,11 @@ Cu.import("resource://gre/modules/DOMRequestHelper.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
var RIL = {};
Cu.import("resource://gre/modules/ril_consts.js", RIL);
XPCOMUtils.defineLazyGetter(this, "RIL", function () {
let obj = {};
Cu.import("resource://gre/modules/ril_consts.js", obj);
return obj;
});
const NS_XPCOM_SHUTDOWN_OBSERVER_ID = "xpcom-shutdown";

View File

@ -24,8 +24,11 @@ Cu.import("resource://gre/modules/systemlibs.js");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/FileUtils.jsm");
var RIL = {};
Cu.import("resource://gre/modules/ril_consts.js", RIL);
XPCOMUtils.defineLazyGetter(this, "RIL", function () {
let obj = {};
Cu.import("resource://gre/modules/ril_consts.js", obj);
return obj;
});
// Ril quirk to attach data registration on demand.
let RILQUIRKS_DATA_REGISTRATION_ON_DEMAND =
@ -1629,9 +1632,7 @@ WorkerMessenger.prototype = {
libcutils.property_get("ro.moz.ril.send_stk_profile_dl", "false") == "true",
dataRegistrationOnDemand: RILQUIRKS_DATA_REGISTRATION_ON_DEMAND,
subscriptionControl: RILQUIRKS_SUBSCRIPTION_CONTROL
},
rilEmergencyNumbers: libcutils.property_get("ril.ecclist") ||
libcutils.property_get("ro.ril.ecclist")
}
};
this.send(null, "setInitialOptions", options);

View File

@ -52,9 +52,6 @@ if (!this.debug) {
};
}
let RIL_EMERGENCY_NUMBERS;
const DEFAULT_EMERGENCY_NUMBERS = ["112", "911"];
// Timeout value for emergency callback mode.
const EMERGENCY_CB_MODE_TIMEOUT_MS = 300000; // 5 mins = 300000 ms.
@ -1555,7 +1552,7 @@ RilObject.prototype = {
cachedDialRequest : null,
/**
* Dial the phone.
* Dial a non-emergency number.
*
* @param number
* String containing the number to dial.
@ -1564,34 +1561,13 @@ RilObject.prototype = {
* @param uusInfo
* Integer doing something XXX TODO
*/
dial: function(options) {
dialNonEmergencyNumber: function(options) {
let onerror = (function onerror(options, errorMsg) {
options.success = false;
options.errorMsg = errorMsg;
this.sendChromeMessage(options);
}).bind(this, options);
if (this._isEmergencyNumber(options.number)) {
this.dialEmergencyNumber(options, onerror);
} else {
if (!this._isCdma) {
// TODO: Both dial() and sendMMI() functions should be unified at some
// point in the future. In the mean time we handle temporary CLIR MMI
// commands through the dial() function. Please see bug 889737.
let mmi = this._parseMMI(options.number);
if (mmi && this._isTemporaryModeCLIR(mmi)) {
options.number = mmi.dialNumber;
// In temporary mode, MMI_PROCEDURE_ACTIVATION means allowing CLI
// presentation, i.e. CLIR_SUPPRESSION. See TS 22.030, Annex B.
options.clirMode = mmi.procedure == MMI_PROCEDURE_ACTIVATION ?
CLIR_SUPPRESSION : CLIR_INVOCATION;
}
}
this.dialNonEmergencyNumber(options, onerror);
}
},
dialNonEmergencyNumber: function(options, onerror) {
if (this.radioState == GECKO_RADIOSTATE_OFF) {
// Notify error in establishing the call without radio.
onerror(GECKO_ERROR_RADIO_NOT_AVAILABLE);
@ -1609,17 +1585,41 @@ RilObject.prototype = {
this.exitEmergencyCbMode();
}
if (this._isCdma && Object.keys(this.currentCalls).length == 1) {
// Make a Cdma 3way call.
options.featureStr = options.number;
this.sendCdmaFlashCommand(options);
} else {
options.request = REQUEST_DIAL;
this.sendDialRequest(options);
if (!this._isCdma) {
// TODO: Both dial() and sendMMI() functions should be unified at some
// point in the future. In the mean time we handle temporary CLIR MMI
// commands through the dial() function. Please see bug 889737.
let mmi = this._parseMMI(options.number);
if (mmi && this._isTemporaryModeCLIR(mmi)) {
options.number = mmi.dialNumber;
// In temporary mode, MMI_PROCEDURE_ACTIVATION means allowing CLI
// presentation, i.e. CLIR_SUPPRESSION. See TS 22.030, Annex B.
options.clirMode = mmi.procedure == MMI_PROCEDURE_ACTIVATION ?
CLIR_SUPPRESSION : CLIR_INVOCATION;
}
}
options.request = REQUEST_DIAL;
this.sendDialRequest(options);
},
dialEmergencyNumber: function(options, onerror) {
/**
* Dial an emergency number.
*
* @param number
* String containing the number to dial.
* @param clirMode
* Integer for showing/hidding the caller Id to the called party.
* @param uusInfo
* Integer doing something XXX TODO
*/
dialEmergencyNumber: function(options) {
let onerror = (function onerror(options, errorMsg) {
options.success = false;
options.errorMsg = errorMsg;
this.sendChromeMessage(options);
}).bind(this, options);
options.request = RILQUIRKS_REQUEST_USE_DIAL_EMERGENCY_CALL ?
REQUEST_DIAL_EMERGENCY_CALL : REQUEST_DIAL;
if (this.radioState == GECKO_RADIOSTATE_OFF) {
@ -1636,20 +1636,20 @@ RilObject.prototype = {
return;
}
this.sendDialRequest(options);
},
sendDialRequest: function(options) {
if (this._isCdma && Object.keys(this.currentCalls).length == 1) {
// Make a Cdma 3way call.
options.featureStr = options.number;
this.sendCdmaFlashCommand(options);
} else {
this.sendDialRequest(options);
this.telephonyRequestQueue.push(options.request, this.sendRilRequestDial,
options);
}
},
sendDialRequest: function(options) {
this.telephonyRequestQueue.push(options.request, this.sendRilRequestDial,
options);
},
sendRilRequestDial: function(options) {
let Buf = this.context.Buf;
Buf.newParcel(options.request, options);
@ -2417,9 +2417,8 @@ RilObject.prototype = {
return false;
}
if (this._isEmergencyNumber(mmiString)) {
return false;
}
// TODO: Should take care of checking if the string is an emergency number
// in Bug 889737. See Bug 1023141 for more background.
// In a call case.
if (Object.getOwnPropertyNames(this.currentCalls).length > 0) {
@ -3309,38 +3308,18 @@ RilObject.prototype = {
},
/**
* Check a given number against the list of emergency numbers provided by the RIL.
* Checks whether to temporarily suppress caller id for the call.
*
* @param number
* The number to look up.
* @param mmi
* MMI full object.
*/
_isEmergencyNumber: function(number) {
// Check ril provided numbers first.
let numbers = RIL_EMERGENCY_NUMBERS;
if (numbers) {
numbers = numbers.split(",");
} else {
// No ecclist system property, so use our own list.
numbers = DEFAULT_EMERGENCY_NUMBERS;
}
return numbers.indexOf(number) != -1;
},
/**
* Checks whether to temporarily suppress caller id for the call.
*
* @param mmi
* MMI full object.
*/
_isTemporaryModeCLIR: function(mmi) {
return (mmi &&
mmi.serviceCode == MMI_SC_CLIR &&
mmi.dialNumber &&
(mmi.procedure == MMI_PROCEDURE_ACTIVATION ||
mmi.procedure == MMI_PROCEDURE_DEACTIVATION));
},
_isTemporaryModeCLIR: function(mmi) {
return (mmi &&
mmi.serviceCode == MMI_SC_CLIR &&
mmi.dialNumber &&
(mmi.procedure == MMI_PROCEDURE_ACTIVATION ||
mmi.procedure == MMI_PROCEDURE_DEACTIVATION));
},
/**
* Report STK Service is running.
@ -4055,6 +4034,7 @@ RilObject.prototype = {
for (let i in newCalls) {
if (newCalls[i].state !== CALL_STATE_INCOMING) {
callIndex = newCalls[i].callIndex;
newCalls[i].isEmergency = options.isEmergency;
break;
}
}
@ -4105,9 +4085,9 @@ RilObject.prototype = {
newCall.isOutgoing = true;
}
// Set flag for outgoing emergency call.
newCall.isEmergency = newCall.isOutgoing &&
this._isEmergencyNumber(newCall.number);
if (newCall.isEmergency === undefined) {
newCall.isEmergency = false;
}
// Set flag for conference.
newCall.isConference = newCall.isMpty ? true : false;

View File

@ -122,8 +122,9 @@ add_test(function test_request_exit_emergencyCbMode_when_dial() {
};
// Dial non-emergency call.
context.RIL.dial({number: "0912345678",
isDialEmergency: false});
context.RIL.dialNonEmergencyNumber({number: "0912345678",
isEmergency: false,
isDialEmergency: false});
// Should clear timeout event.
do_check_eq(context.RIL._exitEmergencyCbModeTimeoutID, null);

View File

@ -10,9 +10,13 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/systemlibs.js");
var RIL = {};
Cu.import("resource://gre/modules/ril_consts.js", RIL);
XPCOMUtils.defineLazyGetter(this, "RIL", function () {
let obj = {};
Cu.import("resource://gre/modules/ril_consts.js", obj);
return obj;
});
const GONK_TELEPHONYSERVICE_CONTRACTID =
"@mozilla.org/telephony/gonktelephonyservice;1";
@ -47,6 +51,8 @@ const AUDIO_STATE_NAME = [
"PHONE_STATE_IN_CALL"
];
const DEFAULT_EMERGENCY_NUMBERS = ["112", "911"];
let DEBUG;
function debug(s) {
dump("TelephonyService: " + s + "\n");
@ -327,6 +333,26 @@ TelephonyService.prototype = {
}).bind(this));
},
/**
* Check a given number against the list of emergency numbers provided by the
* RIL.
*
* @param aNumber
* The number to look up.
*/
_isEmergencyNumber: function(aNumber) {
// Check ril provided numbers first.
let numbers = libcutils.property_get("ril.ecclist") ||
libcutils.property_get("ro.ril.ecclist");
if (numbers) {
numbers = numbers.split(",");
} else {
// No ecclist system property, so use our own list.
numbers = DEFAULT_EMERGENCY_NUMBERS;
}
return numbers.indexOf(aNumber) != -1;
},
/**
* nsITelephonyService interface.
*/
@ -474,9 +500,14 @@ TelephonyService.prototype = {
this.notifyCallStateChanged(aClientId, parentCall);
};
let isEmergencyNumber = this._isEmergencyNumber(aNumber);
let msg = isEmergencyNumber ?
"dialEmergencyNumber" :
"dialNonEmergencyNumber";
this.isDialing = true;
this._getClient(aClientId).sendWorkerMessage("dial", {
this._getClient(aClientId).sendWorkerMessage(msg, {
number: aNumber,
isEmergency: isEmergencyNumber,
isDialEmergency: aIsEmergency
}, (function(response) {
this.isDialing = false;

View File

@ -14,12 +14,20 @@ let emulator = (function() {
let pendingCmdCount = 0;
let originalRunEmulatorCmd = runEmulatorCmd;
let pendingShellCount = 0;
let originalRunEmulatorShell = runEmulatorShell;
// Overwritten it so people could not call this function directly.
runEmulatorCmd = function() {
throw "Use emulator.runWithCallback(cmd, callback) instead of runEmulatorCmd";
throw "Use emulator.runCmdWithCallback(cmd, callback) instead of runEmulatorCmd";
};
function run(cmd) {
// Overwritten it so people could not call this function directly.
runEmulatorShell = function() {
throw "Use emulator.runShellCmd(cmd, callback) instead of runEmulatorShell";
};
function runCmd(cmd) {
let deferred = Promise.defer();
pendingCmdCount++;
@ -36,14 +44,29 @@ let emulator = (function() {
return deferred.promise;
}
function runWithCallback(cmd, callback) {
run(cmd).then(result => {
function runCmdWithCallback(cmd, callback) {
runCmd(cmd).then(result => {
if (callback && typeof callback === "function") {
callback(result);
}
});
}
/**
* @return Promise
*/
function runShellCmd(aCommands) {
let deferred = Promise.defer();
++pendingShellCount;
originalRunEmulatorShell(aCommands, function(aResult) {
--pendingShellCount;
deferred.resolve(aResult);
});
return deferred.promise;
}
/**
* @return Promise
*/
@ -53,15 +76,16 @@ let emulator = (function() {
waitFor(function() {
deferred.resolve();
}, function() {
return pendingCmdCount === 0;
return pendingCmdCount === 0 && pendingShellCount === 0;
});
return deferred.promise;
}
return {
run: run,
runWithCallback: runWithCallback,
runCmd: runCmd,
runCmdWithCallback: runCmdWithCallback,
runShellCmd: runShellCmd,
waitFinish: waitFinish
};
}());
@ -123,7 +147,7 @@ let emulator = (function() {
return Promise.all(hangUpPromises)
.then(() => {
return emulator.run("gsm clear");
return emulator.runCmd("gsm clear").then(waitForNoCall);
})
.then(waitForNoCall);
}
@ -361,7 +385,7 @@ let emulator = (function() {
* @return A deferred promise.
*/
function checkEmulatorCallList(expectedCallList) {
return emulator.run("gsm list").then(result => {
return emulator.runCmd("gsm list").then(result => {
log("Call list is now: " + result);
for (let i = 0; i < expectedCallList.length; ++i) {
is(result[i], expectedCallList[i], "emulator calllist");
@ -611,7 +635,7 @@ let emulator = (function() {
numberPresentation = numberPresentation || "";
name = name || "";
namePresentation = namePresentation || "";
emulator.run("gsm call " + number + "," + numberPresentation + "," + name +
emulator.runCmd("gsm call " + number + "," + numberPresentation + "," + name +
"," + namePresentation);
return deferred.promise;
}
@ -634,7 +658,7 @@ let emulator = (function() {
checkEventCallState(event, call, "connected");
deferred.resolve(call);
};
emulator.run("gsm accept " + call.id.number);
emulator.runCmd("gsm accept " + call.id.number);
return deferred.promise;
}
@ -657,7 +681,7 @@ let emulator = (function() {
checkEventCallState(event, call, "disconnected");
deferred.resolve(call);
};
emulator.run("gsm cancel " + call.id.number);
emulator.runCmd("gsm cancel " + call.id.number);
return deferred.promise;
}

View File

@ -31,7 +31,7 @@ function answer() {
return(callDuration >= 2000);
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
function cleanUp(){

View File

@ -7,7 +7,7 @@ MARIONETTE_HEAD_JS = 'head.js';
function muxModem(id) {
let deferred = Promise.defer();
emulator.runWithCallback("mux modem " + id, function() {
emulator.runCmdWithCallback("mux modem " + id, function() {
deferred.resolve();
});

View File

@ -7,7 +7,7 @@ MARIONETTE_HEAD_JS = 'head.js';
function muxModem(id) {
let deferred = Promise.defer();
emulator.runWithCallback("mux modem " + id, function() {
emulator.runCmdWithCallback("mux modem " + id, function() {
deferred.resolve();
});

View File

@ -28,7 +28,7 @@ function dial() {
is(outgoing.state, "alerting");
is(outgoing.emergency, true);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : ringing");
answer();
@ -49,13 +49,13 @@ function answer() {
is(outgoing, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : active");
hangUp();
});
};
emulator.runWithCallback("gsm accept " + number);
emulator.runCmdWithCallback("gsm accept " + number);
}
function hangUp() {
@ -71,12 +71,12 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm cancel " + number);
emulator.runCmdWithCallback("gsm cancel " + number);
}
function cleanUp() {

View File

@ -16,7 +16,7 @@ function dial() {
is(telephony.calls.length, 0);
is(cause, "BadNumberError");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Initial call list: " + result);
cleanUp();
});

View File

@ -4,7 +4,43 @@
MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = 'head.js';
function testEmergencyLabel(number, emergency) {
const DEFAULT_ECC_LIST = "112,911";
function setEccListProperty(list) {
log("Set property ril.ecclist: " + list);
let deferred = Promise.defer();
try {
emulator.runShellCmd(["setprop","ril.ecclist", list]).then(function() {
deferred.resolve(list);
});
} catch (e) {
deferred.reject(e);
}
return deferred.promise;
}
function getEccListProperty() {
log("Get property ril.ecclist.");
let deferred = Promise.defer();
try {
emulator.runShellCmd(["getprop","ril.ecclist"]).then(function(aResult) {
let list = !aResult.length ? "" : aResult[0];
deferred.resolve(list);
});
} catch (e) {
deferred.reject(e);
}
return deferred.promise;
}
function testEmergencyLabel(number, list) {
if (!list) {
list = DEFAULT_ECC_LIST;
}
let index = list.split(",").indexOf(number);
let emergency = index != -1;
log("= testEmergencyLabel = " + number + " should be " +
(emergency ? "emergency" : "normal") + " call");
@ -23,12 +59,27 @@ function testEmergencyLabel(number, emergency) {
}
startTest(function() {
testEmergencyLabel("112", true)
.then(() => testEmergencyLabel("911", true))
.then(() => testEmergencyLabel("0912345678", false))
.then(() => testEmergencyLabel("777", false))
.then(null, () => {
ok(false, 'promise rejects during test.');
let origEccList;
let eccList;
getEccListProperty()
.then(list => {
origEccList = eccList = list;
})
.then(() => testEmergencyLabel("112", eccList))
.then(() => testEmergencyLabel("911", eccList))
.then(() => testEmergencyLabel("0912345678", eccList))
.then(() => testEmergencyLabel("777", eccList))
.then(() => {
eccList = "777,119";
return setEccListProperty(eccList);
})
.then(() => testEmergencyLabel("777", eccList))
.then(() => testEmergencyLabel("119", eccList))
.then(() => testEmergencyLabel("112", eccList))
.then(() => setEccListProperty(origEccList))
.then(null, error => {
ok(false, 'promise rejects during test: ' + error);
})
.then(finish);
});

View File

@ -27,7 +27,7 @@ function dial() {
is(outgoingCall, event.call);
is(outgoingCall.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : ringing");
answer();
@ -47,7 +47,7 @@ function answer() {
is(outgoingCall.state, "connected");
is(outgoingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
@ -61,7 +61,7 @@ function answer() {
}
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
// With one connected call already, simulate an incoming call
@ -80,14 +80,14 @@ function simulateIncoming() {
is(telephony.calls[0], outgoingCall);
is(telephony.calls[1], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
is(result[1], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
// Answer incoming call; original outgoing call should be held
@ -111,7 +111,7 @@ function answerIncoming() {
is(incomingCall, telephony.active);
is(outgoingCall.state, "held");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : held");
is(result[1], "inbound from " + inNumber + " : active");
@ -143,7 +143,7 @@ function hangUpOutgoing() {
is(telephony.calls.length, 1);
is(incomingCall.state, "connected");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
hangUpIncoming();
@ -174,7 +174,7 @@ function hangUpIncoming() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -27,7 +27,7 @@ function dial() {
is(outgoingCall, event.call);
is(outgoingCall.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : ringing");
answer();
@ -47,7 +47,7 @@ function answer() {
is(outgoingCall.state, "connected");
is(outgoingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
@ -61,7 +61,7 @@ function answer() {
}
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
function holdCall() {
@ -85,7 +85,7 @@ function holdCall() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : held");
simulateIncoming();
@ -110,14 +110,14 @@ function simulateIncoming() {
is(telephony.calls[0], outgoingCall);
is(telephony.calls[1], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : held");
is(result[1], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
// Answer incoming call; original outgoing call should be held
@ -141,7 +141,7 @@ function answerIncoming() {
is(incomingCall, telephony.active);
is(outgoingCall.state, "held");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : held");
is(result[1], "inbound from " + inNumber + " : active");
@ -173,7 +173,7 @@ function hangUpOutgoing() {
is(telephony.calls.length, 1);
is(incomingCall.state, "connected");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
hangUpIncoming();
@ -204,7 +204,7 @@ function hangUpIncoming() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -22,13 +22,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incoming);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : incoming");
answer();
});
};
emulator.runWithCallback("gsm call " + number);
emulator.runCmdWithCallback("gsm call " + number);
}
function answer() {
@ -50,7 +50,7 @@ function answer() {
is(incoming, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : active");
hangUp();
@ -79,7 +79,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -28,14 +28,14 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incoming);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : incoming");
answer();
});
};
emulator.runWithCallback("gsm call " + number);
emulator.runCmdWithCallback("gsm call " + number);
}
function answer() {
@ -60,7 +60,7 @@ function answer() {
is(incoming, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : active");
hangUp();
@ -109,7 +109,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -48,7 +48,7 @@ function answerIncoming() {
is(incomingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
remoteHangUp();
@ -70,12 +70,12 @@ function remoteHangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm cancel " + inNumber);
emulator.runCmdWithCallback("gsm cancel " + inNumber);
}
function cleanUp() {

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -77,7 +77,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -59,12 +59,12 @@ function remoteHangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm cancel " + inNumber);
emulator.runCmdWithCallback("gsm cancel " + inNumber);
}
function cleanUp() {

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -48,7 +48,7 @@ function answerIncoming() {
is(incomingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
hold();
@ -78,7 +78,7 @@ function hold() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
hangUp();
@ -107,7 +107,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -21,13 +21,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : incoming");
answer();
});
};
emulator.runWithCallback("gsm call " + number);
emulator.runCmdWithCallback("gsm call " + number);
}
function answer() {
@ -49,7 +49,7 @@ function answer() {
is(incomingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : active");
hold();
@ -79,7 +79,7 @@ function hold() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : held");
// Wait on hold for a couple of seconds
@ -111,7 +111,7 @@ function resume() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : active");
hangUp();
@ -140,7 +140,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -45,7 +45,7 @@ function answerIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
hold();
@ -71,7 +71,7 @@ function hold() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
resume();
@ -97,7 +97,7 @@ function resume() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
hangUp();
@ -122,7 +122,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -22,13 +22,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incoming);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : incoming");
reject();
});
};
emulator.runWithCallback("gsm call " + number);
emulator.runCmdWithCallback("gsm call " + number);
}
function reject() {
@ -51,7 +51,7 @@ function reject() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
cancelIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function cancelIncoming(){
@ -42,12 +42,12 @@ function cancelIncoming(){
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm cancel " + inNumber);
emulator.runCmdWithCallback("gsm cancel " + inNumber);
}
function cleanUp() {

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -48,7 +48,7 @@ function answerIncoming() {
is(incomingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
hold();
@ -78,7 +78,7 @@ function hold() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
hangUp();
@ -100,12 +100,12 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm cancel " + inNumber);
emulator.runCmdWithCallback("gsm cancel " + inNumber);
}
function cleanUp() {

View File

@ -22,13 +22,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -49,7 +49,7 @@ function answerIncoming() {
ok(gotConnecting);
is(incomingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
holdCall();
@ -80,7 +80,7 @@ function holdCall() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
dial();
@ -108,7 +108,7 @@ function dial() {
is(outgoingCall, event.call);
is(outgoingCall.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
is(result[1], "outbound to " + outNumber + " : ringing");
@ -129,14 +129,14 @@ function answerOutgoing() {
is(outgoingCall.state, "connected");
is(outgoingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
is(result[1], "outbound to " + outNumber + " : active");
holdSecondCall();
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
// With one held call and one active, hold the active one; expect the first
@ -187,7 +187,7 @@ function verifyCalls() {
is(telephony.calls[0], incomingCall);
is(telephony.calls[1], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
is(result[1], "outbound to " + outNumber + " : held");
@ -218,7 +218,7 @@ function hangUpIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : held");
hangUpOutgoing();
@ -249,7 +249,7 @@ function hangUpOutgoing() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -29,13 +29,13 @@ function simulateIncoming() {
};
let rcvdEmulatorCallback = false;
emulator.runWithCallback("gsm call " + inNumber, function(result) {
emulator.runCmdWithCallback("gsm call " + inNumber, function(result) {
rcvdEmulatorCallback = true;
});
}
function verifyCallList(){
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
@ -61,7 +61,7 @@ function answerIncoming() {
is(incomingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
holdCall();
@ -92,7 +92,7 @@ function holdCall(){
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
dial();
@ -121,7 +121,7 @@ function dial() {
is(outgoingCall, event.call);
is(outgoingCall.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
is(result[1], "outbound to " + outNumber + " : ringing");
@ -150,13 +150,13 @@ function answerOutgoing() {
};
let rcvdEmulatorCallback = false;
emulator.runWithCallback("gsm accept " + outNumber, function(result) {
emulator.runCmdWithCallback("gsm accept " + outNumber, function(result) {
rcvdEmulatorCallback = true;
});
}
function checkCallList(){
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
is(result[1], "outbound to " + outNumber + " : active");
@ -187,7 +187,7 @@ function hangUpIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
hangUpOutgoing();
@ -218,7 +218,7 @@ function hangUpOutgoing() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -27,7 +27,7 @@ function dial() {
is(outgoing, event.call);
is(outgoing.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : ringing");
answer();
@ -48,13 +48,13 @@ function answer() {
is(outgoing, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : active");
hangUp();
});
};
emulator.runWithCallback("gsm accept " + number);
emulator.runCmdWithCallback("gsm accept " + number);
}
function hangUp() {
@ -70,12 +70,12 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm cancel " + number);
emulator.runCmdWithCallback("gsm cancel " + number);
}
function cleanUp() {

View File

@ -46,7 +46,7 @@ function dial() {
}
function checkCallList() {
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
if (((result[0] == "outbound to " + number + " : unknown") ||
(result[0] == "outbound to " + number + " : dialing"))) {
@ -69,19 +69,19 @@ function answer() {
is(outgoing, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list (after 'connected' event) is now: " + result);
is(result[0], "outbound to " + number + " : active");
hangUp();
});
};
emulator.runWithCallback("gsm accept " + number);
emulator.runCmdWithCallback("gsm accept " + number);
}
function hangUp() {
log("Hanging up the outgoing call.");
emulator.runWithCallback("gsm cancel " + number);
emulator.runCmdWithCallback("gsm cancel " + number);
}
function cleanUp() {

View File

@ -26,7 +26,7 @@ function dial() {
is(outgoingCall, event.call);
is(outgoingCall.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : ringing");
answer();
@ -47,13 +47,13 @@ function answer() {
is(outgoingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
hangUp();
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
function hangUp() {
@ -76,7 +76,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -59,7 +59,7 @@ function remoteAnswer(call) {
is(call.state, "connected");
deferred.resolve(call);
};
emulator.runWithCallback("gsm accept " + call.id.number);
emulator.runCmdWithCallback("gsm accept " + call.id.number);
return deferred.promise;
}

View File

@ -30,7 +30,7 @@ function dial() {
ok(event.call.error);
is(event.call.error.name, "BadNumberError");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Initial call list: " + result);
cleanUp();
});

View File

@ -25,7 +25,7 @@ function dial() {
is(outgoing, event.call);
is(outgoing.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : ringing");
busy();
@ -42,13 +42,13 @@ function busy() {
is(outgoing, event.call);
is(event.call.error.name, "BusyError");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm busy " + number);
emulator.runCmdWithCallback("gsm busy " + number);
}
function cleanUp() {

View File

@ -24,7 +24,7 @@ function dial() {
outgoing.onalerting = function onalerting(event) {
log("Received 'alerting' call event.");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : ringing");
hangUp();
@ -54,7 +54,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -26,7 +26,7 @@ function dial() {
is(outgoing, event.call);
is(outgoing.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : ringing");
answer();
@ -47,13 +47,13 @@ function answer() {
is(outgoing, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : active");
hold();
});
};
emulator.runWithCallback("gsm accept " + number);
emulator.runCmdWithCallback("gsm accept " + number);
}
function hold() {
@ -75,7 +75,7 @@ function hold() {
is(telephony.active, null);
is(telephony.calls.length, 1);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : held");
hangUp();
@ -104,7 +104,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -26,7 +26,7 @@ function dial() {
is(outgoingCall, event.call);
is(outgoingCall.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : ringing");
answer();
@ -47,13 +47,13 @@ function answer() {
is(outgoingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : active");
hold();
});
};
emulator.runWithCallback("gsm accept " + number);
emulator.runCmdWithCallback("gsm accept " + number);
}
function hold() {
@ -77,7 +77,7 @@ function hold() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : held");
// Bug 781604: emulator assertion if outgoing call kept on hold
@ -111,7 +111,7 @@ function resume() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : active");
hangUp();
@ -140,7 +140,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -28,7 +28,7 @@ function dial() {
ok(expectedStates.indexOf(event.call.state) != -1);
if (event.call.state == "alerting") {
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : ringing");
answer();
@ -49,13 +49,13 @@ function answer() {
is(outgoingCall.state, "connected");
is(outgoingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
hold();
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
function hold() {
@ -74,7 +74,7 @@ function hold() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : held");
resume();
@ -100,7 +100,7 @@ function resume() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
hangUp();
@ -125,7 +125,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -47,7 +47,7 @@ function dial(number) {
is(telephony.calls.length, 0);
is(cause, "RadioNotAvailable");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Initial call list: " + result);
setRadioEnabled(true, cleanUp);

View File

@ -25,7 +25,7 @@ function dial() {
is(outgoing, event.call);
is(outgoing.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : ringing");
reject();
@ -53,13 +53,13 @@ function reject() {
};
let rcvdEmulatorCallback = false;
emulator.runWithCallback("gsm cancel " + number, function(result) {
emulator.runCmdWithCallback("gsm cancel " + number, function(result) {
rcvdEmulatorCallback = true;
});
}
function verifyCallList(){
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -25,7 +25,7 @@ function dial() {
is(outgoingCall, event.call);
is(outgoingCall.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : ringing");
answer();
@ -46,13 +46,13 @@ function answer() {
is(outgoingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
hold();
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
function hold() {
@ -75,7 +75,7 @@ function hold() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : held");
hangUp();
@ -97,12 +97,12 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm cancel " + outNumber);
emulator.runCmdWithCallback("gsm cancel " + outNumber);
}
function cleanUp() {

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -48,7 +48,7 @@ function answerIncoming() {
is(incomingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
answerAlreadyConnected();
@ -100,7 +100,7 @@ function hold() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
holdAlreadyHeld();
@ -176,7 +176,7 @@ function resume() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
resumeNonHeld();
@ -227,7 +227,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
answerDisconnected();
});

View File

@ -29,7 +29,7 @@ function dial() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : ringing");
answer();
@ -49,7 +49,7 @@ function answer() {
is(outgoingCall.state, "connected");
is(outgoingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
@ -63,7 +63,7 @@ function answer() {
}
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
function holdCall() {
@ -87,7 +87,7 @@ function holdCall() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : held");
simulateIncoming();
@ -112,14 +112,14 @@ function simulateIncoming() {
is(telephony.calls[0], outgoingCall);
is(telephony.calls[1], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : held");
is(result[1], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
// Answer incoming call; original outgoing call should be held
@ -145,7 +145,7 @@ function answerIncoming() {
is(outgoingCall.state, "held");
is(incomingCall.state, "connected");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : held");
is(result[1], "inbound from " + inNumber + " : active");
@ -198,7 +198,7 @@ function verifySwap() {
is(outgoingCall.state, "connected");
is(incomingCall.state, "held");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
is(result[1], "inbound from " + inNumber + " : held");
@ -230,7 +230,7 @@ function hangUpOutgoing() {
is(telephony.calls.length, 1);
is(incomingCall.state, "held");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
hangUpIncoming();
@ -261,7 +261,7 @@ function hangUpIncoming() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -511,6 +511,7 @@ class DebugGLColorData : public DebugGLData {
public:
DebugGLColorData(void* layerRef, const gfxRGBA& color, int width, int height)
: DebugGLData(DebugGLData::ColorData),
mLayerRef(layerRef),
mColor(color.Packed()),
mSize(width, height)
{ }

View File

@ -119,7 +119,7 @@ BasicThebesLayer::PaintThebes(gfxContext* aContext,
AutoMoz2DMaskData mask;
SourceSurface* maskSurface = nullptr;
Matrix maskTransform;
if (GetMaskData(aMaskLayer, Point(), &mask)) {
if (GetMaskData(aMaskLayer, aContext->GetDeviceOffset(), &mask)) {
maskSurface = mask.GetSurface();
maskTransform = mask.GetTransform();
}

View File

@ -126,17 +126,17 @@ gfxUserFontSet::AddFontFace(const nsAString& aFamilyName,
int32_t aStretch,
uint32_t aItalicStyle,
const nsTArray<gfxFontFeature>& aFeatureSettings,
const nsString& aLanguageOverride,
uint32_t aLanguageOverride,
gfxSparseBitSet *aUnicodeRanges)
{
MOZ_ASSERT(aWeight != 0,
"aWeight must not be 0; use NS_FONT_WEIGHT_NORMAL instead");
nsAutoString key(aFamilyName);
ToLowerCase(key);
bool found;
if (aWeight == 0)
aWeight = NS_FONT_WEIGHT_NORMAL;
// stretch, italic/oblique ==> zero implies normal
gfxMixedFontFamily *family = mFontFamilies.GetWeak(key, &found);
@ -145,9 +145,6 @@ gfxUserFontSet::AddFontFace(const nsAString& aFamilyName,
mFontFamilies.Put(key, family);
}
uint32_t languageOverride =
gfxFontStyle::ParseFontLanguageOverride(aLanguageOverride);
// If there's already a proxy in the family whose descriptors all match,
// we can just move it to the end of the list instead of adding a new
// face that will always "shadow" the old one.
@ -164,7 +161,7 @@ gfxUserFontSet::AddFontFace(const nsAString& aFamilyName,
static_cast<gfxProxyFontEntry*>(fontList[i].get());
if (!existingProxyEntry->Matches(aFontFaceSrcList,
aWeight, aStretch, aItalicStyle,
aFeatureSettings, languageOverride,
aFeatureSettings, aLanguageOverride,
aUnicodeRanges)) {
continue;
}
@ -181,7 +178,7 @@ gfxUserFontSet::AddFontFace(const nsAString& aFamilyName,
new gfxProxyFontEntry(aFontFaceSrcList, aWeight, aStretch,
aItalicStyle,
aFeatureSettings,
languageOverride,
aLanguageOverride,
aUnicodeRanges);
family->AddFontEntry(proxyEntry);
#ifdef PR_LOGGING

View File

@ -167,9 +167,10 @@ public:
// add in a font face
// weight - 0 == unknown, [100, 900] otherwise (multiples of 100)
// weight - [100, 900] (multiples of 100)
// stretch = [NS_FONT_STRETCH_ULTRA_CONDENSED, NS_FONT_STRETCH_ULTRA_EXPANDED]
// italic style = constants in gfxFontConstants.h, e.g. NS_FONT_STYLE_NORMAL
// language override = result of calling gfxFontStyle::ParseFontLanguageOverride
// TODO: support for unicode ranges not yet implemented
gfxFontEntry *AddFontFace(const nsAString& aFamilyName,
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
@ -177,7 +178,7 @@ public:
int32_t aStretch,
uint32_t aItalicStyle,
const nsTArray<gfxFontFeature>& aFeatureSettings,
const nsString& aLanguageOverride,
uint32_t aLanguageOverride,
gfxSparseBitSet *aUnicodeRanges = nullptr);
// add in a font face for which we have the gfxFontEntry already

View File

@ -1452,7 +1452,7 @@ bool nsBidi::GetRuns()
GetSingleRun(mParaLevel);
} else /* NSBIDI_MIXED, length>0 */ {
/* mixed directionality */
int32_t length=mLength, limit=length;
int32_t length=mLength, limit=mTrailingWSStart;
/*
* If there are WS characters at the end of the line
@ -1465,7 +1465,6 @@ bool nsBidi::GetRuns()
* In other words, for the trailing WS, it may be
* levels[]!=paraLevel but we have to treat it like it were so.
*/
limit=mTrailingWSStart;
if(limit==0) {
/* there is only WS on this line */
GetSingleRun(mParaLevel);

View File

@ -1,20 +0,0 @@
<!--
Without the patch for bug 706198, this website should not show up as inflated. That means
that with a 450px container, the minimum font size with 15em per line should be 30px.
So, we map 0px-45px into 30px-45px, and thus 12px gets mapped to 34px.
With the patch, the text should be uninflated, which means that 12px should still be
12px.
-->
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=320"/>
<style>
p { font-size: 12px; line-height: 1.0;}
</style>
<body>
<p>Some uninflated text.</p>
</body>
</head>
</html>

View File

@ -55,7 +55,6 @@ asserts-if(gtk2Widget,0-4) test-pref(font.size.inflation.emPerLine,15) test-pref
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == disable-fontinfl-on-mobile.html disable-fontinfl-on-mobile-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == disable-fontinfl-on-mobile-2.html disable-fontinfl-on-mobile-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == disable-fontinfl-on-mobile-3.html disable-fontinfl-on-mobile-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == disable-fontinfl-on-mobile-4.html disable-fontinfl-on-mobile-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) != disable-fontinfl-on-mobile-5.html disable-fontinfl-on-mobile-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == preformatted-text.html preformatted-text-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == fixed-height-body.html fixed-height-body-ref.html

View File

@ -571,13 +571,16 @@ nsUserFontSet::InsertRule(nsCSSFontFaceRule* aRule, uint8_t aSheetType,
uint32_t weight = NS_STYLE_FONT_WEIGHT_NORMAL;
int32_t stretch = NS_STYLE_FONT_STRETCH_NORMAL;
uint32_t italicStyle = NS_STYLE_FONT_STYLE_NORMAL;
nsString languageOverride;
uint32_t languageOverride = NO_FONT_LANGUAGE_OVERRIDE;
// set up weight
aRule->GetDesc(eCSSFontDesc_Weight, val);
unit = val.GetUnit();
if (unit == eCSSUnit_Integer || unit == eCSSUnit_Enumerated) {
weight = val.GetIntValue();
if (weight == 0) {
weight = NS_STYLE_FONT_STYLE_NORMAL;
}
} else if (unit == eCSSUnit_Normal) {
weight = NS_STYLE_FONT_WEIGHT_NORMAL;
} else {
@ -628,7 +631,9 @@ nsUserFontSet::InsertRule(nsCSSFontFaceRule* aRule, uint8_t aSheetType,
if (unit == eCSSUnit_Normal) {
// empty feature string
} else if (unit == eCSSUnit_String) {
val.GetStringValue(languageOverride);
nsString stringValue;
val.GetStringValue(stringValue);
languageOverride = gfxFontStyle::ParseFontLanguageOverride(stringValue);
} else {
NS_ASSERTION(unit == eCSSUnit_Null,
"@font-face font-language-override has unexpected unit");

View File

@ -123,7 +123,12 @@ WebrtcGmpVideoEncoder::InitEncode_g(const webrtc::VideoCodec* aCodecSettings,
GMPVideoHost* host = nullptr;
GMPVideoEncoder* gmp = nullptr;
nsresult rv = mMPS->GetGMPVideoEncoderVP8(&host, &gmp);
nsTArray<nsCString> tags;
tags.AppendElement(NS_LITERAL_CSTRING("vp8"));
nsresult rv = mMPS->GetGMPVideoEncoder(&tags,
NS_LITERAL_STRING(""),
&host,
&gmp);
if (NS_FAILED(rv)) {
return WEBRTC_VIDEO_CODEC_ERROR;
}
@ -458,8 +463,12 @@ WebrtcGmpVideoDecoder::InitDecode_g(const webrtc::VideoCodec* aCodecSettings,
GMPVideoHost* host = nullptr;
GMPVideoDecoder* gmp = nullptr;
if (NS_WARN_IF(NS_FAILED(mMPS->GetGMPVideoDecoderVP8(&host, &gmp))))
{
nsTArray<nsCString> tags;
tags.AppendElement(NS_LITERAL_CSTRING("vp8"));
if (NS_WARN_IF(NS_FAILED(mMPS->GetGMPVideoDecoder(&tags,
NS_LITERAL_STRING(""),
&host,
&gmp)))) {
return WEBRTC_VIDEO_CODEC_ERROR;
}

View File

@ -418,11 +418,11 @@ let Downloads = {
let stmt = this._initStatement(aParams.isPrivate);
stmt.reset();
stmt.bindInt32Parameter(0, Ci.nsIDownloadManager.DOWNLOAD_NOTSTARTED);
stmt.bindInt32Parameter(1, Ci.nsIDownloadManager.DOWNLOAD_DOWNLOADING);
stmt.bindInt32Parameter(2, Ci.nsIDownloadManager.DOWNLOAD_PAUSED);
stmt.bindInt32Parameter(3, Ci.nsIDownloadManager.DOWNLOAD_QUEUED);
stmt.bindInt32Parameter(4, Ci.nsIDownloadManager.DOWNLOAD_SCANNING);
stmt.bindByIndex(0, Ci.nsIDownloadManager.DOWNLOAD_NOTSTARTED);
stmt.bindByIndex(1, Ci.nsIDownloadManager.DOWNLOAD_DOWNLOADING);
stmt.bindByIndex(2, Ci.nsIDownloadManager.DOWNLOAD_PAUSED);
stmt.bindByIndex(3, Ci.nsIDownloadManager.DOWNLOAD_QUEUED);
stmt.bindByIndex(4, Ci.nsIDownloadManager.DOWNLOAD_SCANNING);
let entries = [];
while (entry = this._getEntry(stmt)) {

View File

@ -7042,7 +7042,7 @@ var SearchEngines = {
let mDBConn = Services.storage.openDatabase(dbFile);
let stmts = [];
stmts[0] = mDBConn.createStatement("SELECT favicon FROM history_with_favicons WHERE url = ?");
stmts[0].bindStringParameter(0, docURI.spec);
stmts[0].bindByIndex(0, docURI.spec);
let favicon = null;
Services.search.init(function addEngine_cb(rv) {
if (!Components.isSuccessCode(rv)) {

View File

@ -27,12 +27,12 @@ let downloads = {
let dbConn = dlmgr.DBConnection;
let stmt = dbConn.createStatement("SELECT id FROM moz_downloads WHERE " +
"state = ? OR state = ? OR state = ? OR state = ? OR state = ? OR state = ?");
stmt.bindInt32Parameter(0, Ci.nsIDownloadManager.DOWNLOAD_FINISHED);
stmt.bindInt32Parameter(1, Ci.nsIDownloadManager.DOWNLOAD_FAILED);
stmt.bindInt32Parameter(2, Ci.nsIDownloadManager.DOWNLOAD_CANCELED);
stmt.bindInt32Parameter(3, Ci.nsIDownloadManager.DOWNLOAD_BLOCKED_PARENTAL);
stmt.bindInt32Parameter(4, Ci.nsIDownloadManager.DOWNLOAD_BLOCKED_POLICY);
stmt.bindInt32Parameter(5, Ci.nsIDownloadManager.DOWNLOAD_DIRTY);
stmt.bindByIndex(0, Ci.nsIDownloadManager.DOWNLOAD_FINISHED);
stmt.bindByIndex(1, Ci.nsIDownloadManager.DOWNLOAD_FAILED);
stmt.bindByIndex(2, Ci.nsIDownloadManager.DOWNLOAD_CANCELED);
stmt.bindByIndex(3, Ci.nsIDownloadManager.DOWNLOAD_BLOCKED_PARENTAL);
stmt.bindByIndex(4, Ci.nsIDownloadManager.DOWNLOAD_BLOCKED_POLICY);
stmt.bindByIndex(5, Ci.nsIDownloadManager.DOWNLOAD_DIRTY);
while (stmt.executeStep()) {
aCallback(dlmgr.getDownload(stmt.row.id));
}

View File

@ -189,6 +189,7 @@ NSS_CMSEnvelopedData_AddRecipient
NSS_CMSEnvelopedData_Create
NSS_CMSEnvelopedData_GetContentInfo
NSS_CMSMessage_ContentLevel
NSS_CMSMessage_ContentLevelCount
NSS_CMSMessage_Create
NSS_CMSMessage_CreateFromDER
NSS_CMSMessage_Destroy

View File

@ -86,20 +86,20 @@ function test()
try {
// Saving javascript URIs doesn't work
stmt.bindStringParameter(0, "javascript:5");
stmt.bindByIndex(0, "javascript:5");
// Download to a temp local file
file = Cc["@mozilla.org/file/directory_service;1"].
getService(Ci.nsIProperties).get("TmpD", Ci.nsIFile);
file.append("javascriptURI");
file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666);
stmt.bindStringParameter(1, Cc["@mozilla.org/network/io-service;1"].
stmt.bindByIndex(1, Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService).newFileURI(file).spec);
// Start it as canceled
stmt.bindInt32Parameter(2, dm.DOWNLOAD_CANCELED);
stmt.bindByIndex(2, dm.DOWNLOAD_CANCELED);
stmt.bindInt32Parameter(3, Date.now() * 1000);
stmt.bindByIndex(3, Date.now() * 1000);
// Add it!
stmt.execute();

View File

@ -50,10 +50,10 @@ function test()
try {
for each (let site in ["delete.me", "i.live"]) {
stmt.bindStringParameter(0, "Super Pimped Download");
stmt.bindStringParameter(1, filePath);
stmt.bindStringParameter(2, "http://" + site + "/file");
stmt.bindInt32Parameter(3, dm.DOWNLOAD_FINISHED);
stmt.bindByIndex(0, "Super Pimped Download");
stmt.bindByIndex(1, filePath);
stmt.bindByIndex(2, "http://" + site + "/file");
stmt.bindByIndex(3, dm.DOWNLOAD_FINISHED);
// Add it!
stmt.execute();

View File

@ -49,10 +49,10 @@ function test()
let fileSpec = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService).newFileURI(file).spec;
stmt.bindStringParameter(0, "http://" + site + "/file");
stmt.bindInt32Parameter(1, dm.DOWNLOAD_FINISHED);
stmt.bindStringParameter(2, fileSpec);
stmt.bindStringParameter(3, "http://referrer/");
stmt.bindByIndex(0, "http://" + site + "/file");
stmt.bindByIndex(1, dm.DOWNLOAD_FINISHED);
stmt.bindByIndex(2, fileSpec);
stmt.bindByIndex(3, "http://referrer/");
// Add it!
stmt.execute();

View File

@ -48,12 +48,12 @@ function test()
try {
for each (let site in ["ed.agadak.net", "mozilla.org"]) {
stmt.bindStringParameter(0, "Super Pimped Download");
stmt.bindStringParameter(1, filePath);
stmt.bindStringParameter(2, "http://" + site + "/file");
stmt.bindInt32Parameter(3, dm.DOWNLOAD_FINISHED);
stmt.bindInt64Parameter(4, new Date(1985, 7, 2) * 1000);
stmt.bindInt64Parameter(5, 111222333444);
stmt.bindByIndex(0, "Super Pimped Download");
stmt.bindByIndex(1, filePath);
stmt.bindByIndex(2, "http://" + site + "/file");
stmt.bindByIndex(3, dm.DOWNLOAD_FINISHED);
stmt.bindByIndex(4, new Date(1985, 7, 2) * 1000);
stmt.bindByIndex(5, 111222333444);
// Add it!
stmt.execute();

View File

@ -56,11 +56,11 @@ function test()
try {
for each (let site in sites) {
stmt.bindStringParameter(0, filePath);
stmt.bindStringParameter(1, "http://" + site + "/file");
stmt.bindInt32Parameter(2, dm.DOWNLOAD_FINISHED);
stmt.bindByIndex(0, filePath);
stmt.bindByIndex(1, "http://" + site + "/file");
stmt.bindByIndex(2, dm.DOWNLOAD_FINISHED);
// Make the one that matches slightly older so it appears last
stmt.bindInt64Parameter(3, 1112223334445556 - (site == searchTerm));
stmt.bindByIndex(3, 1112223334445556 - (site == searchTerm));
// Add it!
stmt.execute();

View File

@ -50,9 +50,9 @@ function test()
let sites = ["mozilla.org", "mozilla.com", "select.all"];
try {
for each (let site in sites) {
stmt.bindStringParameter(0, filePath);
stmt.bindStringParameter(1, "http://" + site + "/file");
stmt.bindInt32Parameter(2, dm.DOWNLOAD_FINISHED);
stmt.bindByIndex(0, filePath);
stmt.bindByIndex(1, "http://" + site + "/file");
stmt.bindByIndex(2, dm.DOWNLOAD_FINISHED);
// Add it!
stmt.execute();