This commit is contained in:
Ryan VanderMeulen 2013-09-03 17:43:47 -04:00
Родитель 4b637bc9ef 1623103fc3
Коммит cdbc6d8fb3
33 изменённых файлов: 260 добавлений и 201 удалений

Просмотреть файл

@ -299,6 +299,7 @@ var shell = {
window.addEventListener('keyup', this, true);
window.addEventListener('MozApplicationManifest', this);
window.addEventListener('mozfullscreenchange', this);
window.addEventListener('MozAfterPaint', this);
window.addEventListener('sizemodechange', this);
this.contentBrowser.addEventListener('mozbrowserloadstart', this, true);
@ -511,6 +512,12 @@ var shell = {
dump('Error while creating offline cache: ' + e + '\n');
}
break;
case 'MozAfterPaint':
window.removeEventListener('MozAfterPaint', this);
this.sendChromeEvent({
type: 'system-first-paint'
});
break;
}
},

Просмотреть файл

@ -1,4 +1,4 @@
{
"revision": "d9f759cc10938a3caa252e96420531bbb6d6cab3",
"revision": "f2d88904536ccd68a3981a7feb17e56b2132838c",
"repo_path": "/integration/gaia-central"
}

Просмотреть файл

@ -10,6 +10,9 @@ Cu.import("resource://gre/modules/Services.jsm");
* JS modules
*/
XPCOMUtils.defineLazyModuleGetter(this , "FormHistory",
"resource://gre/modules/FormHistory.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
"resource://gre/modules/PluralForm.jsm");

Просмотреть файл

@ -143,8 +143,6 @@ var BrowserUI = {
// Login Manager and Form History initialization
Cc["@mozilla.org/login-manager;1"].getService(Ci.nsILoginManager);
Cc["@mozilla.org/satchel/form-history;1"].getService(Ci.nsIFormHistory2);
messageManager.addMessageListener("Browser:MozApplicationManifest", OfflineApps);
try {

Просмотреть файл

@ -3,10 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
"resource://gre/modules/PlacesUtils.jsm");
function Sanitizer() {}
Sanitizer.prototype = {
@ -17,17 +13,22 @@ Sanitizer.prototype = {
this.items[aItemName].clear();
},
canClearItem: function (aItemName)
canClearItem: function (aItemName, aCallback, aArg)
{
return this.items[aItemName].canClear;
let canClear = this.items[aItemName].canClear;
if (typeof canClear == "function"){
canClear(aCallback, aArg);
} else {
aCallback(aItemName, canClear, aArg);
}
},
_prefDomain: "privacy.item.",
getNameFromPreference: function (aPreferenceName)
{
return aPreferenceName.substr(this._prefDomain.length);
},
/**
* Deletes privacy sensitive data in a batch, according to user preferences
*
@ -39,26 +40,32 @@ Sanitizer.prototype = {
var branch = Services.prefs.getBranch(this._prefDomain);
var errors = null;
for (var itemName in this.items) {
var item = this.items[itemName];
if ("clear" in item && item.canClear && branch.getBoolPref(itemName)) {
if ("clear" in item && branch.getBoolPref(itemName)) {
// Some of these clear() may raise exceptions (see bug #265028)
// to sanitize as much as possible, we catch and store them,
// rather than fail fast.
// Callers should check returned errors and give user feedback
// about items that could not be sanitized
try {
item.clear();
} catch(er) {
if (!errors)
errors = {};
errors[itemName] = er;
dump("Error sanitizing " + itemName + ": " + er + "\n");
let clearCallback = (itemName, aCanClear) => {
let item = this.items[itemName];
try{
if (aCanClear){
item.clear();
}
} catch(er){
if (!errors){
errors = {};
}
errors[itemName] = er;
dump("Error sanitizing " + itemName + ":" + er + "\n");
}
}
this.canClearItem(itemName, clearCallback);
}
}
return errors;
},
items: {
// Clear Sync account before passwords so that Sync still has access to the
// credentials to clean up device-specific records on the server. Also
@ -88,20 +95,20 @@ Sanitizer.prototype = {
imageCache.clearCache(false); // true=chrome, false=content
} catch(er) {}
},
get canClear()
{
return true;
}
},
cookies: {
clear: function ()
{
var cookieMgr = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager);
cookieMgr.removeAll();
},
get canClear()
{
return true;
@ -185,18 +192,21 @@ Sanitizer.prototype = {
searchBar.textbox.editor.transactionManager.clear();
}
}
var formHistory = Cc["@mozilla.org/satchel/form-history;1"].getService(Ci.nsIFormHistory2);
formHistory.removeAllEntries();
FormHistory.update({op : "remove"});
},
get canClear()
canClear : function(aCallback, aArg)
{
var formHistory = Cc["@mozilla.org/satchel/form-history;1"].getService(Ci.nsIFormHistory2);
return formHistory.hasEntries;
let count = 0;
let countDone = {
handleResult : function(aResult) { count = aResult; },
handleError : function(aError) { Components.utils.reportError(aError); },
handleCompletion : function(aReason) { aCallback("formdata", aReason == 0 && count > 0, aArg); }
};
FormHistory.count({}, countDone);
}
},
downloads: {
clear: function ()
{
@ -210,14 +220,14 @@ Sanitizer.prototype = {
return dlMgr.canCleanUp;
}
},
passwords: {
clear: function ()
{
var pwmgr = Cc["@mozilla.org/login-manager;1"].getService(Ci.nsILoginManager);
pwmgr.removeAllLogins();
},
get canClear()
{
var pwmgr = Cc["@mozilla.org/login-manager;1"].getService(Ci.nsILoginManager);
@ -225,7 +235,7 @@ Sanitizer.prototype = {
return (count > 0);
}
},
sessions: {
clear: function ()
{
@ -237,7 +247,7 @@ Sanitizer.prototype = {
var authMgr = Cc['@mozilla.org/network/http-auth-manager;1'].getService(Ci.nsIHttpAuthManager);
authMgr.clearAll();
},
get canClear()
{
return true;

Просмотреть файл

@ -6,8 +6,7 @@
"use strict";
function clearFormHistory() {
var formHistory = Cc["@mozilla.org/satchel/form-history;1"].getService(Ci.nsIFormHistory2);
formHistory.removeAllEntries();
FormHistory.update({ op : "remove" });
}
function test() {

Просмотреть файл

@ -82,13 +82,6 @@ public interface Actions {
void drag(int startingX, int endingX, int startingY, int endingY);
/**
* This is the implementation of clickLongOnScreen from Robotium 4.0 since this sometimes fails for Robotium 3.6
* TODO : Remove this when Robotium is updated
*/
void clickLongOnScreen(float x, float y);
/**
* Run a sql query on the specified database
*/

Просмотреть файл

@ -460,41 +460,6 @@ public class FennecNativeActions implements Actions {
mSolo.drag(startingX, endingX, startingY, endingY, 10);
}
/**
* This is the implementation of clickLongOnScreen from Robotium 4.0 since this sometimes fails for Robotium 3.6
* TODO : Remove this when Robotium is updated
*/
public void clickLongOnScreen(float x, float y) {
boolean successfull = false;
int retry = 0;
long downTime = SystemClock.uptimeMillis();
long eventTime = SystemClock.uptimeMillis();
MotionEvent event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_DOWN, x, y, 0);
while(!successfull && retry < 10) {
try{
mInstr.sendPointerSync(event);
successfull = true;
}catch(SecurityException e){
FennecNativeDriver.log(LogLevel.ERROR, e);
retry++;
}
}
mAsserter.ok(successfull, "Trying to click on long on screen at (" + x + "," + y + ")", "Was able to click long on screen");
eventTime = SystemClock.uptimeMillis();
event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_MOVE, x + 1.0f, y + 1.0f, 0);
mInstr.sendPointerSync(event);
mSolo.sleep(((int)(ViewConfiguration.getLongPressTimeout() * 2.5f)));
eventTime = SystemClock.uptimeMillis();
event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_UP, x, y, 0);
mInstr.sendPointerSync(event);
mSolo.sleep(500);
}
public Cursor querySql(String dbPath, String sql) {
try {
return (Cursor)mQuerySql.invoke(mRobocopApi, dbPath, sql);

Просмотреть файл

@ -15,7 +15,7 @@ include $(DEPTH)/config/autoconf.mk
ANDROID_APK_NAME := robocop-debug
ROBOTIUM_PATH = $(srcdir)/robotium-solo-3.6.jar
ROBOTIUM_PATH = $(srcdir)/robotium-solo-4.2.jar
JAVAFILES = \
R.java \

Просмотреть файл

@ -4,7 +4,7 @@ Robotium is an open source tool licensed under the Apache 2.0 license and the or
source can be found here:
http://code.google.com/p/robotium/
We are including robotium-solo-3.6.jar as a binary and are not modifying it in any way
We are including robotium-solo-4.2.jar as a binary and are not modifying it in any way
from the original download found at:
http://code.google.com/p/robotium/

Двоичные данные
build/mobile/robocop/robotium-solo-3.6.jar

Двоичный файл не отображается.

Двоичные данные
build/mobile/robocop/robotium-solo-4.2.jar Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -1143,7 +1143,7 @@ Navigator::GetMozTelephony(ErrorResult& aRv)
return mTelephony;
}
nsIDOMMozVoicemail*
Voicemail*
Navigator::GetMozVoicemail(ErrorResult& aRv)
{
if (!mVoicemail) {

Просмотреть файл

@ -35,7 +35,6 @@ class systemMessageCallback;
#ifdef MOZ_B2G_RIL
class nsIDOMMozMobileConnection;
class nsIDOMMozVoicemail;
class nsIDOMMozIccManager;
#endif // MOZ_B2G_RIL
@ -90,6 +89,10 @@ class BluetoothManager;
} // namespace bluetooth
#endif // MOZ_B2G_BT
#ifdef MOZ_B2G_RIL
class Voicemail;
#endif
namespace power {
class PowerManager;
} // namespace power
@ -221,7 +224,7 @@ public:
telephony::Telephony* GetMozTelephony(ErrorResult& aRv);
nsIDOMMozMobileConnection* GetMozMobileConnection(ErrorResult& aRv);
CellBroadcast* GetMozCellBroadcast(ErrorResult& aRv);
nsIDOMMozVoicemail* GetMozVoicemail(ErrorResult& aRv);
Voicemail* GetMozVoicemail(ErrorResult& aRv);
nsIDOMMozIccManager* GetMozIccManager(ErrorResult& aRv);
#endif // MOZ_B2G_RIL
#ifdef MOZ_GAMEPAD
@ -315,7 +318,7 @@ private:
nsRefPtr<MobileMessageManager> mMobileMessageManager;
#ifdef MOZ_B2G_RIL
nsRefPtr<telephony::Telephony> mTelephony;
nsCOMPtr<nsIDOMMozVoicemail> mVoicemail;
nsRefPtr<Voicemail> mVoicemail;
#endif
nsRefPtr<network::Connection> mConnection;
#ifdef MOZ_B2G_RIL

Просмотреть файл

@ -170,7 +170,6 @@
#include "nsIDOMConnection.h"
#ifdef MOZ_B2G_RIL
#include "nsIDOMMozVoicemail.h"
#include "nsIDOMIccManager.h"
#include "nsIDOMMobileConnection.h"
#endif // MOZ_B2G_RIL
@ -534,8 +533,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
DOM_DEFAULT_SCRIPTABLE_FLAGS)
#ifdef MOZ_B2G_RIL
NS_DEFINE_CLASSINFO_DATA(MozVoicemail, nsEventTargetSH,
EVENTTARGET_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(MozIccManager, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
#endif
@ -1395,12 +1392,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_END
#ifdef MOZ_B2G_RIL
DOM_CLASSINFO_MAP_BEGIN(MozVoicemail, nsIDOMMozVoicemail)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozVoicemail)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(MozIccManager, nsIDOMMozIccManager)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozIccManager)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)

Просмотреть файл

@ -127,7 +127,6 @@ DOMCI_CLASS(CSSPageRule)
DOMCI_CLASS(MediaQueryList)
#ifdef MOZ_B2G_RIL
DOMCI_CLASS(MozVoicemail)
DOMCI_CLASS(MozIccManager)
#endif

Просмотреть файл

@ -772,6 +772,10 @@ DOMInterfaces = {
'headerFile': 'StkCommandEvent.h',
},
'MozVoicemail': {
'nativeType': 'mozilla::dom::Voicemail',
},
'MutationEvent': {
'nativeType': 'nsDOMMutationEvent',
},
@ -1791,7 +1795,7 @@ addExternalIface('MozTreeBoxObject', nativeType='nsITreeBoxObject',
notflattened=True)
addExternalIface('MozTreeColumn', nativeType='nsITreeColumn',
headerFile='nsITreeColumns.h')
addExternalIface('MozVoicemail')
addExternalIface('MozVoicemailStatus')
addExternalIface('MozWakeLock', headerFile='nsIDOMWakeLock.h')
addExternalIface('MozXULTemplateBuilder', nativeType='nsIXULTemplateBuilder')
addExternalIface('nsIControllers', nativeType='nsIControllers')

Просмотреть файл

@ -52,7 +52,8 @@ function testSetCallBarringOptionError(option) {
'should not fire onsuccess for invaild call barring option: '
+ JSON.stringify(option));
};
request.onerror = function() {
request.onerror = function(event) {
is(event.target.error.name, 'InvalidCallBarringOption', JSON.stringify(option));
nextTest();
};
}

Просмотреть файл

@ -20,7 +20,7 @@ var gData = [
{
perm: ["voicemail"],
obj: "mozVoicemail",
idl: "nsIDOMMozVoicemail",
webidl: "MozVoicemail",
},
]
</script>

Просмотреть файл

@ -1086,7 +1086,7 @@ RILContentHelper.prototype = {
let requestId = this.getRequestId(request);
if (DEBUG) debug("setCallBarringOption: " + JSON.stringify(option));
if (!this._isValidCallBarringOption(option)) {
if (!this._isValidCallBarringOption(option, true)) {
this.dispatchFireRequestError(requestId, "InvalidCallBarringOption");
return request;
}
@ -2072,10 +2072,20 @@ RILContentHelper.prototype = {
/**
* Helper for guarding us against invalid option for call barring.
*/
_isValidCallBarringOption: function _isValidCallBarringOption(option) {
return (option
&& option.serviceClass != null
&& this._isValidCallBarringProgram(option.program));
_isValidCallBarringOption:
function _isValidCallBarringOption(option, usedForSetting) {
if (!option ||
option.serviceClass == null ||
!this._isValidCallBarringProgram(option.program)) {
return false;
}
// For setting callbarring option, |enabled| and |password| are required.
if (usedForSetting && (option.enabled == null || option.password == null)) {
return false;
}
return true;
}
};

Просмотреть файл

@ -5,6 +5,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "Voicemail.h"
#include "mozilla/dom/MozVoicemailBinding.h"
#include "nsIDOMMozVoicemailStatus.h"
#include "nsIDOMMozVoicemailEvent.h"
@ -40,22 +42,11 @@ public:
NS_IMPL_ISUPPORTS1(Voicemail::Listener, nsIVoicemailListener)
DOMCI_DATA(MozVoicemail, Voicemail)
NS_INTERFACE_MAP_BEGIN(Voicemail)
NS_INTERFACE_MAP_ENTRY(nsIDOMMozVoicemail)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MozVoicemail)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
NS_IMPL_ADDREF_INHERITED(Voicemail, nsDOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(Voicemail, nsDOMEventTargetHelper)
Voicemail::Voicemail(nsPIDOMWindow* aWindow,
nsIVoicemailProvider* aProvider)
: mProvider(aProvider)
: nsDOMEventTargetHelper(aWindow)
, mProvider(aProvider)
{
BindToOwner(aWindow);
mListener = new Listener(this);
DebugOnly<nsresult> rv = mProvider->RegisterVoicemailMsg(mListener);
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
@ -70,36 +61,57 @@ Voicemail::~Voicemail()
mProvider->UnregisterVoicemailMsg(mListener);
}
// nsIDOMMozVoicemail
NS_IMETHODIMP
Voicemail::GetStatus(nsIDOMMozVoicemailStatus** aStatus)
JSObject*
Voicemail::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
{
*aStatus = nullptr;
NS_ENSURE_STATE(mProvider);
return mProvider->GetVoicemailStatus(aStatus);
return MozVoicemailBinding::Wrap(aCx, aScope, this);
}
NS_IMETHODIMP
Voicemail::GetNumber(nsAString& aNumber)
// MozVoicemail WebIDL
already_AddRefed<nsIDOMMozVoicemailStatus>
Voicemail::GetStatus(ErrorResult& aRv) const
{
if (!mProvider) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return nullptr;
}
nsCOMPtr<nsIDOMMozVoicemailStatus> status;
nsresult rv = mProvider->GetVoicemailStatus(getter_AddRefs(status));
if (NS_FAILED(rv)) {
aRv.Throw(rv);
return nullptr;
}
return status.forget();
}
void
Voicemail::GetNumber(nsString& aNumber, ErrorResult& aRv) const
{
NS_ENSURE_STATE(mProvider);
aNumber.SetIsVoid(true);
return mProvider->GetVoicemailNumber(aNumber);
if (!mProvider) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return;
}
aRv = mProvider->GetVoicemailNumber(aNumber);
}
NS_IMETHODIMP
Voicemail::GetDisplayName(nsAString& aDisplayName)
void
Voicemail::GetDisplayName(nsString& aDisplayName, ErrorResult& aRv) const
{
NS_ENSURE_STATE(mProvider);
aDisplayName.SetIsVoid(true);
return mProvider->GetVoicemailDisplayName(aDisplayName);
}
if (!mProvider) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return;
}
NS_IMPL_EVENT_HANDLER(Voicemail, statuschanged)
aRv = mProvider->GetVoicemailDisplayName(aDisplayName);
}
// nsIVoicemailListener
@ -118,7 +130,7 @@ Voicemail::NotifyStatusChanged(nsIDOMMozVoicemailStatus* aStatus)
}
nsresult
NS_NewVoicemail(nsPIDOMWindow* aWindow, nsIDOMMozVoicemail** aVoicemail)
NS_NewVoicemail(nsPIDOMWindow* aWindow, Voicemail** aVoicemail)
{
nsPIDOMWindow* innerWindow = aWindow->IsInnerWindow() ?
aWindow :
@ -128,8 +140,7 @@ NS_NewVoicemail(nsPIDOMWindow* aWindow, nsIDOMMozVoicemail** aVoicemail)
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
NS_ENSURE_STATE(provider);
nsRefPtr<mozilla::dom::Voicemail> voicemail =
new mozilla::dom::Voicemail(innerWindow, provider);
nsRefPtr<Voicemail> voicemail = new Voicemail(innerWindow, provider);
voicemail.forget(aVoicemail);
return NS_OK;
}

Просмотреть файл

@ -7,19 +7,22 @@
#ifndef mozilla_dom_voicemail_voicemail_h__
#define mozilla_dom_voicemail_voicemail_h__
#include "mozilla/Attributes.h"
#include "mozilla/ErrorResult.h"
#include "nsDOMEvent.h"
#include "nsDOMEventTargetHelper.h"
#include "nsIDOMMozVoicemail.h"
#include "nsIVoicemailProvider.h"
class JSObject;
struct JSContext;
class nsPIDOMWindow;
class nsIDOMMozVoicemailStatus;
namespace mozilla {
namespace dom {
class Voicemail : public nsDOMEventTargetHelper,
public nsIDOMMozVoicemail
class Voicemail MOZ_FINAL : public nsDOMEventTargetHelper
{
/**
* Class Voicemail doesn't actually inherit nsIVoicemailListener. Instead, it
@ -31,15 +34,34 @@ class Voicemail : public nsDOMEventTargetHelper,
class Listener;
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMMOZVOICEMAIL
NS_DECL_NSIVOICEMAILLISTENER
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper)
Voicemail(nsPIDOMWindow* aWindow, nsIVoicemailProvider* aProvider);
virtual ~Voicemail();
nsPIDOMWindow*
GetParentObject() const
{
return GetOwner();
}
virtual JSObject*
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
already_AddRefed<nsIDOMMozVoicemailStatus>
GetStatus(ErrorResult& aRv) const;
void
GetNumber(nsString& aNumber, ErrorResult& aRv) const;
void
GetDisplayName(nsString& aDisplayName, ErrorResult& aRv) const;
IMPL_EVENT_HANDLER(statuschanged)
private:
nsCOMPtr<nsIVoicemailProvider> mProvider;
nsRefPtr<Listener> mListener;
@ -49,6 +71,7 @@ private:
} // namespace mozilla
nsresult
NS_NewVoicemail(nsPIDOMWindow* aWindow, nsIDOMMozVoicemail** aVoicemail);
NS_NewVoicemail(nsPIDOMWindow* aWindow,
mozilla::dom::Voicemail** aVoicemail);
#endif // mozilla_dom_voicemail_voicemail_h__

Просмотреть файл

@ -5,7 +5,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
XPIDL_SOURCES += [
'nsIDOMMozVoicemail.idl',
'nsIDOMMozVoicemailEvent.idl',
'nsIDOMMozVoicemailStatus.idl',
'nsIVoicemailProvider.idl',

Просмотреть файл

@ -4,31 +4,33 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIDOMEventTarget.idl"
// nsIDOMMozVoicemailStatus
interface MozVoicemailStatus;
interface nsIDOMMozVoicemailStatus;
[scriptable, builtinclass, uuid(12e6604b-4981-4aa4-a31f-f77181f8a466)]
interface nsIDOMMozVoicemail : nsIDOMEventTarget
interface MozVoicemail : EventTarget
{
/**
* The current voicemail status, or null when the status is unknown
*/
readonly attribute nsIDOMMozVoicemailStatus status;
[GetterThrows]
readonly attribute MozVoicemailStatus? status;
/**
* The voicemail box dialing number, or null if one wasn't found
*/
readonly attribute DOMString number;
[GetterThrows]
readonly attribute DOMString? number;
/**
* The display name of the voicemail box dialing number, or null if one
* wasn't found
*/
readonly attribute DOMString displayName;
[GetterThrows]
readonly attribute DOMString? displayName;
/**
* The current voicemail status has changed
*/
[implicit_jscontext] attribute jsval onstatuschanged;
[SetterThrows]
attribute EventHandler onstatuschanged;
};

Просмотреть файл

@ -269,8 +269,6 @@ partial interface Navigator {
readonly attribute MozCellBroadcast mozCellBroadcast;
};
// nsIMozNavigatorVoicemail
interface MozVoicemail;
partial interface Navigator {
[Throws, Func="Navigator::HasVoicemailSupport"]
readonly attribute MozVoicemail mozVoicemail;

Просмотреть файл

@ -447,6 +447,7 @@ ifdef MOZ_B2G_RIL
webidl_files += \
CallsList.webidl \
MozStkCommandEvent.webidl \
MozVoicemail.webidl \
Telephony.webidl \
TelephonyCall.webidl \
TelephonyCallGroup.webidl \

Просмотреть файл

@ -107,7 +107,7 @@ abstract class AboutHomeTest extends BaseTest {
* This method uses the predefined tags in HomePager.
*/
protected final ListView findListViewWithTag(String tag) {
for (ListView listView : mSolo.getCurrentListViews()) {
for (ListView listView : mSolo.getCurrentViews(ListView.class)) {
final String listTag = (String) listView.getTag();
if (TextUtils.isEmpty(listTag)) {
continue;

Просмотреть файл

@ -137,7 +137,7 @@ public class testAddSearchEngine extends PixelTest {
public boolean test() {
ArrayList<ListView> views;
int searchEngineCount = 0;
views = mSolo.getCurrentListViews();
views = mSolo.getCurrentViews(ListView.class);
for (ListView view : views) {
ListAdapter adapter = view.getAdapter();
if (adapter != null) {

Просмотреть файл

@ -26,7 +26,7 @@ public class testPermissions extends PixelTest {
waitForText("wants your location");
// Uncheck the "Don't ask again for this site" checkbox
ArrayList<CheckBox> checkBoxes = mSolo.getCurrentCheckBoxes();
ArrayList<CheckBox> checkBoxes = mSolo.getCurrentViews(CheckBox.class);
mAsserter.ok(checkBoxes.size() == 1, "checkbox count", "only one checkbox visible");
mAsserter.ok(mSolo.isCheckBoxChecked(0), "checkbox checked", "checkbox is checked");
mSolo.clickOnCheckBox(0);

Просмотреть файл

@ -573,7 +573,7 @@ WebappsActor.prototype = {
},
watchApps: function () {
this._framesByOrigin = {};
this._openedApps = new Set();
let chromeWindow = Services.wm.getMostRecentWindow('navigator:browser');
let systemAppFrame = chromeWindow.getContentWindow();
systemAppFrame.addEventListener("appwillopen", this);
@ -583,7 +583,7 @@ WebappsActor.prototype = {
},
unwatchApps: function () {
this._framesByOrigin = null;
this._openedApps = null;
let chromeWindow = Services.wm.getMostRecentWindow('navigator:browser');
let systemAppFrame = chromeWindow.getContentWindow();
systemAppFrame.removeEventListener("appwillopen", this);
@ -593,46 +593,33 @@ WebappsActor.prototype = {
},
handleEvent: function (event) {
let frame;
let origin = event.detail.origin;
let manifestURL;
switch(event.type) {
case "appwillopen":
frame = event.target;
let frame = event.target;
manifestURL = frame.getAttribute("mozapp")
// Ignore the event if we already received an appwillopen for this app
// (appwillopen is also fired when the app has been moved to background
// and get back to foreground)
let mm = frame.QueryInterface(Ci.nsIFrameLoaderOwner)
.frameLoader
.messageManager;
if (this._appActorsMap.has(mm)) {
if (this._openedApps.has(manifestURL)) {
return;
}
// Workaround to be able to get the related frame on `appterminated`.
// `appterminated` event being dispatched by gaia only comes app origin
// whereas we need to get the its manifest URL, that we can fetch
// on the app frame.
this._framesByOrigin[origin] = frame;
this._openedApps.add(manifestURL);
this.conn.send({ from: this.actorID,
type: "appOpen",
manifestURL: frame.getAttribute("mozapp")
manifestURL: manifestURL
});
break;
case "appterminated":
// Get the related app frame out of this event
// TODO: eventually fire the event on the frame or at least use
// manifestURL as key (and propagate manifestURL via event detail)
frame = this._framesByOrigin[origin];
delete this._framesByOrigin[origin];
if (frame) {
let manifestURL = frame.getAttribute("mozapp");
this.conn.send({ from: this.actorID,
type: "appClose",
manifestURL: manifestURL
});
}
manifestURL = event.detail.manifestURL;
this._openedApps.delete(manifestURL);
this.conn.send({ from: this.actorID,
type: "appClose",
manifestURL: manifestURL
});
break;
}
}

Просмотреть файл

@ -5,7 +5,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
/**
* Loads the remote debugging protocol code into a sandbox, in order to
* shield it from the debuggee. This way, when debugging chrome globals,
@ -16,11 +15,30 @@ const Ci = Components.interfaces;
const Cc = Components.classes;
const Cu = Components.utils;
const { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
this.EXPORTED_SYMBOLS = ["DebuggerServer", "ActorPool"];
let server = devtools.require("devtools/server/main");
var loadSubScript =
"function loadSubScript(aURL)\n" +
"{\n" +
"const Ci = Components.interfaces;\n" +
"const Cc = Components.classes;\n" +
" try {\n" +
" let loader = Cc[\"@mozilla.org/moz/jssubscript-loader;1\"]\n" +
" .getService(Ci.mozIJSSubScriptLoader);\n" +
" loader.loadSubScript(aURL, this);\n" +
" } catch(e) {\n" +
" dump(\"Error loading: \" + aURL + \": \" + e + \" - \" + e.stack + \"\\n\");\n" +
" throw e;\n" +
" }\n" +
"}";
this.DebuggerServer = server.DebuggerServer;
this.ActorPool = server.ActorPool;
// Load the debugging server in a sandbox with its own compartment.
var systemPrincipal = Cc["@mozilla.org/systemprincipal;1"]
.createInstance(Ci.nsIPrincipal);
var gGlobal = Cu.Sandbox(systemPrincipal);
Cu.evalInSandbox(loadSubScript, gGlobal, "1.8");
gGlobal.loadSubScript("resource://gre/modules/devtools/server/main.js");
this.DebuggerServer = gGlobal.DebuggerServer;
this.ActorPool = gGlobal.ActorPool;

Просмотреть файл

@ -10,7 +10,37 @@
* debugging global.
*/
const { Ci, Cc, CC, Cu, Cr, components: Components } = require("chrome");
// |this.require| is used to test if this file was loaded via the devtools
// loader (as it is in DebuggerProcess.jsm) or via loadSubScript (as it is from
// dbg-server.jsm). Note that testing |require| is not safe in either
// situation, as it causes a ReferenceError.
var Ci, Cc, CC, Cu, Cr, Components;
if (this.require) {
({ Ci, Cc, CC, Cu, Cr, components: Components }) = require("chrome");
} else {
({
interfaces: Ci,
classes: Cc,
Constructor: CC,
utils: Cu,
results: Cr
}) = Components;
}
// On B2G, if |this.require| is undefined at this point, it remains undefined
// later on when |DebuggerServer.registerModule| is called. On desktop (and
// perhaps other places), if |this.require| starts out undefined, it ends up
// being set to some native code by the time we get to |registerModule|. Here
// we perform a test early on, and then cache the correct require function for
// later use.
var localRequire;
if (this.require) {
localRequire = id => require(id);
} else {
let { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
localRequire = id => devtools.require(id);
}
const DBG_STRINGS_URI = "chrome://global/locale/devtools/debugger.properties";
Cu.import("resource://gre/modules/Services.jsm");
@ -35,7 +65,7 @@ function loadSubScript(aURL)
}
}
let loaderRequire = require;
let loaderRequire = this.require;
this.require = null;
loadSubScript.call(this, "resource://gre/modules/commonjs/sdk/core/promise.js");
this.require = loaderRequire;
@ -272,7 +302,7 @@ var DebuggerServer = {
}
let moduleAPI = ModuleAPI();
let mod = require(id);
let mod = localRequire(id);
mod.register(moduleAPI);
gRegisteredModules[id] = { module: mod, api: moduleAPI };
},
@ -618,7 +648,9 @@ var DebuggerServer = {
}
};
exports.DebuggerServer = DebuggerServer;
if (this.exports) {
exports.DebuggerServer = DebuggerServer;
}
/**
* Construct an ActorPool.
@ -634,7 +666,9 @@ function ActorPool(aConnection)
this._actors = {};
}
exports.ActorPool = ActorPool;
if (this.exports) {
exports.ActorPool = ActorPool;
}
ActorPool.prototype = {
/**

Просмотреть файл

@ -120,8 +120,10 @@ XPInstallConfirm.init = function XPInstallConfirm_init()
}
function myUnload() {
document.removeEventListener("focus", myfocus, true);
document.removeEventListener("blur", myblur, true);
if (_installCountdownLength > 0) {
document.removeEventListener("focus", myfocus, true);
document.removeEventListener("blur", myblur, true);
}
window.removeEventListener("unload", myUnload, false);
// Now perform the desired action - either install the
@ -136,10 +138,11 @@ XPInstallConfirm.init = function XPInstallConfirm_init()
}
}
window.addEventListener("unload", myUnload, false);
if (_installCountdownLength > 0) {
document.addEventListener("focus", myfocus, true);
document.addEventListener("blur", myblur, true);
window.addEventListener("unload", myUnload, false);
okButton.disabled = true;
setWidgetsAfterFocus();