зеркало из https://github.com/mozilla/pjs.git
Merge m-i to m-c.
This commit is contained in:
Коммит
644af90925
|
@ -256,7 +256,8 @@ FeedWriter.prototype = {
|
||||||
__contentSandbox: null,
|
__contentSandbox: null,
|
||||||
get _contentSandbox() {
|
get _contentSandbox() {
|
||||||
if (!this.__contentSandbox)
|
if (!this.__contentSandbox)
|
||||||
this.__contentSandbox = new Cu.Sandbox(this._window);
|
this.__contentSandbox = new Cu.Sandbox(this._window,
|
||||||
|
{sandboxName: 'FeedWriter'});
|
||||||
|
|
||||||
return this.__contentSandbox;
|
return this.__contentSandbox;
|
||||||
},
|
},
|
||||||
|
|
|
@ -59,7 +59,7 @@ window.onload = function() {
|
||||||
gStateObject = JSON.parse(sessionData.value);
|
gStateObject = JSON.parse(sessionData.value);
|
||||||
}
|
}
|
||||||
catch (exJSON) {
|
catch (exJSON) {
|
||||||
var s = new Cu.Sandbox("about:blank");
|
var s = new Cu.Sandbox("about:blank", {sandboxName: 'aboutSessionRestore'});
|
||||||
gStateObject = Cu.evalInSandbox("(" + sessionData.value + ")", s);
|
gStateObject = Cu.evalInSandbox("(" + sessionData.value + ")", s);
|
||||||
// If we couldn't parse the string with JSON.parse originally, make sure
|
// If we couldn't parse the string with JSON.parse originally, make sure
|
||||||
// that the value in the textbox will be parsable.
|
// that the value in the textbox will be parsable.
|
||||||
|
|
|
@ -135,7 +135,7 @@ SessionStartup.prototype = {
|
||||||
this._initialState = JSON.parse(iniString);
|
this._initialState = JSON.parse(iniString);
|
||||||
}
|
}
|
||||||
catch (exJSON) {
|
catch (exJSON) {
|
||||||
var s = new Cu.Sandbox("about:blank");
|
var s = new Cu.Sandbox("about:blank", {sandboxName: 'nsSessionStartup'});
|
||||||
this._initialState = Cu.evalInSandbox("(" + iniString + ")", s);
|
this._initialState = Cu.evalInSandbox("(" + iniString + ")", s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -178,7 +178,8 @@ var Scratchpad = {
|
||||||
this._previousLocation != this.gBrowser.contentWindow.location.href) {
|
this._previousLocation != this.gBrowser.contentWindow.location.href) {
|
||||||
let contentWindow = this.gBrowser.selectedBrowser.contentWindow;
|
let contentWindow = this.gBrowser.selectedBrowser.contentWindow;
|
||||||
this._contentSandbox = new Cu.Sandbox(contentWindow,
|
this._contentSandbox = new Cu.Sandbox(contentWindow,
|
||||||
{ sandboxPrototype: contentWindow, wantXrays: false });
|
{ sandboxPrototype: contentWindow, wantXrays: false,
|
||||||
|
sandboxName: 'scratchpad-content'});
|
||||||
|
|
||||||
this._previousBrowserWindow = this.browserWindow;
|
this._previousBrowserWindow = this.browserWindow;
|
||||||
this._previousBrowser = this.gBrowser.selectedBrowser;
|
this._previousBrowser = this.gBrowser.selectedBrowser;
|
||||||
|
@ -211,7 +212,8 @@ var Scratchpad = {
|
||||||
if (!this._chromeSandbox ||
|
if (!this._chromeSandbox ||
|
||||||
this.browserWindow != this._previousBrowserWindow) {
|
this.browserWindow != this._previousBrowserWindow) {
|
||||||
this._chromeSandbox = new Cu.Sandbox(this.browserWindow,
|
this._chromeSandbox = new Cu.Sandbox(this.browserWindow,
|
||||||
{ sandboxPrototype: this.browserWindow, wantXrays: false });
|
{ sandboxPrototype: this.browserWindow, wantXrays: false,
|
||||||
|
sandboxName: 'scratchpad-chrome'});
|
||||||
|
|
||||||
this._previousBrowserWindow = this.browserWindow;
|
this._previousBrowserWindow = this.browserWindow;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,12 +5,17 @@ import os
|
||||||
|
|
||||||
class DeviceManagerADB(DeviceManager):
|
class DeviceManagerADB(DeviceManager):
|
||||||
|
|
||||||
def __init__(self, host = None, port = 20701, retrylimit = 5, packageName = "org.mozilla.fennec_unofficial"):
|
def __init__(self, host = None, port = 20701, retrylimit = 5, packageName = None):
|
||||||
self.host = host
|
self.host = host
|
||||||
self.port = port
|
self.port = port
|
||||||
self.retrylimit = retrylimit
|
self.retrylimit = retrylimit
|
||||||
self.retries = 0
|
self.retries = 0
|
||||||
self._sock = None
|
self._sock = None
|
||||||
|
if packageName == None:
|
||||||
|
if os.getenv('USER'):
|
||||||
|
packageName = 'org.mozilla.fennec_' + os.getenv('USER')
|
||||||
|
else:
|
||||||
|
packageName = 'org.mozilla.fennec_'
|
||||||
self.Init(packageName)
|
self.Init(packageName)
|
||||||
|
|
||||||
def Init(self, packageName):
|
def Init(self, packageName):
|
||||||
|
@ -27,7 +32,11 @@ class DeviceManagerADB(DeviceManager):
|
||||||
self.tmpDir = None
|
self.tmpDir = None
|
||||||
try:
|
try:
|
||||||
# a test to see if we have root privs
|
# a test to see if we have root privs
|
||||||
self.checkCmd(["shell", "ls", "/sbin"])
|
files = self.listFiles("/data/data")
|
||||||
|
if (len(files) == 1):
|
||||||
|
if (files[0].find("Permission denied") != -1):
|
||||||
|
print "NOT running as root"
|
||||||
|
raise Exception("not running as root")
|
||||||
except:
|
except:
|
||||||
try:
|
try:
|
||||||
self.checkCmd(["root"])
|
self.checkCmd(["root"])
|
||||||
|
@ -98,7 +107,7 @@ class DeviceManagerADB(DeviceManager):
|
||||||
try:
|
try:
|
||||||
if (not self.dirExists(remoteDir)):
|
if (not self.dirExists(remoteDir)):
|
||||||
self.mkDirs(remoteDir+"/x")
|
self.mkDirs(remoteDir+"/x")
|
||||||
for root, dirs, files in os.walk(localDir):
|
for root, dirs, files in os.walk(localDir, followlinks='true'):
|
||||||
relRoot = os.path.relpath(root, localDir)
|
relRoot = os.path.relpath(root, localDir)
|
||||||
for file in files:
|
for file in files:
|
||||||
localFile = os.path.join(root, file)
|
localFile = os.path.join(root, file)
|
||||||
|
@ -134,8 +143,12 @@ class DeviceManagerADB(DeviceManager):
|
||||||
# success: True
|
# success: True
|
||||||
# failure: False
|
# failure: False
|
||||||
def fileExists(self, filepath):
|
def fileExists(self, filepath):
|
||||||
self.checkCmd(["shell", "ls", filepath])
|
p = self.runCmd(["shell", "ls", "-a", filepath])
|
||||||
return True
|
data = p.stdout.readlines()
|
||||||
|
if (len(data) == 1):
|
||||||
|
if (data[0].rstrip() == filepath):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def removeFile(self, filename):
|
def removeFile(self, filename):
|
||||||
return self.runCmd(["shell", "rm", filename]).stdout.read()
|
return self.runCmd(["shell", "rm", filename]).stdout.read()
|
||||||
|
@ -381,18 +394,11 @@ class DeviceManagerADB(DeviceManager):
|
||||||
return devroot + '/fennec'
|
return devroot + '/fennec'
|
||||||
elif (self.dirExists(devroot + '/firefox')):
|
elif (self.dirExists(devroot + '/firefox')):
|
||||||
return devroot + '/firefox'
|
return devroot + '/firefox'
|
||||||
elif (self.dirExists('/data/data/org.mozilla.fennec')):
|
elif (self.packageName and self.dirExists('/data/data/' + self.packageName)):
|
||||||
return '/data/data/org.mozilla.fennec'
|
return '/data/data/' + self.packageName
|
||||||
elif (self.dirExists('/data/data/org.mozilla.firefox')):
|
|
||||||
return '/data/data/org.mozilla.firefox'
|
|
||||||
elif (self.dirExists('/data/data/org.mozilla.fennec_unofficial')):
|
|
||||||
return '/data/data/org.mozilla.fennec_unofficial'
|
|
||||||
elif (self.dirExists('/data/data/org.mozilla.fennec_aurora')):
|
|
||||||
return '/data/data/org.mozilla.fennec_aurora'
|
|
||||||
elif (self.dirExists('/data/data/org.mozilla.firefox_beta')):
|
|
||||||
return '/data/data/org.mozilla.firefox_beta'
|
|
||||||
|
|
||||||
# Failure (either not installed or not a recognized platform)
|
# Failure (either not installed or not a recognized platform)
|
||||||
|
print "devicemanagerADB: getAppRoot failed"
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# Gets the directory location on the device for a specific test type
|
# Gets the directory location on the device for a specific test type
|
||||||
|
|
|
@ -153,6 +153,20 @@ xpcshell-tests:
|
||||||
$(LIBXUL_DIST)/bin/xpcshell \
|
$(LIBXUL_DIST)/bin/xpcshell \
|
||||||
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
|
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
|
||||||
|
|
||||||
|
xpcshell-tests-remote: DM_TRANS?=adb
|
||||||
|
xpcshell-tests-remote:
|
||||||
|
$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
|
||||||
|
-I$(topsrcdir)/build \
|
||||||
|
-I$(topsrcdir)/build/mobile \
|
||||||
|
$(topsrcdir)/testing/xpcshell/remotexpcshelltests.py \
|
||||||
|
--symbols-path=$(DIST)/crashreporter-symbols \
|
||||||
|
--build-info-json=$(DEPTH)/mozinfo.json \
|
||||||
|
$(EXTRA_TEST_ARGS) \
|
||||||
|
--dm_trans=$(DM_TRANS) \
|
||||||
|
--deviceIP=${TEST_DEVICE} \
|
||||||
|
--objdir=$(DEPTH) \
|
||||||
|
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
|
||||||
|
|
||||||
# Execute a single test, specified in $(SOLO_FILE), but don't automatically
|
# Execute a single test, specified in $(SOLO_FILE), but don't automatically
|
||||||
# start the test. Instead, present the xpcshell prompt so the user can
|
# start the test. Instead, present the xpcshell prompt so the user can
|
||||||
# attach a debugger and then start the test.
|
# attach a debugger and then start the test.
|
||||||
|
@ -182,6 +196,23 @@ check-one:
|
||||||
$(LIBXUL_DIST)/bin/xpcshell \
|
$(LIBXUL_DIST)/bin/xpcshell \
|
||||||
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
|
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
|
||||||
|
|
||||||
|
check-one-remote: DM_TRANS?=adb
|
||||||
|
check-one-remote:
|
||||||
|
$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
|
||||||
|
-I$(topsrcdir)/build \
|
||||||
|
-I$(topsrcdir)/build/mobile \
|
||||||
|
$(testxpcsrcdir)/remotexpcshelltests.py \
|
||||||
|
--symbols-path=$(DIST)/crashreporter-symbols \
|
||||||
|
--build-info-json=$(DEPTH)/mozinfo.json \
|
||||||
|
--test-path=$(SOLO_FILE) \
|
||||||
|
--profile-name=$(MOZ_APP_NAME) \
|
||||||
|
--verbose \
|
||||||
|
$(EXTRA_TEST_ARGS) \
|
||||||
|
--dm_trans=$(DM_TRANS) \
|
||||||
|
--deviceIP=${TEST_DEVICE} \
|
||||||
|
--objdir=$(DEPTH) \
|
||||||
|
--noSetup \
|
||||||
|
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
|
||||||
endif # XPCSHELL_TESTS
|
endif # XPCSHELL_TESTS
|
||||||
|
|
||||||
ifdef CPP_UNIT_TESTS
|
ifdef CPP_UNIT_TESTS
|
||||||
|
|
|
@ -3,4 +3,8 @@ head = head_plugins.js
|
||||||
tail =
|
tail =
|
||||||
|
|
||||||
[test_bug455213.js]
|
[test_bug455213.js]
|
||||||
|
# Bug 676953: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_bug471245.js]
|
[test_bug471245.js]
|
||||||
|
# Bug 676953: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
|
|
|
@ -421,6 +421,7 @@ abstract public class GeckoApp
|
||||||
public void onStart()
|
public void onStart()
|
||||||
{
|
{
|
||||||
Log.i(LOG_FILE_NAME, "start");
|
Log.i(LOG_FILE_NAME, "start");
|
||||||
|
GeckoAppShell.sendEventToGecko(new GeckoEvent(GeckoEvent.ACTIVITY_START));
|
||||||
super.onStart();
|
super.onStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,7 @@ public class GeckoEvent {
|
||||||
public static final int SURFACE_CREATED = 13;
|
public static final int SURFACE_CREATED = 13;
|
||||||
public static final int SURFACE_DESTROYED = 14;
|
public static final int SURFACE_DESTROYED = 14;
|
||||||
public static final int GECKO_EVENT_SYNC = 15;
|
public static final int GECKO_EVENT_SYNC = 15;
|
||||||
|
public static final int ACTIVITY_START = 17;
|
||||||
|
|
||||||
public static final int IME_COMPOSITION_END = 0;
|
public static final int IME_COMPOSITION_END = 0;
|
||||||
public static final int IME_COMPOSITION_BEGIN = 1;
|
public static final int IME_COMPOSITION_BEGIN = 1;
|
||||||
|
|
|
@ -3,4 +3,8 @@ head =
|
||||||
tail =
|
tail =
|
||||||
|
|
||||||
[test_wwauthpromptfactory.js]
|
[test_wwauthpromptfactory.js]
|
||||||
|
# Bug 676955: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_wwpromptfactory.js]
|
[test_wwpromptfactory.js]
|
||||||
|
# Bug 676955: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
|
|
|
@ -111,6 +111,8 @@ tail =
|
||||||
[test_encode_CP852.js]
|
[test_encode_CP852.js]
|
||||||
[test_encode_CP855.js]
|
[test_encode_CP855.js]
|
||||||
[test_encode_CP857.js]
|
[test_encode_CP857.js]
|
||||||
|
# Bug 676958: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_encode_CP862.js]
|
[test_encode_CP862.js]
|
||||||
[test_encode_CP864.js]
|
[test_encode_CP864.js]
|
||||||
[test_encode_CP874.js]
|
[test_encode_CP874.js]
|
||||||
|
|
|
@ -3,4 +3,6 @@ head =
|
||||||
tail =
|
tail =
|
||||||
|
|
||||||
[test_ipcshell.js]
|
[test_ipcshell.js]
|
||||||
|
# Bug 676963: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_ipcshell_child.js]
|
[test_ipcshell_child.js]
|
||||||
|
|
|
@ -153,6 +153,20 @@ xpcshell-tests:
|
||||||
$(LIBXUL_DIST)/bin/xpcshell \
|
$(LIBXUL_DIST)/bin/xpcshell \
|
||||||
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
|
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
|
||||||
|
|
||||||
|
xpcshell-tests-remote: DM_TRANS?=adb
|
||||||
|
xpcshell-tests-remote:
|
||||||
|
$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
|
||||||
|
-I$(topsrcdir)/build \
|
||||||
|
-I$(topsrcdir)/build/mobile \
|
||||||
|
$(topsrcdir)/testing/xpcshell/remotexpcshelltests.py \
|
||||||
|
--symbols-path=$(DIST)/crashreporter-symbols \
|
||||||
|
--build-info-json=$(DEPTH)/mozinfo.json \
|
||||||
|
$(EXTRA_TEST_ARGS) \
|
||||||
|
--dm_trans=$(DM_TRANS) \
|
||||||
|
--deviceIP=${TEST_DEVICE} \
|
||||||
|
--objdir=$(DEPTH) \
|
||||||
|
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
|
||||||
|
|
||||||
# Execute a single test, specified in $(SOLO_FILE), but don't automatically
|
# Execute a single test, specified in $(SOLO_FILE), but don't automatically
|
||||||
# start the test. Instead, present the xpcshell prompt so the user can
|
# start the test. Instead, present the xpcshell prompt so the user can
|
||||||
# attach a debugger and then start the test.
|
# attach a debugger and then start the test.
|
||||||
|
@ -182,6 +196,23 @@ check-one:
|
||||||
$(LIBXUL_DIST)/bin/xpcshell \
|
$(LIBXUL_DIST)/bin/xpcshell \
|
||||||
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
|
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
|
||||||
|
|
||||||
|
check-one-remote: DM_TRANS?=adb
|
||||||
|
check-one-remote:
|
||||||
|
$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
|
||||||
|
-I$(topsrcdir)/build \
|
||||||
|
-I$(topsrcdir)/build/mobile \
|
||||||
|
$(testxpcsrcdir)/remotexpcshelltests.py \
|
||||||
|
--symbols-path=$(DIST)/crashreporter-symbols \
|
||||||
|
--build-info-json=$(DEPTH)/mozinfo.json \
|
||||||
|
--test-path=$(SOLO_FILE) \
|
||||||
|
--profile-name=$(MOZ_APP_NAME) \
|
||||||
|
--verbose \
|
||||||
|
$(EXTRA_TEST_ARGS) \
|
||||||
|
--dm_trans=$(DM_TRANS) \
|
||||||
|
--deviceIP=${TEST_DEVICE} \
|
||||||
|
--objdir=$(DEPTH) \
|
||||||
|
--noSetup \
|
||||||
|
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
|
||||||
endif # XPCSHELL_TESTS
|
endif # XPCSHELL_TESTS
|
||||||
|
|
||||||
ifdef CPP_UNIT_TESTS
|
ifdef CPP_UNIT_TESTS
|
||||||
|
|
|
@ -1837,7 +1837,9 @@ main(int argc, char **argv, char **envp)
|
||||||
XRE_GetFileFromPath(argv[4], getter_AddRefs(appOmni));
|
XRE_GetFileFromPath(argv[4], getter_AddRefs(appOmni));
|
||||||
argc-=2;
|
argc-=2;
|
||||||
argv+=2;
|
argv+=2;
|
||||||
}
|
} else {
|
||||||
|
appOmni = greOmni;
|
||||||
|
}
|
||||||
|
|
||||||
XRE_InitOmnijar(greOmni, appOmni);
|
XRE_InitOmnijar(greOmni, appOmni);
|
||||||
argc-=2;
|
argc-=2;
|
||||||
|
|
|
@ -2073,7 +2073,8 @@ nsXPConnect::CreateSandbox(JSContext *cx, nsIPrincipal *principal,
|
||||||
jsval rval = JSVAL_VOID;
|
jsval rval = JSVAL_VOID;
|
||||||
AUTO_MARK_JSVAL(ccx, &rval);
|
AUTO_MARK_JSVAL(ccx, &rval);
|
||||||
|
|
||||||
nsresult rv = xpc_CreateSandboxObject(cx, &rval, principal, NULL, false);
|
nsresult rv = xpc_CreateSandboxObject(cx, &rval, principal, NULL, false,
|
||||||
|
EmptyCString());
|
||||||
NS_ASSERTION(NS_FAILED(rv) || !JSVAL_IS_PRIMITIVE(rval),
|
NS_ASSERTION(NS_FAILED(rv) || !JSVAL_IS_PRIMITIVE(rval),
|
||||||
"Bad return value from xpc_CreateSandboxObject()!");
|
"Bad return value from xpc_CreateSandboxObject()!");
|
||||||
|
|
||||||
|
|
|
@ -3153,7 +3153,7 @@ NS_IMPL_ISUPPORTS0(Identity)
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
xpc_CreateSandboxObject(JSContext * cx, jsval * vp, nsISupports *prinOrSop, JSObject *proto,
|
xpc_CreateSandboxObject(JSContext * cx, jsval * vp, nsISupports *prinOrSop, JSObject *proto,
|
||||||
bool wantXrays)
|
bool wantXrays, const nsACString &sandboxName)
|
||||||
{
|
{
|
||||||
// Create the sandbox global object
|
// Create the sandbox global object
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
@ -3240,6 +3240,10 @@ xpc_CreateSandboxObject(JSContext * cx, jsval * vp, nsISupports *prinOrSop, JSOb
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xpc::CompartmentPrivate *compartmentPrivate =
|
||||||
|
static_cast<xpc::CompartmentPrivate*>(JS_GetCompartmentPrivate(cx, compartment));
|
||||||
|
compartmentPrivate->location = sandboxName;
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3351,6 +3355,8 @@ nsXPCComponents_utils_Sandbox::CallOrConstruct(nsIXPConnectWrappedNative *wrappe
|
||||||
|
|
||||||
JSObject *proto = nsnull;
|
JSObject *proto = nsnull;
|
||||||
bool wantXrays = true;
|
bool wantXrays = true;
|
||||||
|
nsCString sandboxName;
|
||||||
|
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
if (!JSVAL_IS_OBJECT(argv[1]))
|
if (!JSVAL_IS_OBJECT(argv[1]))
|
||||||
return ThrowAndFail(NS_ERROR_INVALID_ARG, cx, _retval);
|
return ThrowAndFail(NS_ERROR_INVALID_ARG, cx, _retval);
|
||||||
|
@ -3382,9 +3388,26 @@ nsXPCComponents_utils_Sandbox::CallOrConstruct(nsIXPConnectWrappedNative *wrappe
|
||||||
|
|
||||||
wantXrays = JSVAL_TO_BOOLEAN(option);
|
wantXrays = JSVAL_TO_BOOLEAN(option);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!JS_HasProperty(cx, optionsObject, "sandboxName", &found))
|
||||||
|
return NS_ERROR_INVALID_ARG;
|
||||||
|
|
||||||
|
if (found) {
|
||||||
|
if (!JS_GetProperty(cx, optionsObject, "sandboxName", &option) ||
|
||||||
|
!JSVAL_IS_STRING(option)) {
|
||||||
|
return ThrowAndFail(NS_ERROR_INVALID_ARG, cx, _retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
char *tmp = JS_EncodeString(cx, JSVAL_TO_STRING(option));
|
||||||
|
if (!tmp) {
|
||||||
|
return ThrowAndFail(NS_ERROR_INVALID_ARG, cx, _retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
sandboxName.Adopt(tmp, strlen(tmp));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rv = xpc_CreateSandboxObject(cx, vp, prinOrSop, proto, wantXrays);
|
rv = xpc_CreateSandboxObject(cx, vp, prinOrSop, proto, wantXrays, sandboxName);
|
||||||
|
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
return ThrowAndFail(rv, cx, _retval);
|
return ThrowAndFail(rv, cx, _retval);
|
||||||
|
|
|
@ -1578,22 +1578,30 @@ CompartmentStats::CompartmentStats(JSContext *cx, JSCompartment *c)
|
||||||
{
|
{
|
||||||
if(c->principals->codebase)
|
if(c->principals->codebase)
|
||||||
{
|
{
|
||||||
// A hack: replace forward slashes with '\\' so they aren't
|
|
||||||
// treated as path separators. Users of the reporters
|
|
||||||
// (such as about:memory) have to undo this change.
|
|
||||||
name.Assign(c->principals->codebase);
|
name.Assign(c->principals->codebase);
|
||||||
name.ReplaceChar('/', '\\');
|
|
||||||
|
|
||||||
// If it's the system compartment, append the address.
|
// If it's the system compartment, append the address.
|
||||||
// This means that multiple system compartments (and there
|
// This means that multiple system compartments (and there
|
||||||
// can be many) can be distinguished.
|
// can be many) can be distinguished.
|
||||||
if(c->isSystemCompartment)
|
if(c->isSystemCompartment)
|
||||||
{
|
{
|
||||||
|
if (c->data &&
|
||||||
|
!((xpc::CompartmentPrivate*)c->data)->location.IsEmpty())
|
||||||
|
{
|
||||||
|
name.AppendLiteral(", ");
|
||||||
|
name.Append(((xpc::CompartmentPrivate*)c->data)->location);
|
||||||
|
}
|
||||||
|
|
||||||
// ample; 64-bit address max is 18 chars
|
// ample; 64-bit address max is 18 chars
|
||||||
static const int maxLength = 31;
|
static const int maxLength = 31;
|
||||||
nsPrintfCString address(maxLength, ", 0x%llx", PRUint64(c));
|
nsPrintfCString address(maxLength, ", 0x%llx", PRUint64(c));
|
||||||
name.Append(address);
|
name.Append(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A hack: replace forward slashes with '\\' so they aren't
|
||||||
|
// treated as path separators. Users of the reporters
|
||||||
|
// (such as about:memory) have to undo this change.
|
||||||
|
name.ReplaceChar('/', '\\');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -4315,7 +4315,7 @@ xpc_GetJSPrivate(JSObject *obj)
|
||||||
// and used.
|
// and used.
|
||||||
nsresult
|
nsresult
|
||||||
xpc_CreateSandboxObject(JSContext * cx, jsval * vp, nsISupports *prinOrSop,
|
xpc_CreateSandboxObject(JSContext * cx, jsval * vp, nsISupports *prinOrSop,
|
||||||
JSObject *proto, bool preferXray);
|
JSObject *proto, bool preferXray, const nsACString &sandboxName);
|
||||||
|
|
||||||
// Helper for evaluating scripts in a sandbox object created with
|
// Helper for evaluating scripts in a sandbox object created with
|
||||||
// xpc_CreateSandboxObject(). The caller is responsible of ensuring
|
// xpc_CreateSandboxObject(). The caller is responsible of ensuring
|
||||||
|
@ -4394,6 +4394,7 @@ struct CompartmentPrivate
|
||||||
JSObject2JSObjectMap *waiverWrapperMap;
|
JSObject2JSObjectMap *waiverWrapperMap;
|
||||||
// NB: we don't want this map to hold a strong reference to the wrapper.
|
// NB: we don't want this map to hold a strong reference to the wrapper.
|
||||||
nsDataHashtable<nsPtrHashKey<XPCWrappedNative>, JSObject *> *expandoMap;
|
nsDataHashtable<nsPtrHashKey<XPCWrappedNative>, JSObject *> *expandoMap;
|
||||||
|
nsCString location;
|
||||||
|
|
||||||
bool RegisterExpandoObject(XPCWrappedNative *wn, JSObject *expando) {
|
bool RegisterExpandoObject(XPCWrappedNative *wn, JSObject *expando) {
|
||||||
if (!expandoMap) {
|
if (!expandoMap) {
|
||||||
|
|
|
@ -15,6 +15,8 @@ tail =
|
||||||
[test_import.js]
|
[test_import.js]
|
||||||
[test_js_weak_references.js]
|
[test_js_weak_references.js]
|
||||||
[test_localeCompare.js]
|
[test_localeCompare.js]
|
||||||
|
# Bug 676965: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_recursive_import.js]
|
[test_recursive_import.js]
|
||||||
[test_xpcomutils.js]
|
[test_xpcomutils.js]
|
||||||
[test_unload.js]
|
[test_unload.js]
|
||||||
|
|
|
@ -83,11 +83,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Size to use for PLArena block allocations.
|
// Size to use for PLArena block allocations.
|
||||||
// XXX: This should be 8192; the subtracted elements are a hack that's
|
static const size_t ARENA_PAGE_SIZE = 8192;
|
||||||
// required to ensure the allocation requests are power-of-two-sized and thus
|
|
||||||
// avoid lots of wasted memory caused by the heap allocator rounding up request
|
|
||||||
// sizes. Bug 676457 will fix it properly.
|
|
||||||
static const size_t ARENA_PAGE_SIZE = 8192 - sizeof(PLArena) - PL_ARENA_CONST_ALIGN_MASK;
|
|
||||||
|
|
||||||
// Freed memory is filled with a poison value, which we arrange to
|
// Freed memory is filled with a poison value, which we arrange to
|
||||||
// form a pointer either to an always-unmapped region of the address
|
// form a pointer either to an always-unmapped region of the address
|
||||||
|
|
|
@ -322,6 +322,12 @@ var Browser = {
|
||||||
os.addObserver(SessionHistoryObserver, "browser:purge-session-history", false);
|
os.addObserver(SessionHistoryObserver, "browser:purge-session-history", false);
|
||||||
os.addObserver(ContentCrashObserver, "ipc:content-shutdown", false);
|
os.addObserver(ContentCrashObserver, "ipc:content-shutdown", false);
|
||||||
os.addObserver(MemoryObserver, "memory-pressure", false);
|
os.addObserver(MemoryObserver, "memory-pressure", false);
|
||||||
|
os.addObserver(ActivityObserver, "application-background", false);
|
||||||
|
os.addObserver(ActivityObserver, "application-foreground", false);
|
||||||
|
os.addObserver(ActivityObserver, "system-active", false);
|
||||||
|
os.addObserver(ActivityObserver, "system-idle", false);
|
||||||
|
os.addObserver(ActivityObserver, "system-display-on", false);
|
||||||
|
os.addObserver(ActivityObserver, "system-display-off", false);
|
||||||
|
|
||||||
// Listens for change in the viewable area
|
// Listens for change in the viewable area
|
||||||
#if MOZ_PLATFORM_MAEMO == 6
|
#if MOZ_PLATFORM_MAEMO == 6
|
||||||
|
@ -486,6 +492,12 @@ var Browser = {
|
||||||
os.removeObserver(SessionHistoryObserver, "browser:purge-session-history");
|
os.removeObserver(SessionHistoryObserver, "browser:purge-session-history");
|
||||||
os.removeObserver(ContentCrashObserver, "ipc:content-shutdown");
|
os.removeObserver(ContentCrashObserver, "ipc:content-shutdown");
|
||||||
os.removeObserver(MemoryObserver, "memory-pressure");
|
os.removeObserver(MemoryObserver, "memory-pressure");
|
||||||
|
os.removeObserver(ActivityObserver, "application-background", false);
|
||||||
|
os.removeObserver(ActivityObserver, "application-foreground", false);
|
||||||
|
os.removeObserver(ActivityObserver, "system-active", false);
|
||||||
|
os.removeObserver(ActivityObserver, "system-idle", false);
|
||||||
|
os.removeObserver(ActivityObserver, "system-display-on", false);
|
||||||
|
os.removeObserver(ActivityObserver, "system-display-off", false);
|
||||||
|
|
||||||
window.controllers.removeController(this);
|
window.controllers.removeController(this);
|
||||||
window.controllers.removeController(BrowserUI);
|
window.controllers.removeController(BrowserUI);
|
||||||
|
@ -2585,6 +2597,34 @@ var MemoryObserver = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var ActivityObserver = {
|
||||||
|
_inBackground : false,
|
||||||
|
_notActive : false,
|
||||||
|
_isDisplayOff : false,
|
||||||
|
observe: function ao_observe(aSubject, aTopic, aData) {
|
||||||
|
if (aTopic == "application-background") {
|
||||||
|
this._inBackground = true;
|
||||||
|
} else if (aTopic == "application-foreground") {
|
||||||
|
this._inBackground = false;
|
||||||
|
} else if (aTopic == "system-idle") {
|
||||||
|
this._notActive = true;
|
||||||
|
} else if (aTopic == "system-active") {
|
||||||
|
this._notActive = false;
|
||||||
|
} else if (aTopic == "system-display-on") {
|
||||||
|
this._isDisplayOff = false;
|
||||||
|
} else if (aTopic == "system-display-off") {
|
||||||
|
this._isDisplayOff = true;
|
||||||
|
}
|
||||||
|
let activeTabState = !this._inBackground && !this._notActive && !this._isDisplayOff;
|
||||||
|
if (Browser.selectedTab.active != activeTabState) {
|
||||||
|
// On Maemo all backgrounded applications getting portrait orientation
|
||||||
|
// so if browser had landscape mode then we need timeout in order
|
||||||
|
// to finish last rotate/paint operation and have nice lookine browser in TS
|
||||||
|
setTimeout(function() { Browser.selectedTab.active = activeTabState; }, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
function getNotificationBox(aBrowser) {
|
function getNotificationBox(aBrowser) {
|
||||||
return Browser.getNotificationBox(aBrowser);
|
return Browser.getNotificationBox(aBrowser);
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,16 +179,13 @@ PP_DEB_FILES = debian/control \
|
||||||
debian/fennec.postinst \
|
debian/fennec.postinst \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
ifdef MOZ_ENABLE_CONTENTMANAGER
|
|
||||||
PP_DEB_FILES += debian/fennec.aegis \
|
|
||||||
$(NULL)
|
|
||||||
endif
|
|
||||||
ifeq ($(MOZ_PLATFORM_MAEMO),6)
|
ifeq ($(MOZ_PLATFORM_MAEMO),6)
|
||||||
PP_DEB_FILES += debian/backup \
|
PP_DEB_FILES += debian/fennec.aegis \
|
||||||
debian/restore \
|
debian/backup \
|
||||||
debian/fennec.conf \
|
debian/restore \
|
||||||
debian/fennec-cud.sh \
|
debian/fennec.conf \
|
||||||
debian/fennec-rfs.sh \
|
debian/fennec-cud.sh \
|
||||||
|
debian/fennec-rfs.sh \
|
||||||
debian/fennec.policy \
|
debian/fennec.policy \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
endif
|
endif
|
||||||
|
@ -242,7 +239,7 @@ endif
|
||||||
|
|
||||||
# a defined CONTENTMANAGER implicitly means MOZ_PLATFORM_MAEMO is equals 6
|
# a defined CONTENTMANAGER implicitly means MOZ_PLATFORM_MAEMO is equals 6
|
||||||
# in case you use CONTENTMANGER you need to sign your package to gain tracker access.
|
# in case you use CONTENTMANGER you need to sign your package to gain tracker access.
|
||||||
ifdef MOZ_ENABLE_CONTENTMANAGER
|
ifeq ($(MOZ_PLATFORM_MAEMO),6)
|
||||||
if test -e "/usr/bin/aegis-deb-add"; then \
|
if test -e "/usr/bin/aegis-deb-add"; then \
|
||||||
fakeroot aegis-deb-add -control $(DEBDESTDIR)/DEBIAN/control .. debian/fennec.aegis=_aegis; \
|
fakeroot aegis-deb-add -control $(DEBDESTDIR)/DEBIAN/control .. debian/fennec.aegis=_aegis; \
|
||||||
else \
|
else \
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#filter substitution
|
||||||
<aegis>
|
<aegis>
|
||||||
<request>
|
<request>
|
||||||
<credential name="TrackerReadAccess" />
|
<credential name="TrackerReadAccess" />
|
||||||
|
|
|
@ -8,4 +8,6 @@ tail =
|
||||||
[test_encoder_apng.js]
|
[test_encoder_apng.js]
|
||||||
[test_encoder_png.js]
|
[test_encoder_png.js]
|
||||||
[test_imgtools.js]
|
[test_imgtools.js]
|
||||||
|
# Bug 676968: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_moz_icon_uri.js]
|
[test_moz_icon_uri.js]
|
||||||
|
|
|
@ -75,7 +75,8 @@ nsProxyAutoConfig.prototype = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// allocate a fresh Sandbox to clear global scope for new PAC script
|
// allocate a fresh Sandbox to clear global scope for new PAC script
|
||||||
this._sandBox = new Components.utils.Sandbox(pacURI);
|
this._sandBox = new Components.utils.Sandbox(pacURI,
|
||||||
|
{sandboxName: 'nsProxyAutoConfig'});
|
||||||
Components.utils.evalInSandbox(pacUtils, this._sandBox);
|
Components.utils.evalInSandbox(pacUtils, this._sandBox);
|
||||||
|
|
||||||
// add predefined functions to pac
|
// add predefined functions to pac
|
||||||
|
|
|
@ -8,6 +8,8 @@ tail =
|
||||||
[test_aboutblank.js]
|
[test_aboutblank.js]
|
||||||
[test_auth_proxy.js]
|
[test_auth_proxy.js]
|
||||||
[test_authentication.js]
|
[test_authentication.js]
|
||||||
|
# Bug 675039: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_authpromptwrapper.js]
|
[test_authpromptwrapper.js]
|
||||||
[test_bug203271.js]
|
[test_bug203271.js]
|
||||||
[test_bug248970_cache.js]
|
[test_bug248970_cache.js]
|
||||||
|
@ -38,6 +40,8 @@ tail =
|
||||||
[test_bug455311.js]
|
[test_bug455311.js]
|
||||||
[test_bug455598.js]
|
[test_bug455598.js]
|
||||||
[test_bug468426.js]
|
[test_bug468426.js]
|
||||||
|
# Bug 675039: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug468594.js]
|
[test_bug468594.js]
|
||||||
[test_bug470716.js]
|
[test_bug470716.js]
|
||||||
[test_bug479413.js]
|
[test_bug479413.js]
|
||||||
|
@ -47,6 +51,8 @@ tail =
|
||||||
[test_bug490095.js]
|
[test_bug490095.js]
|
||||||
[test_bug504014.js]
|
[test_bug504014.js]
|
||||||
[test_bug510359.js]
|
[test_bug510359.js]
|
||||||
|
# Bug 675039: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug515583.js]
|
[test_bug515583.js]
|
||||||
[test_bug528292.js]
|
[test_bug528292.js]
|
||||||
[test_bug540566.js]
|
[test_bug540566.js]
|
||||||
|
@ -61,11 +67,21 @@ tail =
|
||||||
[test_bug618835.js]
|
[test_bug618835.js]
|
||||||
[test_bug633743.js]
|
[test_bug633743.js]
|
||||||
[test_bug650955.js]
|
[test_bug650955.js]
|
||||||
|
# Bug 677427: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_bug652761.js]
|
[test_bug652761.js]
|
||||||
[test_bug651100.js]
|
[test_bug651100.js]
|
||||||
|
# Bug 675044: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_bug654926.js]
|
[test_bug654926.js]
|
||||||
|
# Bug 675049: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_bug654926_doom_and_read.js]
|
[test_bug654926_doom_and_read.js]
|
||||||
|
# Bug 675049: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_bug654926_test_seek.js]
|
[test_bug654926_test_seek.js]
|
||||||
|
# Bug 675049: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_bug659569.js]
|
[test_bug659569.js]
|
||||||
[test_bug660066.js]
|
[test_bug660066.js]
|
||||||
[test_bug651185.js]
|
[test_bug651185.js]
|
||||||
|
@ -83,13 +99,29 @@ tail =
|
||||||
[test_event_sink.js]
|
[test_event_sink.js]
|
||||||
[test_extract_charset_from_content_type.js]
|
[test_extract_charset_from_content_type.js]
|
||||||
[test_fallback_no-cache-entry_canceled.js]
|
[test_fallback_no-cache-entry_canceled.js]
|
||||||
|
# Bug 675039: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_fallback_no-cache-entry_passing.js]
|
[test_fallback_no-cache-entry_passing.js]
|
||||||
|
# Bug 675039: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_fallback_redirect-to-different-origin_canceled.js]
|
[test_fallback_redirect-to-different-origin_canceled.js]
|
||||||
|
# Bug 675039: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_fallback_redirect-to-different-origin_passing.js]
|
[test_fallback_redirect-to-different-origin_passing.js]
|
||||||
|
# Bug 675039: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_fallback_request-error_canceled.js]
|
[test_fallback_request-error_canceled.js]
|
||||||
|
# Bug 675039: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_fallback_request-error_passing.js]
|
[test_fallback_request-error_passing.js]
|
||||||
|
# Bug 675039: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_fallback_response-error_canceled.js]
|
[test_fallback_response-error_canceled.js]
|
||||||
|
# Bug 675039: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_fallback_response-error_passing.js]
|
[test_fallback_response-error_passing.js]
|
||||||
|
# Bug 675039: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_file_partial_inputstream.js]
|
[test_file_partial_inputstream.js]
|
||||||
[test_file_protocol.js]
|
[test_file_protocol.js]
|
||||||
[test_filestreams.js]
|
[test_filestreams.js]
|
||||||
|
@ -131,6 +163,8 @@ tail =
|
||||||
[test_simple.js]
|
[test_simple.js]
|
||||||
[test_sockettransportsvc_available.js]
|
[test_sockettransportsvc_available.js]
|
||||||
[test_socks.js]
|
[test_socks.js]
|
||||||
|
# Bug 675039: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_standardurl.js]
|
[test_standardurl.js]
|
||||||
[test_standardurl_port.js]
|
[test_standardurl_port.js]
|
||||||
[test_streamcopier.js]
|
[test_streamcopier.js]
|
||||||
|
|
|
@ -3,5 +3,11 @@ head =
|
||||||
tail =
|
tail =
|
||||||
|
|
||||||
[test_datasignatureverifier.js]
|
[test_datasignatureverifier.js]
|
||||||
|
# Bug 676972: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_hash_algorithms.js]
|
[test_hash_algorithms.js]
|
||||||
|
# Bug 676972: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_hmac.js]
|
[test_hmac.js]
|
||||||
|
# Bug 676972: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
|
|
|
@ -5,3 +5,5 @@ tail =
|
||||||
[test_crypto_crypt.js]
|
[test_crypto_crypt.js]
|
||||||
[test_crypto_deriveKey.js]
|
[test_crypto_deriveKey.js]
|
||||||
[test_crypto_random.js]
|
[test_crypto_random.js]
|
||||||
|
# Bug 676977: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
|
|
|
@ -34,7 +34,8 @@ tail =
|
||||||
[test_interval_triggers.js]
|
[test_interval_triggers.js]
|
||||||
[test_jpakeclient.js]
|
[test_jpakeclient.js]
|
||||||
# Bug 618233: this test produces random failures on Windows 7.
|
# Bug 618233: this test produces random failures on Windows 7.
|
||||||
skip-if = os == "win"
|
# Bug 676978: test hangs on Android (see also testing/xpcshell/xpcshell.ini)
|
||||||
|
skip-if = os == "win" || os == "android"
|
||||||
[test_keys.js]
|
[test_keys.js]
|
||||||
[test_load_modules.js]
|
[test_load_modules.js]
|
||||||
[test_log4moz.js]
|
[test_log4moz.js]
|
||||||
|
@ -60,7 +61,8 @@ skip-if = os == "win"
|
||||||
[test_service_detect_upgrade.js]
|
[test_service_detect_upgrade.js]
|
||||||
[test_service_filelog.js]
|
[test_service_filelog.js]
|
||||||
# Bug 664090: this test persistently fails on Windows opt builds.
|
# Bug 664090: this test persistently fails on Windows opt builds.
|
||||||
skip-if = os == "win" && !debug
|
# Bug 676978: test hangs on Android (see also testing/xpcshell/xpcshell.ini)
|
||||||
|
skip-if = (os == "win" && !debug) || os == "android"
|
||||||
[test_service_getStorageInfo.js]
|
[test_service_getStorageInfo.js]
|
||||||
[test_service_login.js]
|
[test_service_login.js]
|
||||||
[test_service_migratePrefs.js]
|
[test_service_migratePrefs.js]
|
||||||
|
@ -71,14 +73,17 @@ skip-if = os == "win" && !debug
|
||||||
[test_service_sync_401.js]
|
[test_service_sync_401.js]
|
||||||
[test_service_sync_checkServerError.js]
|
[test_service_sync_checkServerError.js]
|
||||||
# Bug 604565: this test intermittently hangs on OS X debug builds.
|
# Bug 604565: this test intermittently hangs on OS X debug builds.
|
||||||
skip-if = os == "mac" && debug
|
# Bug 676978: test hangs on Android (see also testing/xpcshell/xpcshell.ini)
|
||||||
|
skip-if = (os == "mac" && debug) || os == "android"
|
||||||
[test_service_sync_locked.js]
|
[test_service_sync_locked.js]
|
||||||
[test_service_sync_remoteSetup.js]
|
[test_service_sync_remoteSetup.js]
|
||||||
# Bug 604565: this test intermittently hangs on OS X debug builds.
|
# Bug 604565: this test intermittently hangs on OS X debug builds.
|
||||||
skip-if = os == "mac" && debug
|
# Bug 676978: test hangs on Android (see also testing/xpcshell/xpcshell.ini)
|
||||||
|
skip-if = (os == "mac" && debug) || os == "android"
|
||||||
[test_service_sync_updateEnabledEngines.js]
|
[test_service_sync_updateEnabledEngines.js]
|
||||||
# Bug 604565: this test intermittently hangs on OS X debug builds.
|
# Bug 604565: this test intermittently hangs on OS X debug builds.
|
||||||
skip-if = os == "mac" && debug
|
# Bug 676978: test hangs on Android (see also testing/xpcshell/xpcshell.ini)
|
||||||
|
skip-if = (os == "mac" && debug) || os == "android"
|
||||||
[test_service_verifyLogin.js]
|
[test_service_verifyLogin.js]
|
||||||
[test_service_wipeClient.js]
|
[test_service_wipeClient.js]
|
||||||
[test_service_wipeServer.js]
|
[test_service_wipeServer.js]
|
||||||
|
@ -87,7 +92,8 @@ skip-if = os == "mac" && debug
|
||||||
[test_syncengine.js]
|
[test_syncengine.js]
|
||||||
[test_syncengine_sync.js]
|
[test_syncengine_sync.js]
|
||||||
# Bug 604565: this test intermittently hangs on OS X debug builds.
|
# Bug 604565: this test intermittently hangs on OS X debug builds.
|
||||||
skip-if = os == "mac" && debug
|
# Bug 676978: test hangs on Android (see also testing/xpcshell/xpcshell.ini)
|
||||||
|
skip-if = (os == "mac" && debug) || os == "android"
|
||||||
[test_syncscheduler.js]
|
[test_syncscheduler.js]
|
||||||
[test_syncstoragerequest.js]
|
[test_syncstoragerequest.js]
|
||||||
[test_tab_engine.js]
|
[test_tab_engine.js]
|
||||||
|
|
|
@ -7,6 +7,8 @@ tail =
|
||||||
[test_bug-429521.js]
|
[test_bug-429521.js]
|
||||||
[test_bug-444233.js]
|
[test_bug-444233.js]
|
||||||
[test_chunk_growth.js]
|
[test_chunk_growth.js]
|
||||||
|
# Bug 676981: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_connection_executeAsync.js]
|
[test_connection_executeAsync.js]
|
||||||
[test_js_helpers.js]
|
[test_js_helpers.js]
|
||||||
[test_levenshtein.js]
|
[test_levenshtein.js]
|
||||||
|
@ -30,3 +32,5 @@ tail =
|
||||||
[test_unicode.js]
|
[test_unicode.js]
|
||||||
[test_vacuum.js]
|
[test_vacuum.js]
|
||||||
[test_telemetry_vfs.js]
|
[test_telemetry_vfs.js]
|
||||||
|
# Bug 676981: test fails consistently on Android
|
||||||
|
# fail-if = os == "android"
|
||||||
|
|
|
@ -201,6 +201,29 @@ xpcshell-tests:
|
||||||
$(TEST_PATH_ARG) $(EXTRA_TEST_ARGS) \
|
$(TEST_PATH_ARG) $(EXTRA_TEST_ARGS) \
|
||||||
$(LIBXUL_DIST)/bin/xpcshell
|
$(LIBXUL_DIST)/bin/xpcshell
|
||||||
|
|
||||||
|
REMOTE_XPCSHELL = \
|
||||||
|
rm -f ./$@.log && \
|
||||||
|
$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
|
||||||
|
-I$(topsrcdir)/build \
|
||||||
|
-I$(topsrcdir)/build/mobile \
|
||||||
|
$(topsrcdir)/testing/xpcshell/remotexpcshelltests.py \
|
||||||
|
--manifest=$(DEPTH)/_tests/xpcshell/xpcshell.ini \
|
||||||
|
--build-info-json=$(DEPTH)/mozinfo.json \
|
||||||
|
--no-logfiles \
|
||||||
|
--dm_trans=$(DM_TRANS) \
|
||||||
|
--deviceIP=${TEST_DEVICE} \
|
||||||
|
--objdir=$(DEPTH) \
|
||||||
|
$(SYMBOLS_PATH) \
|
||||||
|
$(TEST_PATH_ARG) $(EXTRA_TEST_ARGS)
|
||||||
|
|
||||||
|
xpcshell-tests-remote: DM_TRANS?=adb
|
||||||
|
xpcshell-tests-remote:
|
||||||
|
@if [ "${TEST_DEVICE}" != "" -o "$(DM_TRANS)" = "adb" ]; \
|
||||||
|
then $(call REMOTE_XPCSHELL); $(CHECK_TEST_ERROR); \
|
||||||
|
else \
|
||||||
|
echo "please prepare your host with environment variables for TEST_DEVICE"; \
|
||||||
|
fi
|
||||||
|
|
||||||
# install and run the mozmill tests
|
# install and run the mozmill tests
|
||||||
$(DEPTH)/_tests/mozmill:
|
$(DEPTH)/_tests/mozmill:
|
||||||
$(MAKE) -C $(DEPTH)/testing/mozmill install-develop PKG_STAGE=../../_tests
|
$(MAKE) -C $(DEPTH)/testing/mozmill install-develop PKG_STAGE=../../_tests
|
||||||
|
|
|
@ -36,265 +36,302 @@
|
||||||
#
|
#
|
||||||
# ***** END LICENSE BLOCK ***** */
|
# ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
import re, sys, os, os.path, logging, shutil, signal
|
import re, sys, os
|
||||||
from glob import glob
|
|
||||||
from optparse import OptionParser
|
|
||||||
from subprocess import Popen, PIPE, STDOUT
|
|
||||||
from tempfile import mkdtemp
|
|
||||||
|
|
||||||
import runxpcshelltests as xpcshell
|
import runxpcshelltests as xpcshell
|
||||||
from automationutils import *
|
from automationutils import *
|
||||||
import devicemanager
|
import devicemanager, devicemanagerADB, devicemanagerSUT
|
||||||
|
|
||||||
|
# A specialization of XPCShellTests that runs tests on an Android device
|
||||||
|
# via devicemanager.
|
||||||
class XPCShellRemote(xpcshell.XPCShellTests, object):
|
class XPCShellRemote(xpcshell.XPCShellTests, object):
|
||||||
|
|
||||||
def __init__(self, devmgr):
|
def __init__(self, devmgr, options, args):
|
||||||
self.device = devmgr
|
|
||||||
self.testRoot = "/tests/xpcshell"
|
|
||||||
xpcshell.XPCShellTests.__init__(self)
|
xpcshell.XPCShellTests.__init__(self)
|
||||||
self.profileDir = self.testRoot + '/profile'
|
self.options = options
|
||||||
self.device.mkDir(self.profileDir)
|
self.device = devmgr
|
||||||
|
self.pathMapping = []
|
||||||
|
self.remoteTestRoot = self.device.getTestRoot("xpcshell")
|
||||||
|
# Terse directory names are used here ("b" for a binaries directory)
|
||||||
|
# to minimize the length of the command line used to execute
|
||||||
|
# xpcshell on the remote device. adb has a limit to the number
|
||||||
|
# of characters used in a shell command, and the xpcshell command
|
||||||
|
# line can be quite complex.
|
||||||
|
self.remoteBinDir = self.remoteJoin(self.remoteTestRoot, "b")
|
||||||
|
self.remoteScriptsDir = self.remoteTestRoot
|
||||||
|
self.remoteComponentsDir = self.remoteJoin(self.remoteTestRoot, "c")
|
||||||
|
self.profileDir = self.remoteJoin(self.remoteTestRoot, "p")
|
||||||
|
if options.setup:
|
||||||
|
self.setupUtilities()
|
||||||
|
self.setupTestDir()
|
||||||
|
self.remoteAPK = self.remoteJoin(self.remoteBinDir, os.path.basename(options.localAPK))
|
||||||
|
self.remoteDebugger = options.debugger
|
||||||
|
self.remoteDebuggerArgs = options.debuggerArgs
|
||||||
|
|
||||||
#todo: figure out the remote version of this, only used for debuggerInfo
|
def remoteJoin(self, path1, path2):
|
||||||
def getcwd(self):
|
joined = os.path.join(path1, path2)
|
||||||
return "/tests/"
|
joined = joined.replace('\\', '/')
|
||||||
|
return joined
|
||||||
def readManifest(self, manifest):
|
|
||||||
"""Given a manifest file containing a list of test directories,
|
|
||||||
return a list of absolute paths to the directories contained within."""
|
|
||||||
|
|
||||||
manifestdir = self.testRoot + '/tests'
|
def remoteForLocal(self, local):
|
||||||
testdirs = []
|
for mapping in self.pathMapping:
|
||||||
try:
|
if (os.path.abspath(mapping.local) == os.path.abspath(local)):
|
||||||
f = self.device.getFile(manifest, "temp.txt")
|
return mapping.remote
|
||||||
for line in f.split():
|
return local
|
||||||
dir = line.rstrip()
|
|
||||||
path = manifestdir + '/' + dir
|
|
||||||
testdirs.append(path)
|
|
||||||
f.close()
|
|
||||||
except:
|
|
||||||
pass # just eat exceptions
|
|
||||||
return testdirs
|
|
||||||
|
|
||||||
def verifyFilePath(self, fileName):
|
def setupUtilities(self):
|
||||||
# approot - path to root of application - firefox or fennec
|
remotePrefDir = self.remoteJoin(self.remoteBinDir, "defaults/pref")
|
||||||
# xreroot - path to xulrunner binaries - firefox or fennec/xulrunner
|
if (not self.device.dirExists(remotePrefDir)):
|
||||||
# xpcshell - full or relative path to xpcshell binary
|
self.device.mkDirs(self.remoteJoin(remotePrefDir, "extra"))
|
||||||
#given fileName, returns full path of existing file
|
if (not self.device.dirExists(self.remoteScriptsDir)):
|
||||||
if (self.device.fileExists(fileName)):
|
self.device.mkDir(self.remoteScriptsDir)
|
||||||
return fileName
|
if (not self.device.dirExists(self.remoteComponentsDir)):
|
||||||
|
self.device.mkDir(self.remoteComponentsDir)
|
||||||
fileName = self.device.getAppRoot() + '/xulrunner/' + fileName.split('/')[-1]
|
|
||||||
if (self.device.fileExists(fileName)):
|
|
||||||
return fileName
|
|
||||||
|
|
||||||
fileName = self.device.getAppRoot() + '/' + fileName.split('/')[-1]
|
|
||||||
if (not self.device.fileExists(fileName)):
|
|
||||||
raise devicemanager.FileError("No File found for: " + str(fileName))
|
|
||||||
|
|
||||||
return fileName
|
local = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'head.js')
|
||||||
|
self.device.pushFile(local, self.remoteScriptsDir)
|
||||||
|
|
||||||
def verifyDirPath(self, fileName):
|
localBin = os.path.join(self.options.objdir, "dist/bin")
|
||||||
# approot - path to root of application - firefox or fennec
|
if not os.path.exists(localBin):
|
||||||
# xreroot - path to xulrunner binaries - firefox or fennec/xulrunner
|
localBin = os.path.join(self.options.objdir, "bin")
|
||||||
# xpcshell - full or relative path to xpcshell binary
|
if not os.path.exists(localBin):
|
||||||
#given fileName, returns full path of existing file
|
print >>sys.stderr, "Error: could not find bin in objdir"
|
||||||
if (self.device.dirExists(fileName)):
|
sys.exit(1)
|
||||||
return fileName
|
|
||||||
|
|
||||||
fileName = self.device.getAppRoot() + '/' + fileName.split('/')[-1]
|
|
||||||
if (self.device.dirExists(fileName)):
|
|
||||||
return fileName
|
|
||||||
|
|
||||||
fileName = self.device.getDeviceRoot() + '/' + fileName.split('/')[-1]
|
|
||||||
if (not self.device.dirExists(fileName)):
|
|
||||||
raise devicemanager.FileError("No Dir found for: " + str(fileName))
|
|
||||||
return fileName
|
|
||||||
|
|
||||||
def setAbsPath(self):
|
local = os.path.join(localBin, "xpcshell")
|
||||||
#testharnessdir is used for head.js
|
self.device.pushFile(local, self.remoteBinDir)
|
||||||
self.testharnessdir = "/tests/xpcshell/"
|
|
||||||
|
|
||||||
# If the file exists then we have a full path (no notion of cwd)
|
local = os.path.join(localBin, "plugin-container")
|
||||||
self.xpcshell = self.verifyFilePath(self.xpcshell)
|
self.device.pushFile(local, self.remoteBinDir)
|
||||||
if self.xrePath is None:
|
|
||||||
# If no xrePath, assume it is the directory containing xpcshell
|
|
||||||
self.xrePath = '/'.join(self.xpcshell.split('/')[:-1])
|
|
||||||
else:
|
|
||||||
self.xrePath = self.verifyDirPath(self.xrePath)
|
|
||||||
|
|
||||||
# we assume that httpd.js lives in components/ relative to xpcshell
|
local = os.path.join(localBin, "components/httpd.js")
|
||||||
self.httpdJSPath = self.xrePath + '/components/httpd.js'
|
self.device.pushFile(local, self.remoteComponentsDir)
|
||||||
|
|
||||||
|
local = os.path.join(localBin, "components/httpd.manifest")
|
||||||
|
self.device.pushFile(local, self.remoteComponentsDir)
|
||||||
|
|
||||||
|
local = os.path.join(localBin, "components/test_necko.xpt")
|
||||||
|
self.device.pushFile(local, self.remoteComponentsDir)
|
||||||
|
|
||||||
|
self.device.pushFile(self.options.localAPK, self.remoteBinDir)
|
||||||
|
|
||||||
|
localLib = os.path.join(self.options.objdir, "dist/fennec")
|
||||||
|
if not os.path.exists(localLib):
|
||||||
|
localLib = os.path.join(self.options.objdir, "fennec/lib")
|
||||||
|
if not os.path.exists(localLib):
|
||||||
|
print >>sys.stderr, "Error: could not find libs in objdir"
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
for file in os.listdir(localLib):
|
||||||
|
if (file.endswith(".so")):
|
||||||
|
self.device.pushFile(os.path.join(localLib, file), self.remoteBinDir)
|
||||||
|
|
||||||
|
def setupTestDir(self):
|
||||||
|
xpcDir = os.path.join(self.options.objdir, "_tests/xpcshell")
|
||||||
|
self.device.pushDir(xpcDir, self.remoteScriptsDir)
|
||||||
|
|
||||||
|
def buildTestList(self):
|
||||||
|
xpcshell.XPCShellTests.buildTestList(self)
|
||||||
|
uniqueTestPaths = set([])
|
||||||
|
for test in self.alltests:
|
||||||
|
uniqueTestPaths.add(test['here'])
|
||||||
|
for testdir in uniqueTestPaths:
|
||||||
|
xpcDir = os.path.join(self.options.objdir, "_tests/xpcshell")
|
||||||
|
abbrevTestDir = os.path.relpath(testdir, xpcDir)
|
||||||
|
remoteScriptDir = self.remoteJoin(self.remoteScriptsDir, abbrevTestDir)
|
||||||
|
self.pathMapping.append(PathMapping(testdir, remoteScriptDir))
|
||||||
|
|
||||||
def buildXpcsCmd(self, testdir):
|
def buildXpcsCmd(self, testdir):
|
||||||
# <head.js> has to be loaded by xpchell: it can't load itself.
|
self.xpcsCmd = [
|
||||||
self.env["XPCSHELL_TEST_PROFILE_DIR"] = self.profileDir
|
self.remoteJoin(self.remoteBinDir, "xpcshell"),
|
||||||
self.xpcsCmd = [self.xpcshell, '-g', self.xrePath, '-v', '170', '-j', '-s', \
|
'-r', self.remoteJoin(self.remoteComponentsDir, 'httpd.manifest'),
|
||||||
"--environ:CWD='" + testdir + "'", \
|
'--greomni', self.remoteAPK,
|
||||||
"--environ:XPCSHELL_TEST_PROFILE_DIR='" + self.env["XPCSHELL_TEST_PROFILE_DIR"] + "'", \
|
'-j', '-s',
|
||||||
'-e', 'const _HTTPD_JS_PATH = \'%s\';' % self.httpdJSPath,
|
'-e', 'const _HTTPD_JS_PATH = "%s";' % self.remoteJoin(self.remoteComponentsDir, 'httpd.js'),
|
||||||
'-f', self.testharnessdir + '/head.js']
|
'-e', 'const _HEAD_JS_PATH = "%s";' % self.remoteJoin(self.remoteScriptsDir, 'head.js'),
|
||||||
|
'-f', self.remoteScriptsDir+'/head.js']
|
||||||
|
|
||||||
if self.debuggerInfo:
|
if self.remoteDebugger:
|
||||||
self.xpcsCmd = [self.debuggerInfo["path"]] + self.debuggerInfo["args"] + self.xpcsCmd
|
# for example, "/data/local/gdbserver" "localhost:12345"
|
||||||
|
self.xpcsCmd = [
|
||||||
|
self.remoteDebugger,
|
||||||
|
self.remoteDebuggerArgs,
|
||||||
|
self.xpcsCmd]
|
||||||
|
|
||||||
def getHeadFiles(self, testdir):
|
def getHeadFiles(self, test):
|
||||||
# get the list of head and tail files from the directory
|
self.remoteHere = self.remoteForLocal(test['here'])
|
||||||
testHeadFiles = []
|
return [f.strip() for f in sorted(test['head'].split(' ')) if self.device.fileExists(self.remoteJoin(self.remoteHere, f))]
|
||||||
for f in self.device.listFiles(testdir):
|
|
||||||
hdmtch = re.compile("head_.*\.js")
|
def getTailFiles(self, test):
|
||||||
if (hdmtch.match(f)):
|
return [f.strip() for f in sorted(test['tail'].split(' ')) if self.device.fileExists(self.remoteJoin(self.remoteHere, f))]
|
||||||
testHeadFiles += [(testdir + '/' + f).replace('/', '//')]
|
|
||||||
|
|
||||||
return sorted(testHeadFiles)
|
|
||||||
|
|
||||||
def getTailFiles(self, testdir):
|
|
||||||
testTailFiles = []
|
|
||||||
# Tails are executed in the reverse order, to "match" heads order,
|
|
||||||
# as in "h1-h2-h3 then t3-t2-t1".
|
|
||||||
for f in self.device.listFiles(testdir):
|
|
||||||
tlmtch = re.compile("tail_.*\.js")
|
|
||||||
if (tlmtch.match(f)):
|
|
||||||
testTailFiles += [(testdir + '/' + f).replace('/', '//')]
|
|
||||||
return reversed(sorted(testTailFiles))
|
|
||||||
|
|
||||||
def getTestFiles(self, testdir):
|
def buildCmdTestFile(self, name):
|
||||||
testfiles = []
|
remoteDir = self.remoteForLocal(os.path.dirname(name))
|
||||||
# if a single test file was specified, we only want to execute that test
|
if remoteDir == self.remoteHere:
|
||||||
for f in self.device.listFiles(testdir):
|
remoteName = os.path.basename(name)
|
||||||
tstmtch = re.compile("test_.*\.js")
|
else:
|
||||||
if (tstmtch.match(f)):
|
remoteName = self.remoteJoin(remoteDir, os.path.basename(name))
|
||||||
testfiles += [(testdir + '/' + f).replace('/', '//')]
|
return ['-e', 'const _TEST_FILE = ["%s"];' %
|
||||||
|
replaceBackSlashes(remoteName)]
|
||||||
for f in testfiles:
|
|
||||||
if (self.singleFile == f.split('/')[-1]):
|
|
||||||
return [(testdir + '/' + f).replace('/', '//')]
|
|
||||||
else:
|
|
||||||
pass
|
|
||||||
return testfiles
|
|
||||||
|
|
||||||
def setupProfileDir(self):
|
def setupProfileDir(self):
|
||||||
self.device.removeDir(self.profileDir)
|
self.device.removeDir(self.profileDir)
|
||||||
self.device.mkDir(self.profileDir)
|
self.device.mkDir(self.profileDir)
|
||||||
self.env["XPCSHELL_TEST_PROFILE_DIR"] = self.profileDir
|
if self.interactive or self.singleFile:
|
||||||
|
self.log.info("TEST-INFO | profile dir is %s" % self.profileDir)
|
||||||
return self.profileDir
|
return self.profileDir
|
||||||
|
|
||||||
def setupLeakLogging(self):
|
|
||||||
filename = "runxpcshelltests_leaks.log"
|
|
||||||
|
|
||||||
# Enable leaks (only) detection to its own log file.
|
|
||||||
leakLogFile = self.profileDir + '/' + filename
|
|
||||||
self.env["XPCOM_MEM_LEAK_LOG"] = leakLogFile
|
|
||||||
return leakLogFile
|
|
||||||
|
|
||||||
def launchProcess(self, cmd, stdout, stderr, env, cwd):
|
def launchProcess(self, cmd, stdout, stderr, env, cwd):
|
||||||
print "launching : " + " ".join(cmd)
|
# Some xpcshell arguments contain characters that are interpretted
|
||||||
proc = self.device.launchProcess(cmd, cwd=cwd)
|
# by the adb shell; enclose these arguments in quotes.
|
||||||
|
index = 0
|
||||||
|
for part in cmd:
|
||||||
|
if (part.find(" ")>=0 or part.find("(")>=0 or part.find(")")>=0 or part.find("\"")>=0):
|
||||||
|
part = '\''+part+'\''
|
||||||
|
cmd[index] = part
|
||||||
|
index = index + 1
|
||||||
|
|
||||||
|
xpcshell = self.remoteJoin(self.remoteBinDir, "xpcshell")
|
||||||
|
|
||||||
|
shellArgs = "cd "+self.remoteHere
|
||||||
|
shellArgs += "; LD_LIBRARY_PATH="+self.remoteBinDir
|
||||||
|
shellArgs += "; export CACHE_PATH="+self.remoteBinDir
|
||||||
|
shellArgs += "; export GRE_HOME="+self.device.getAppRoot()
|
||||||
|
shellArgs += "; export XPCSHELL_TEST_PROFILE_DIR="+self.profileDir
|
||||||
|
shellArgs += "; "+xpcshell+" "
|
||||||
|
shellArgs += " ".join(cmd[1:])
|
||||||
|
|
||||||
|
if self.verbose:
|
||||||
|
self.log.info(shellArgs)
|
||||||
|
|
||||||
|
# If the adb version of devicemanager is used and the arguments passed
|
||||||
|
# to adb exceed ~1024 characters, the command may not execute.
|
||||||
|
if len(shellArgs) > 1000:
|
||||||
|
self.log.info("adb command length is excessive and may cause failure")
|
||||||
|
|
||||||
|
proc = self.device.runCmd(["shell", shellArgs])
|
||||||
return proc
|
return proc
|
||||||
|
|
||||||
def setSignal(self, proc, sig1, sig2):
|
|
||||||
self.device.signal(proc, sig1, sig2)
|
|
||||||
|
|
||||||
def communicate(self, proc):
|
def communicate(self, proc):
|
||||||
return self.device.communicate(proc)
|
return proc.communicate()
|
||||||
|
|
||||||
def removeDir(self, dirname):
|
def removeDir(self, dirname):
|
||||||
self.device.removeDir(dirname)
|
self.device.removeDir(dirname)
|
||||||
|
|
||||||
def getReturnCode(self, proc):
|
def getReturnCode(self, proc):
|
||||||
return self.device.getReturnCode(proc)
|
return proc.returncode
|
||||||
|
|
||||||
#TODO: consider creating a separate log dir. We don't have the test file structure,
|
#TODO: consider creating a separate log dir. We don't have the test file structure,
|
||||||
# so we use filename.log. Would rather see ./logs/filename.log
|
# so we use filename.log. Would rather see ./logs/filename.log
|
||||||
def createLogFile(self, test, stdout):
|
def createLogFile(self, test, stdout, leakLogs):
|
||||||
try:
|
try:
|
||||||
f = None
|
f = None
|
||||||
filename = test.replace('\\', '/').split('/')[-1] + ".log"
|
filename = test.replace('\\', '/').split('/')[-1] + ".log"
|
||||||
f = open(filename, "w")
|
f = open(filename, "w")
|
||||||
f.write(stdout)
|
f.write(stdout)
|
||||||
|
|
||||||
if os.path.exists(self.leakLogFile):
|
for leakLog in leakLogs:
|
||||||
leaks = open(self.leakLogFile, "r")
|
if os.path.exists(leakLog):
|
||||||
|
leaks = open(leakLog, "r")
|
||||||
f.write(leaks.read())
|
f.write(leaks.read())
|
||||||
leaks.close()
|
leaks.close()
|
||||||
finally:
|
finally:
|
||||||
if f <> None:
|
if f <> None:
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
#NOTE: the only difference between this and parent is the " vs ' arond the filename
|
|
||||||
def buildCmdHead(self, headfiles, tailfiles, xpcscmd):
|
|
||||||
cmdH = ", ".join(['\'' + f.replace('\\', '/') + '\''
|
|
||||||
for f in headfiles])
|
|
||||||
cmdT = ", ".join(['\'' + f.replace('\\', '/') + '\''
|
|
||||||
for f in tailfiles])
|
|
||||||
cmdH = xpcscmd + \
|
|
||||||
['-e', 'const _HEAD_FILES = [%s];' % cmdH] + \
|
|
||||||
['-e', 'const _TAIL_FILES = [%s];' % cmdT]
|
|
||||||
return cmdH
|
|
||||||
|
|
||||||
class RemoteXPCShellOptions(xpcshell.XPCShellOptions):
|
class RemoteXPCShellOptions(xpcshell.XPCShellOptions):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
xpcshell.XPCShellOptions.__init__(self)
|
xpcshell.XPCShellOptions.__init__(self)
|
||||||
self.add_option("--device",
|
defaults = {}
|
||||||
type="string", dest="device", default='',
|
|
||||||
help="ip address for the device")
|
|
||||||
|
|
||||||
|
self.add_option("--deviceIP", action="store",
|
||||||
|
type = "string", dest = "deviceIP",
|
||||||
|
help = "ip address of remote device to test")
|
||||||
|
defaults["deviceIP"] = None
|
||||||
|
|
||||||
|
self.add_option("--devicePort", action="store",
|
||||||
|
type = "string", dest = "devicePort",
|
||||||
|
help = "port of remote device to test")
|
||||||
|
defaults["devicePort"] = 20701
|
||||||
|
|
||||||
|
self.add_option("--dm_trans", action="store",
|
||||||
|
type = "string", dest = "dm_trans",
|
||||||
|
help = "the transport to use to communicate with device: [adb|sut]; default=sut")
|
||||||
|
defaults["dm_trans"] = "sut"
|
||||||
|
|
||||||
|
self.add_option("--objdir", action="store",
|
||||||
|
type = "string", dest = "objdir",
|
||||||
|
help = "local objdir, containing xpcshell binaries")
|
||||||
|
defaults["objdir"] = None
|
||||||
|
|
||||||
|
self.add_option("--apk", action="store",
|
||||||
|
type = "string", dest = "localAPK",
|
||||||
|
help = "local path to Fennec APK")
|
||||||
|
defaults["localAPK"] = None
|
||||||
|
|
||||||
|
self.add_option("--noSetup", action="store_false",
|
||||||
|
dest = "setup",
|
||||||
|
help = "do not copy any files to device (to be used only if device is already setup)")
|
||||||
|
defaults["setup"] = True
|
||||||
|
|
||||||
|
self.set_defaults(**defaults)
|
||||||
|
|
||||||
|
class PathMapping:
|
||||||
|
|
||||||
|
def __init__(self, localDir, remoteDir):
|
||||||
|
self.local = localDir
|
||||||
|
self.remote = remoteDir
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
parser = RemoteXPCShellOptions()
|
dm_none = devicemanagerADB.DeviceManagerADB(None, None)
|
||||||
options, args = parser.parse_args()
|
parser = RemoteXPCShellOptions()
|
||||||
|
options, args = parser.parse_args()
|
||||||
|
|
||||||
if len(args) < 2 and options.manifest is None or \
|
if len(args) < 1 and options.manifest is None:
|
||||||
(len(args) < 1 and options.manifest is not None):
|
print >>sys.stderr, """Usage: %s <test dirs>
|
||||||
print "len(args): " + str(len(args))
|
or: %s --manifest=test.manifest """ % (sys.argv[0], sys.argv[0])
|
||||||
print >>sys.stderr, """Usage: %s <path to xpcshell> <test dirs>
|
sys.exit(1)
|
||||||
or: %s --manifest=test.manifest <path to xpcshell>""" % (sys.argv[0],
|
|
||||||
sys.argv[0])
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if (options.device == ''):
|
if (options.dm_trans == "adb"):
|
||||||
print >>sys.stderr, "Error: Please provide an ip address for the remote device with the --device option"
|
if (options.deviceIP):
|
||||||
sys.exit(1)
|
dm = devicemanagerADB.DeviceManagerADB(options.deviceIP, options.devicePort)
|
||||||
|
else:
|
||||||
|
dm = dm_none
|
||||||
|
else:
|
||||||
|
dm = devicemanagerSUT.DeviceManagerSUT(options.deviceIP, options.devicePort)
|
||||||
|
if (options.deviceIP == None):
|
||||||
|
print "Error: you must provide a device IP to connect to via the --device option"
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
if options.interactive and not options.testPath:
|
||||||
|
print >>sys.stderr, "Error: You must specify a test filename in interactive mode!"
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
dm = devicemanager.DeviceManager(options.device, 20701)
|
if not options.objdir:
|
||||||
xpcsh = XPCShellRemote(dm)
|
print >>sys.stderr, "Error: You must specify an objdir"
|
||||||
debuggerInfo = getDebuggerInfo(xpcsh.oldcwd, options.debugger, options.debuggerArgs,
|
sys.exit(1)
|
||||||
options.debuggerInteractive);
|
|
||||||
|
|
||||||
if options.interactive and not options.testPath:
|
if not options.localAPK:
|
||||||
print >>sys.stderr, "Error: You must specify a test filename in interactive mode!"
|
for file in os.listdir(os.path.join(options.objdir, "dist")):
|
||||||
sys.exit(1)
|
if (file.endswith(".apk") and file.startswith("fennec")):
|
||||||
|
options.localAPK = os.path.join(options.objdir, "dist")
|
||||||
|
options.localAPK = os.path.join(options.localAPK, file)
|
||||||
|
print >>sys.stderr, "using APK: " + options.localAPK
|
||||||
|
break
|
||||||
|
|
||||||
|
if not options.localAPK:
|
||||||
|
print >>sys.stderr, "Error: please specify an APK"
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
# Zip up the xpcshell directory: 7z a <zipName> xpcshell/*, assuming we are in the xpcshell directory
|
xpcsh = XPCShellRemote(dm, options, args)
|
||||||
# TODO: ensure the system has 7z, this is adding a new dependency to the overall system
|
|
||||||
zipName = 'xpcshell.7z'
|
|
||||||
try:
|
|
||||||
Popen(['7z', 'a', zipName, '../xpcshell']).wait()
|
|
||||||
except:
|
|
||||||
print "to run these tests remotely, we require 7z to be installed and in your path"
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if dm.pushFile(zipName, '/tests/xpcshell.7z') == None:
|
if not xpcsh.runTests(xpcshell='xpcshell',
|
||||||
raise devicemanager.FileError("failed to copy xpcshell.7z to device")
|
testdirs=args[0:],
|
||||||
if dm.unpackFile('xpcshell.7z') == None:
|
**options.__dict__):
|
||||||
raise devicemanager.FileError("failed to unpack xpcshell.7z on the device")
|
sys.exit(1)
|
||||||
|
|
||||||
if not xpcsh.runTests(args[0],
|
|
||||||
xrePath=options.xrePath,
|
|
||||||
symbolsPath=options.symbolsPath,
|
|
||||||
manifest=options.manifest,
|
|
||||||
testdirs=args[1:],
|
|
||||||
testPath=options.testPath,
|
|
||||||
interactive=options.interactive,
|
|
||||||
logfiles=options.logfiles,
|
|
||||||
debuggerInfo=debuggerInfo):
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -261,7 +261,7 @@ class XPCShellTests(object):
|
||||||
test['head'] is a whitespace delimited list of head files.
|
test['head'] is a whitespace delimited list of head files.
|
||||||
return the list of head files as paths including the subdir if the head file exists
|
return the list of head files as paths including the subdir if the head file exists
|
||||||
|
|
||||||
On a remote system, this is overloaded to list files in a remote directory structure.
|
On a remote system, this may be overloaded to list files in a remote directory structure.
|
||||||
"""
|
"""
|
||||||
return [os.path.join(test['here'], f).strip() for f in sorted(test['head'].split(' ')) if os.path.isfile(os.path.join(test['here'], f))]
|
return [os.path.join(test['here'], f).strip() for f in sorted(test['head'].split(' ')) if os.path.isfile(os.path.join(test['here'], f))]
|
||||||
|
|
||||||
|
@ -270,7 +270,7 @@ class XPCShellTests(object):
|
||||||
test['tail'] is a whitespace delimited list of head files.
|
test['tail'] is a whitespace delimited list of head files.
|
||||||
return the list of tail files as paths including the subdir if the tail file exists
|
return the list of tail files as paths including the subdir if the tail file exists
|
||||||
|
|
||||||
On a remote system, this is overloaded to list files in a remote directory structure.
|
On a remote system, this may be overloaded to list files in a remote directory structure.
|
||||||
"""
|
"""
|
||||||
return [os.path.join(test['here'], f).strip() for f in sorted(test['tail'].split(' ')) if os.path.isfile(os.path.join(test['here'], f))]
|
return [os.path.join(test['here'], f).strip() for f in sorted(test['tail'].split(' ')) if os.path.isfile(os.path.join(test['here'], f))]
|
||||||
|
|
||||||
|
@ -280,7 +280,7 @@ class XPCShellTests(object):
|
||||||
When running check-interactive and check-one, the directory is well-defined and
|
When running check-interactive and check-one, the directory is well-defined and
|
||||||
retained for inspection once the tests complete.
|
retained for inspection once the tests complete.
|
||||||
|
|
||||||
On a remote system, we overload this to use a remote path structure.
|
On a remote system, this may be overloaded to use a remote path structure.
|
||||||
"""
|
"""
|
||||||
if self.interactive or self.singleFile:
|
if self.interactive or self.singleFile:
|
||||||
profileDir = os.path.join(gettempdir(), self.profileName, "xpcshellprofile")
|
profileDir = os.path.join(gettempdir(), self.profileName, "xpcshellprofile")
|
||||||
|
@ -301,7 +301,7 @@ class XPCShellTests(object):
|
||||||
"""
|
"""
|
||||||
Enable leaks (only) detection to its own log file and set environment variables.
|
Enable leaks (only) detection to its own log file and set environment variables.
|
||||||
|
|
||||||
On a remote system, we overload this to use a remote filename and path structure
|
On a remote system, this may be overloaded to use a remote filename and path structure
|
||||||
"""
|
"""
|
||||||
filename = "runxpcshelltests_leaks.log"
|
filename = "runxpcshelltests_leaks.log"
|
||||||
|
|
||||||
|
@ -381,12 +381,20 @@ class XPCShellTests(object):
|
||||||
'-e', 'const _HEAD_FILES = [%s];' % cmdH,
|
'-e', 'const _HEAD_FILES = [%s];' % cmdH,
|
||||||
'-e', 'const _TAIL_FILES = [%s];' % cmdT]
|
'-e', 'const _TAIL_FILES = [%s];' % cmdT]
|
||||||
|
|
||||||
|
def buildCmdTestFile(self, name):
|
||||||
|
"""
|
||||||
|
Build the command line arguments for the test file.
|
||||||
|
On a remote system, this may be overloaded to use a remote path structure.
|
||||||
|
"""
|
||||||
|
return ['-e', 'const _TEST_FILE = ["%s"];' %
|
||||||
|
replaceBackSlashes(name)]
|
||||||
|
|
||||||
def runTests(self, xpcshell, xrePath=None, appPath=None, symbolsPath=None,
|
def runTests(self, xpcshell, xrePath=None, appPath=None, symbolsPath=None,
|
||||||
manifest=None, testdirs=[], testPath=None,
|
manifest=None, testdirs=[], testPath=None,
|
||||||
interactive=False, verbose=False, keepGoing=False, logfiles=True,
|
interactive=False, verbose=False, keepGoing=False, logfiles=True,
|
||||||
thisChunk=1, totalChunks=1, debugger=None,
|
thisChunk=1, totalChunks=1, debugger=None,
|
||||||
debuggerArgs=None, debuggerInteractive=False,
|
debuggerArgs=None, debuggerInteractive=False,
|
||||||
profileName=None, mozInfo=None):
|
profileName=None, mozInfo=None, **otherOptions):
|
||||||
"""Run xpcshell tests.
|
"""Run xpcshell tests.
|
||||||
|
|
||||||
|xpcshell|, is the xpcshell executable to use to run the tests.
|
|xpcshell|, is the xpcshell executable to use to run the tests.
|
||||||
|
@ -410,6 +418,7 @@ class XPCShellTests(object):
|
||||||
|profileName|, if set, specifies the name of the application for the profile
|
|profileName|, if set, specifies the name of the application for the profile
|
||||||
directory if running only a subset of tests.
|
directory if running only a subset of tests.
|
||||||
|mozInfo|, if set, specifies specifies build configuration information, either as a filename containing JSON, or a dict.
|
|mozInfo|, if set, specifies specifies build configuration information, either as a filename containing JSON, or a dict.
|
||||||
|
|otherOptions| may be present for the convenience of subclasses
|
||||||
"""
|
"""
|
||||||
|
|
||||||
global gotSIGINT
|
global gotSIGINT
|
||||||
|
@ -491,8 +500,7 @@ class XPCShellTests(object):
|
||||||
self.leakLogFile = self.setupLeakLogging()
|
self.leakLogFile = self.setupLeakLogging()
|
||||||
|
|
||||||
# The test file will have to be loaded after the head files.
|
# The test file will have to be loaded after the head files.
|
||||||
cmdT = ['-e', 'const _TEST_FILE = ["%s"];' %
|
cmdT = self.buildCmdTestFile(name)
|
||||||
replaceBackSlashes(name)]
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.log.info("TEST-INFO | %s | running test ..." % name)
|
self.log.info("TEST-INFO | %s | running test ..." % name)
|
||||||
|
@ -515,8 +523,9 @@ class XPCShellTests(object):
|
||||||
def print_stdout(stdout):
|
def print_stdout(stdout):
|
||||||
"""Print stdout line-by-line to avoid overflowing buffers."""
|
"""Print stdout line-by-line to avoid overflowing buffers."""
|
||||||
self.log.info(">>>>>>>")
|
self.log.info(">>>>>>>")
|
||||||
for line in stdout.splitlines():
|
if (stdout):
|
||||||
self.log.info(line)
|
for line in stdout.splitlines():
|
||||||
|
self.log.info(line)
|
||||||
self.log.info("<<<<<<<")
|
self.log.info("<<<<<<<")
|
||||||
|
|
||||||
result = not ((self.getReturnCode(proc) != 0) or
|
result = not ((self.getReturnCode(proc) != 0) or
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
[include:toolkit/components/commandlines/test/unit/xpcshell.ini]
|
[include:toolkit/components/commandlines/test/unit/xpcshell.ini]
|
||||||
[include:toolkit/components/contentprefs/tests/unit/xpcshell.ini]
|
[include:toolkit/components/contentprefs/tests/unit/xpcshell.ini]
|
||||||
[include:toolkit/components/passwordmgr/test/unit/xpcshell.ini]
|
[include:toolkit/components/passwordmgr/test/unit/xpcshell.ini]
|
||||||
|
# Bug 676989: tests hang on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[include:toolkit/components/places/tests/migration/xpcshell.ini]
|
[include:toolkit/components/places/tests/migration/xpcshell.ini]
|
||||||
[include:toolkit/components/places/tests/autocomplete/xpcshell.ini]
|
[include:toolkit/components/places/tests/autocomplete/xpcshell.ini]
|
||||||
[include:toolkit/components/places/tests/expiration/xpcshell.ini]
|
[include:toolkit/components/places/tests/expiration/xpcshell.ini]
|
||||||
|
@ -59,6 +61,8 @@
|
||||||
[include:services/crypto/tests/unit/xpcshell.ini]
|
[include:services/crypto/tests/unit/xpcshell.ini]
|
||||||
[include:services/crypto/components/tests/unit/xpcshell.ini]
|
[include:services/crypto/components/tests/unit/xpcshell.ini]
|
||||||
[include:services/sync/tests/unit/xpcshell.ini]
|
[include:services/sync/tests/unit/xpcshell.ini]
|
||||||
|
# Bug 676978: tests hang on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[include:browser/components/dirprovider/tests/unit/xpcshell.ini]
|
[include:browser/components/dirprovider/tests/unit/xpcshell.ini]
|
||||||
[include:browser/components/feeds/test/unit/xpcshell.ini]
|
[include:browser/components/feeds/test/unit/xpcshell.ini]
|
||||||
[include:browser/components/places/tests/unit/xpcshell.ini]
|
[include:browser/components/places/tests/unit/xpcshell.ini]
|
||||||
|
|
|
@ -3,3 +3,5 @@ head =
|
||||||
tail =
|
tail =
|
||||||
|
|
||||||
[test_jsctypes.js]
|
[test_jsctypes.js]
|
||||||
|
# Bug 676989: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
|
|
|
@ -11,8 +11,12 @@ tail =
|
||||||
[test_bug_409179.js]
|
[test_bug_409179.js]
|
||||||
[test_bug_420230.js]
|
[test_bug_420230.js]
|
||||||
[test_cancel_download_files_removed.js]
|
[test_cancel_download_files_removed.js]
|
||||||
|
# Bug 676989: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_download_manager.js]
|
[test_download_manager.js]
|
||||||
[test_download_samename.js]
|
[test_download_samename.js]
|
||||||
|
# Bug 676989: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_history_expiration.js]
|
[test_history_expiration.js]
|
||||||
[test_memory_db_support.js]
|
[test_memory_db_support.js]
|
||||||
[test_offline_support.js]
|
[test_offline_support.js]
|
||||||
|
|
|
@ -8,8 +8,14 @@ tail =
|
||||||
[test_418257.js]
|
[test_418257.js]
|
||||||
[test_422277.js]
|
[test_422277.js]
|
||||||
[test_autocomplete_on_value_removed_479089.js]
|
[test_autocomplete_on_value_removed_479089.js]
|
||||||
|
# Bug 676989: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_download_embed_bookmarks.js]
|
[test_download_embed_bookmarks.js]
|
||||||
|
# Bug 676989: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_empty_search.js]
|
[test_empty_search.js]
|
||||||
|
# Bug 676989: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_enabled.js]
|
[test_enabled.js]
|
||||||
[test_escape_self.js]
|
[test_escape_self.js]
|
||||||
[test_ignore_protocol.js]
|
[test_ignore_protocol.js]
|
||||||
|
|
|
@ -3,14 +3,24 @@ head = head_expiration.js
|
||||||
tail =
|
tail =
|
||||||
|
|
||||||
[test_analyze_runs.js]
|
[test_analyze_runs.js]
|
||||||
|
# Bug 676989: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_annos_expire_history.js]
|
[test_annos_expire_history.js]
|
||||||
[test_annos_expire_never.js]
|
[test_annos_expire_never.js]
|
||||||
[test_annos_expire_policy.js]
|
[test_annos_expire_policy.js]
|
||||||
[test_annos_expire_session.js]
|
[test_annos_expire_session.js]
|
||||||
|
# Bug 676989: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_notifications.js]
|
[test_notifications.js]
|
||||||
|
# Bug 676989: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_notifications_onDeleteURI.js]
|
[test_notifications_onDeleteURI.js]
|
||||||
[test_notifications_onDeleteVisits.js]
|
[test_notifications_onDeleteVisits.js]
|
||||||
[test_pref_interval.js]
|
[test_pref_interval.js]
|
||||||
|
# Bug 676989: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_pref_maxpages.js]
|
[test_pref_maxpages.js]
|
||||||
|
# Bug 676989: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_removeAllPages.js]
|
[test_removeAllPages.js]
|
||||||
[test_debug_expiration.js]
|
[test_debug_expiration.js]
|
||||||
|
|
|
@ -13,6 +13,8 @@ tail =
|
||||||
[test_onlyBookmarked.js]
|
[test_onlyBookmarked.js]
|
||||||
[test_querySerialization.js]
|
[test_querySerialization.js]
|
||||||
[test_redirectsMode.js]
|
[test_redirectsMode.js]
|
||||||
|
# Bug 676989: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_results-as-tag-contents-query.js]
|
[test_results-as-tag-contents-query.js]
|
||||||
[test_results-as-visit.js]
|
[test_results-as-visit.js]
|
||||||
[test_searchterms-domain.js]
|
[test_searchterms-domain.js]
|
||||||
|
@ -20,5 +22,11 @@ tail =
|
||||||
[test_searchterms-bookmarklets.js]
|
[test_searchterms-bookmarklets.js]
|
||||||
[test_sort-date-site-grouping.js]
|
[test_sort-date-site-grouping.js]
|
||||||
[test_sorting.js]
|
[test_sorting.js]
|
||||||
|
# Bug 676989: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_tags.js]
|
[test_tags.js]
|
||||||
|
# Bug 676989: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_transitions.js]
|
[test_transitions.js]
|
||||||
|
# Bug 676989: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
|
|
|
@ -5,6 +5,8 @@ tail =
|
||||||
[test_000_frecency.js]
|
[test_000_frecency.js]
|
||||||
[test_248970.js]
|
[test_248970.js]
|
||||||
[test_317472.js]
|
[test_317472.js]
|
||||||
|
# Bug 676989: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_331487.js]
|
[test_331487.js]
|
||||||
[test_385397.js]
|
[test_385397.js]
|
||||||
[test_399264_query_to_string.js]
|
[test_399264_query_to_string.js]
|
||||||
|
@ -16,6 +18,8 @@ tail =
|
||||||
[test_405497.js]
|
[test_405497.js]
|
||||||
[test_408221.js]
|
[test_408221.js]
|
||||||
[test_412132.js]
|
[test_412132.js]
|
||||||
|
# Bug 676989: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_413784.js]
|
[test_413784.js]
|
||||||
[test_415460.js]
|
[test_415460.js]
|
||||||
[test_415757.js]
|
[test_415757.js]
|
||||||
|
@ -37,9 +41,13 @@ tail =
|
||||||
[test_486978_sort_by_date_queries.js]
|
[test_486978_sort_by_date_queries.js]
|
||||||
[test_536081.js]
|
[test_536081.js]
|
||||||
[test_adaptive.js]
|
[test_adaptive.js]
|
||||||
|
# Bug 676989: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_adaptive_bug527311.js]
|
[test_adaptive_bug527311.js]
|
||||||
[test_annotations.js]
|
[test_annotations.js]
|
||||||
[test_asyncExecuteLegacyQueries.js]
|
[test_asyncExecuteLegacyQueries.js]
|
||||||
|
# Bug 676989: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_async_history_api.js]
|
[test_async_history_api.js]
|
||||||
[test_autocomplete_stopSearch_no_throw.js]
|
[test_autocomplete_stopSearch_no_throw.js]
|
||||||
[test_bookmark_catobs.js]
|
[test_bookmark_catobs.js]
|
||||||
|
@ -52,12 +60,20 @@ tail =
|
||||||
[test_database_replaceOnStartup.js]
|
[test_database_replaceOnStartup.js]
|
||||||
[test_doSetAndLoadFaviconForPage.js]
|
[test_doSetAndLoadFaviconForPage.js]
|
||||||
[test_doSetAndLoadFaviconForPage_failures.js]
|
[test_doSetAndLoadFaviconForPage_failures.js]
|
||||||
|
# Bug 676989: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_download_history.js]
|
[test_download_history.js]
|
||||||
|
# Bug 676989: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_dynamic_containers.js]
|
[test_dynamic_containers.js]
|
||||||
[test_exclude_livemarks.js]
|
[test_exclude_livemarks.js]
|
||||||
[test_faviconService_expireAllFavicons.js]
|
[test_faviconService_expireAllFavicons.js]
|
||||||
[test_favicons.js]
|
[test_favicons.js]
|
||||||
|
# Bug 676989: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_frecency.js]
|
[test_frecency.js]
|
||||||
|
# Bug 676989: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_getChildIndex.js]
|
[test_getChildIndex.js]
|
||||||
[test_history.js]
|
[test_history.js]
|
||||||
[test_history_autocomplete_tags.js]
|
[test_history_autocomplete_tags.js]
|
||||||
|
@ -65,6 +81,8 @@ tail =
|
||||||
[test_history_notifications.js]
|
[test_history_notifications.js]
|
||||||
[test_history_observer.js]
|
[test_history_observer.js]
|
||||||
[test_history_removeAllPages.js]
|
[test_history_removeAllPages.js]
|
||||||
|
# Bug 676989: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_history_sidebar.js]
|
[test_history_sidebar.js]
|
||||||
[test_isvisited.js]
|
[test_isvisited.js]
|
||||||
[test_lastModified.js]
|
[test_lastModified.js]
|
||||||
|
@ -79,15 +97,23 @@ tail =
|
||||||
[test_onItemChanged_tags.js]
|
[test_onItemChanged_tags.js]
|
||||||
[test_placeURIs.js]
|
[test_placeURIs.js]
|
||||||
[test_preventive_maintenance.js]
|
[test_preventive_maintenance.js]
|
||||||
|
# Bug 676989: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_preventive_maintenance_checkAndFixDatabase.js]
|
[test_preventive_maintenance_checkAndFixDatabase.js]
|
||||||
|
# Bug 676989: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_preventive_maintenance_console.js]
|
[test_preventive_maintenance_console.js]
|
||||||
[test_removeVisitsByTimeframe.js]
|
[test_removeVisitsByTimeframe.js]
|
||||||
|
# Bug 676989: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_resolveNullBookmarkTitles.js]
|
[test_resolveNullBookmarkTitles.js]
|
||||||
[test_result_sort.js]
|
[test_result_sort.js]
|
||||||
[test_sql_guid_functions.js]
|
[test_sql_guid_functions.js]
|
||||||
[test_tag_autocomplete_search.js]
|
[test_tag_autocomplete_search.js]
|
||||||
[test_tagging.js]
|
[test_tagging.js]
|
||||||
[test_update_frecency_after_delete.js]
|
[test_update_frecency_after_delete.js]
|
||||||
|
# Bug 676989: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_utils_backups_create.js]
|
[test_utils_backups_create.js]
|
||||||
[test_utils_getURLsForContainerNode.js]
|
[test_utils_getURLsForContainerNode.js]
|
||||||
[test_utils_setAnnotationsFor.js]
|
[test_utils_setAnnotationsFor.js]
|
||||||
|
|
|
@ -4,6 +4,8 @@ tail =
|
||||||
|
|
||||||
[test_autocomplete.js]
|
[test_autocomplete.js]
|
||||||
[test_bug_248970.js]
|
[test_bug_248970.js]
|
||||||
|
# Bug 676989: test hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_db_corrupt.js]
|
[test_db_corrupt.js]
|
||||||
[test_db_update_v1.js]
|
[test_db_update_v1.js]
|
||||||
[test_db_update_v1b.js]
|
[test_db_update_v1b.js]
|
||||||
|
|
|
@ -4,3 +4,5 @@ tail =
|
||||||
|
|
||||||
[test_nsITelemetry.js]
|
[test_nsITelemetry.js]
|
||||||
[test_TelemetryPing.js]
|
[test_TelemetryPing.js]
|
||||||
|
# Bug 676989: test fails consistently on Android
|
||||||
|
# fail-if = os == "android"
|
||||||
|
|
|
@ -3461,13 +3461,18 @@ var XPIProvider = {
|
||||||
|
|
||||||
let principal = Cc["@mozilla.org/systemprincipal;1"].
|
let principal = Cc["@mozilla.org/systemprincipal;1"].
|
||||||
createInstance(Ci.nsIPrincipal);
|
createInstance(Ci.nsIPrincipal);
|
||||||
this.bootstrapScopes[aId] = new Components.utils.Sandbox(principal);
|
|
||||||
|
|
||||||
if (!aFile.exists()) {
|
if (!aFile.exists()) {
|
||||||
|
this.bootstrapScopes[aId] = new Components.utils.Sandbox(principal,
|
||||||
|
{sandboxName: aFile.path});
|
||||||
ERROR("Attempted to load bootstrap scope from missing directory " + bootstrap.path);
|
ERROR("Attempted to load bootstrap scope from missing directory " + bootstrap.path);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let uri = getURIForResourceInFile(aFile, "bootstrap.js").spec;
|
||||||
|
this.bootstrapScopes[aId] = new Components.utils.Sandbox(principal,
|
||||||
|
{sandboxName: uri});
|
||||||
|
|
||||||
let loader = Cc["@mozilla.org/moz/jssubscript-loader;1"].
|
let loader = Cc["@mozilla.org/moz/jssubscript-loader;1"].
|
||||||
createInstance(Ci.mozIJSSubScriptLoader);
|
createInstance(Ci.mozIJSSubScriptLoader);
|
||||||
|
|
||||||
|
@ -3475,8 +3480,7 @@ var XPIProvider = {
|
||||||
// As we don't want our caller to control the JS version used for the
|
// As we don't want our caller to control the JS version used for the
|
||||||
// bootstrap file, we run loadSubScript within the context of the
|
// bootstrap file, we run loadSubScript within the context of the
|
||||||
// sandbox with the latest JS version set explicitly.
|
// sandbox with the latest JS version set explicitly.
|
||||||
this.bootstrapScopes[aId].__SCRIPT_URI_SPEC__ =
|
this.bootstrapScopes[aId].__SCRIPT_URI_SPEC__ = uri;
|
||||||
getURIForResourceInFile(aFile, "bootstrap.js").spec;
|
|
||||||
Components.utils.evalInSandbox(
|
Components.utils.evalInSandbox(
|
||||||
"Components.classes['@mozilla.org/moz/jssubscript-loader;1'] \
|
"Components.classes['@mozilla.org/moz/jssubscript-loader;1'] \
|
||||||
.createInstance(Components.interfaces.mozIJSSubScriptLoader) \
|
.createInstance(Components.interfaces.mozIJSSubScriptLoader) \
|
||||||
|
|
|
@ -3,35 +3,91 @@ head = head_addons.js
|
||||||
tail =
|
tail =
|
||||||
|
|
||||||
[test_AddonRepository.js]
|
[test_AddonRepository.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_AddonRepository_cache.js]
|
[test_AddonRepository_cache.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_LightweightThemeManager.js]
|
[test_LightweightThemeManager.js]
|
||||||
[test_badschema.js]
|
[test_badschema.js]
|
||||||
[test_blocklistchange.js]
|
[test_blocklistchange.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bootstrap.js]
|
[test_bootstrap.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug299716.js]
|
[test_bug299716.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug299716_2.js]
|
[test_bug299716_2.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug324121.js]
|
[test_bug324121.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug335238.js]
|
[test_bug335238.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug371495.js]
|
[test_bug371495.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug384052.js]
|
[test_bug384052.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug393285.js]
|
[test_bug393285.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug394300.js]
|
[test_bug394300.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug397778.js]
|
[test_bug397778.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug406118.js]
|
[test_bug406118.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug424262.js]
|
[test_bug424262.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug425657.js]
|
[test_bug425657.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug430120.js]
|
[test_bug430120.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug449027.js]
|
[test_bug449027.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug455906.js]
|
[test_bug455906.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug465190.js]
|
[test_bug465190.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug468528.js]
|
[test_bug468528.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug470377_1.js]
|
[test_bug470377_1.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug470377_2.js]
|
[test_bug470377_2.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug470377_3.js]
|
[test_bug470377_3.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug470377_4.js]
|
[test_bug470377_4.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug514327_1.js]
|
[test_bug514327_1.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug514327_2.js]
|
[test_bug514327_2.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug514327_3.js]
|
[test_bug514327_3.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_bug521905.js]
|
[test_bug521905.js]
|
||||||
[test_bug526598.js]
|
[test_bug526598.js]
|
||||||
[test_bug541420.js]
|
[test_bug541420.js]
|
||||||
|
@ -39,6 +95,8 @@ tail =
|
||||||
[test_bug554133.js]
|
[test_bug554133.js]
|
||||||
[test_bug559800.js]
|
[test_bug559800.js]
|
||||||
[test_bug563256.js]
|
[test_bug563256.js]
|
||||||
|
# Bug 676992: test consistently fails on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_bug564030.js]
|
[test_bug564030.js]
|
||||||
[test_bug566626.js]
|
[test_bug566626.js]
|
||||||
[test_bug567184.js]
|
[test_bug567184.js]
|
||||||
|
@ -53,6 +111,8 @@ tail =
|
||||||
[test_bug596343.js]
|
[test_bug596343.js]
|
||||||
[test_bug596607.js]
|
[test_bug596607.js]
|
||||||
[test_bug616841.js]
|
[test_bug616841.js]
|
||||||
|
# Bug 676992: test consistently fails on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_bug619730.js]
|
[test_bug619730.js]
|
||||||
[test_bug620837.js]
|
[test_bug620837.js]
|
||||||
[test_bug655254.js]
|
[test_bug655254.js]
|
||||||
|
@ -63,9 +123,15 @@ tail =
|
||||||
[test_disable.js]
|
[test_disable.js]
|
||||||
[test_distribution.js]
|
[test_distribution.js]
|
||||||
[test_dss.js]
|
[test_dss.js]
|
||||||
|
# Bug 676992: test consistently fails on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_duplicateplugins.js]
|
[test_duplicateplugins.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_error.js]
|
[test_error.js]
|
||||||
[test_filepointer.js]
|
[test_filepointer.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_fuel.js]
|
[test_fuel.js]
|
||||||
[test_general.js]
|
[test_general.js]
|
||||||
[test_getresource.js]
|
[test_getresource.js]
|
||||||
|
@ -83,6 +149,8 @@ tail =
|
||||||
[test_gfxBlacklist_Vendor.js]
|
[test_gfxBlacklist_Vendor.js]
|
||||||
[test_gfxBlacklist_prefs.js]
|
[test_gfxBlacklist_prefs.js]
|
||||||
[test_install.js]
|
[test_install.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_locale.js]
|
[test_locale.js]
|
||||||
[test_locked.js]
|
[test_locked.js]
|
||||||
[test_manifest.js]
|
[test_manifest.js]
|
||||||
|
@ -91,15 +159,29 @@ tail =
|
||||||
[test_migrate3.js]
|
[test_migrate3.js]
|
||||||
[test_permissions.js]
|
[test_permissions.js]
|
||||||
[test_plugins.js]
|
[test_plugins.js]
|
||||||
|
# Bug 676992: test consistently fails on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_registry.js]
|
[test_registry.js]
|
||||||
[test_safemode.js]
|
[test_safemode.js]
|
||||||
[test_startup.js]
|
[test_startup.js]
|
||||||
|
# Bug 676992: test consistently fails on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_targetPlatforms.js]
|
[test_targetPlatforms.js]
|
||||||
[test_theme.js]
|
[test_theme.js]
|
||||||
|
# Bug 676992: test consistently fails on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_types.js]
|
[test_types.js]
|
||||||
[test_uninstall.js]
|
[test_uninstall.js]
|
||||||
[test_update.js]
|
[test_update.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_updatecheck.js]
|
[test_updatecheck.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_updateid.js]
|
[test_updateid.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
[test_upgrade.js]
|
[test_upgrade.js]
|
||||||
|
# Bug 676992: test consistently hangs on Android
|
||||||
|
skip-if = os == "android"
|
||||||
|
|
||||||
|
|
|
@ -3,3 +3,5 @@ head =
|
||||||
tail =
|
tail =
|
||||||
|
|
||||||
[test_0010_timermanager.js]
|
[test_0010_timermanager.js]
|
||||||
|
# Bug 676992: test consistently fails on Android
|
||||||
|
fail-if = os == "android"
|
||||||
|
|
|
@ -102,6 +102,9 @@ ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
|
||||||
CPPSRCS += nsNativeAppSupportUnix.cpp
|
CPPSRCS += nsNativeAppSupportUnix.cpp
|
||||||
else
|
else
|
||||||
ifeq ($(MOZ_WIDGET_TOOLKIT),qt)
|
ifeq ($(MOZ_WIDGET_TOOLKIT),qt)
|
||||||
|
MOCSRCS += moc_nsNativeAppSupportQt.cpp
|
||||||
|
$(NULL)
|
||||||
|
CPPSRCS += $(MOCSRCS)
|
||||||
CPPSRCS += nsNativeAppSupportQt.cpp
|
CPPSRCS += nsNativeAppSupportQt.cpp
|
||||||
CPPSRCS += nsQAppInstance.cpp
|
CPPSRCS += nsQAppInstance.cpp
|
||||||
EXPORTS += nsQAppInstance.h
|
EXPORTS += nsQAppInstance.h
|
||||||
|
|
|
@ -37,33 +37,92 @@
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "nsNativeAppSupportBase.h"
|
#include <QTimer>
|
||||||
#include "nsString.h"
|
#include "mozilla/ipc/GeckoChildProcessHost.h"
|
||||||
|
#include "nsNativeAppSupportQt.h"
|
||||||
|
#include "nsCOMPtr.h"
|
||||||
|
#include "nsIObserverService.h"
|
||||||
|
#include "mozilla/Services.h"
|
||||||
|
|
||||||
#ifdef MOZ_ENABLE_LIBCONIC
|
#ifdef MOZ_ENABLE_QMSYSTEM2
|
||||||
#include <glib-object.h>
|
void
|
||||||
#endif
|
nsNativeAppSupportQt::activityChanged(MeeGo::QmActivity::Activity activity)
|
||||||
|
|
||||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
|
||||||
#include <libosso.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class nsNativeAppSupportQt : public nsNativeAppSupportBase
|
|
||||||
{
|
{
|
||||||
public:
|
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
|
||||||
NS_IMETHOD Start(PRBool* aRetVal);
|
if (!os)
|
||||||
NS_IMETHOD Stop(PRBool* aResult);
|
return;
|
||||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
|
||||||
// Osso context must be initialized for maemo5 otherwise we will be killed in ~20 seconds
|
if (MeeGo::QmActivity::Inactive == activity) {
|
||||||
osso_context_t *m_osso_context;
|
os->NotifyObservers(nsnull, "system-idle", nsnull);
|
||||||
|
} else {
|
||||||
|
os->NotifyObservers(nsnull, "system-active", nsnull);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
nsNativeAppSupportQt::displayStateChanged(MeeGo::QmDisplayState::DisplayState state)
|
||||||
|
{
|
||||||
|
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
|
||||||
|
if (!os)
|
||||||
|
return;
|
||||||
|
|
||||||
|
switch (state) {
|
||||||
|
case MeeGo::QmDisplayState::On:
|
||||||
|
os->NotifyObservers(nsnull, "system-display-on", nsnull);
|
||||||
|
break;
|
||||||
|
case MeeGo::QmDisplayState::Off:
|
||||||
|
os->NotifyObservers(nsnull, "system-display-dimmed", nsnull);
|
||||||
|
break;
|
||||||
|
case MeeGo::QmDisplayState::Dimmed:
|
||||||
|
os->NotifyObservers(nsnull, "system-display-off", nsnull);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
NS_WARNING("Unknown display state");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void nsNativeAppSupportQt::deviceModeChanged(MeeGo::QmDeviceMode::DeviceMode mode)
|
||||||
|
{
|
||||||
|
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
|
||||||
|
if (!os)
|
||||||
|
return;
|
||||||
|
|
||||||
|
switch (mode) {
|
||||||
|
case MeeGo::QmDeviceMode::DeviceMode::Normal:
|
||||||
|
os->NotifyObservers(nsnull, "profile-change-net-restore", nsnull);
|
||||||
|
break;
|
||||||
|
case MeeGo::QmDeviceMode::DeviceMode::Flight:
|
||||||
|
os->NotifyObservers(nsnull, "profile-change-net-teardown", nsnull);
|
||||||
|
break;
|
||||||
|
case MeeGo::QmDeviceMode::DeviceMode::Error:
|
||||||
|
default:
|
||||||
|
NS_WARNING("Unknown DeviceMode");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void nsNativeAppSupportQt::RefreshStates()
|
||||||
|
{
|
||||||
|
activityChanged(mActivity.get());
|
||||||
|
displayStateChanged(mDisplayState.get());
|
||||||
|
deviceModeChanged(mDeviceMode.getMode());
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
};
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsNativeAppSupportQt::Start(PRBool* aRetVal)
|
nsNativeAppSupportQt::Start(PRBool* aRetVal)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(gAppData, "gAppData must not be null.");
|
NS_ASSERTION(gAppData, "gAppData must not be null.");
|
||||||
|
|
||||||
|
#ifdef MOZ_ENABLE_QMSYSTEM2
|
||||||
|
connect(&mActivity, SIGNAL(activityChanged(MeeGo::QmActivity::Activity)), this, SLOT(activityChanged(MeeGo::QmActivity::Activity)));
|
||||||
|
connect(&mDeviceMode, SIGNAL(deviceModeChanged(MeeGo::QmDeviceMode::DeviceMode)), this, SLOT(deviceModeChanged(MeeGo::QmDeviceMode::DeviceMode)));
|
||||||
|
connect(&mDisplayState, SIGNAL(displayStateChanged(MeeGo::QmDisplayState::DisplayState)), this, SLOT(displayStateChanged(MeeGo::QmDisplayState::DisplayState)));
|
||||||
|
// Init states withing next event loop iteration
|
||||||
|
QTimer::singleShot(0, this, SLOT(RefreshStates()));
|
||||||
|
#endif
|
||||||
|
|
||||||
*aRetVal = PR_TRUE;
|
*aRetVal = PR_TRUE;
|
||||||
#ifdef MOZ_ENABLE_LIBCONIC
|
#ifdef MOZ_ENABLE_LIBCONIC
|
||||||
g_type_init();
|
g_type_init();
|
||||||
|
|
|
@ -0,0 +1,80 @@
|
||||||
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||||
|
/* vim: set ts=8 et sw=2 tw=80: */
|
||||||
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
|
*
|
||||||
|
* The contents of this file are subject to the Mozilla Public License Version
|
||||||
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
* http://www.mozilla.org/MPL/
|
||||||
|
*
|
||||||
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
|
* for the specific language governing rights and limitations under the
|
||||||
|
* License.
|
||||||
|
*
|
||||||
|
* The Original Code is Mozilla Corporation code.
|
||||||
|
*
|
||||||
|
* The Initial Developer of the Original Code is Mozilla Foundation.
|
||||||
|
* Portions created by the Initial Developer are Copyright (C) 2011
|
||||||
|
* the Initial Developer. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Contributor(s):
|
||||||
|
* Oleg Romashin <romaxa@gmail.com>
|
||||||
|
*
|
||||||
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||||
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||||
|
* of those above. If you wish to allow use of your version of this file only
|
||||||
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||||
|
* use your version of this file under the terms of the MPL, indicate your
|
||||||
|
* decision by deleting the provisions above and replace them with the notice
|
||||||
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||||
|
* the provisions above, a recipient may use your version of this file under
|
||||||
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||||
|
*
|
||||||
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <QObject>
|
||||||
|
#ifdef MOZ_ENABLE_QMSYSTEM2
|
||||||
|
#include "qmdevicemode.h"
|
||||||
|
#include "qmdisplaystate.h"
|
||||||
|
#include "qmactivity.h"
|
||||||
|
#endif
|
||||||
|
#include "nsNativeAppSupportBase.h"
|
||||||
|
#include "nsString.h"
|
||||||
|
|
||||||
|
#ifdef MOZ_ENABLE_LIBCONIC
|
||||||
|
#include <glib-object.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||||
|
#include <libosso.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
class nsNativeAppSupportQt : public QObject, public nsNativeAppSupportBase
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
NS_IMETHOD Start(PRBool* aRetVal);
|
||||||
|
NS_IMETHOD Stop(PRBool* aResult);
|
||||||
|
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||||
|
// Osso context must be initialized for maemo5 otherwise we will be killed in ~20 seconds
|
||||||
|
osso_context_t *m_osso_context;
|
||||||
|
#endif
|
||||||
|
#ifdef MOZ_ENABLE_QMSYSTEM2
|
||||||
|
public Q_SLOTS:
|
||||||
|
void activityChanged(MeeGo::QmActivity::Activity activity);
|
||||||
|
void deviceModeChanged(MeeGo::QmDeviceMode::DeviceMode mode);
|
||||||
|
void displayStateChanged(MeeGo::QmDisplayState::DisplayState state);
|
||||||
|
void RefreshStates();
|
||||||
|
|
||||||
|
private:
|
||||||
|
MeeGo::QmDeviceMode mDeviceMode;
|
||||||
|
MeeGo::QmDisplayState mDisplayState;
|
||||||
|
MeeGo::QmActivity mActivity;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
|
@ -5,4 +5,6 @@ tail = tail_handlerService.js
|
||||||
[test_getTypeFromExtension_ext_to_type_mapping.js]
|
[test_getTypeFromExtension_ext_to_type_mapping.js]
|
||||||
[test_getTypeFromExtension_with_empty_Content_Type.js]
|
[test_getTypeFromExtension_with_empty_Content_Type.js]
|
||||||
[test_handlerService.js]
|
[test_handlerService.js]
|
||||||
|
# Bug 676997: test consistently fails on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_punycodeURIs.js]
|
[test_punycodeURIs.js]
|
||||||
|
|
|
@ -3,3 +3,5 @@ head =
|
||||||
tail =
|
tail =
|
||||||
|
|
||||||
[test_encoding.js]
|
[test_encoding.js]
|
||||||
|
# Bug 676995: test hangs consistently on Android
|
||||||
|
skip-if = os == "android"
|
||||||
|
|
|
@ -492,6 +492,7 @@ public:
|
||||||
SURFACE_DESTROYED = 14,
|
SURFACE_DESTROYED = 14,
|
||||||
GECKO_EVENT_SYNC = 15,
|
GECKO_EVENT_SYNC = 15,
|
||||||
FORCED_RESIZE = 16,
|
FORCED_RESIZE = 16,
|
||||||
|
ACTIVITY_START = 17,
|
||||||
dummy_java_enum_list_end
|
dummy_java_enum_list_end
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -328,6 +328,7 @@ nsAppShell::ProcessNextNativeEvent(PRBool mayWait)
|
||||||
mozilla::services::GetObserverService();
|
mozilla::services::GetObserverService();
|
||||||
NS_NAMED_LITERAL_STRING(minimize, "heap-minimize");
|
NS_NAMED_LITERAL_STRING(minimize, "heap-minimize");
|
||||||
obsServ->NotifyObservers(nsnull, "memory-pressure", minimize.get());
|
obsServ->NotifyObservers(nsnull, "memory-pressure", minimize.get());
|
||||||
|
obsServ->NotifyObservers(nsnull, "application-background", nsnull);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -359,6 +360,14 @@ nsAppShell::ProcessNextNativeEvent(PRBool mayWait)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case AndroidGeckoEvent::ACTIVITY_START: {
|
||||||
|
nsCOMPtr<nsIObserverService> obsServ =
|
||||||
|
mozilla::services::GetObserverService();
|
||||||
|
obsServ->NotifyObservers(nsnull, "application-foreground", nsnull);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case AndroidGeckoEvent::LOAD_URI: {
|
case AndroidGeckoEvent::LOAD_URI: {
|
||||||
nsCOMPtr<nsICommandLineRunner> cmdline
|
nsCOMPtr<nsICommandLineRunner> cmdline
|
||||||
(do_CreateInstance("@mozilla.org/toolkit/command-line;1"));
|
(do_CreateInstance("@mozilla.org/toolkit/command-line;1"));
|
||||||
|
|
|
@ -321,7 +321,7 @@ private:
|
||||||
*/
|
*/
|
||||||
class MozMGraphicsView : public MWindow
|
class MozMGraphicsView : public MWindow
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
MozMGraphicsView(MozQWidget* aTopLevel, QWidget* aParent = nsnull)
|
MozMGraphicsView(MozQWidget* aTopLevel, QWidget* aParent = nsnull)
|
||||||
: MWindow(aParent)
|
: MWindow(aParent)
|
||||||
|
@ -330,6 +330,22 @@ public:
|
||||||
{
|
{
|
||||||
MozMSceneWindow* page = new MozMSceneWindow(aTopLevel);
|
MozMSceneWindow* page = new MozMSceneWindow(aTopLevel);
|
||||||
page->appear(this);
|
page->appear(this);
|
||||||
|
QObject::connect(this, SIGNAL(switcherEntered()), this, SLOT(onSwitcherEntered()));
|
||||||
|
QObject::connect(this, SIGNAL(switcherExited()), this, SLOT(onSwitcherExited()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Q_SLOTS:
|
||||||
|
void onSwitcherEntered() {
|
||||||
|
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
|
||||||
|
if (!os)
|
||||||
|
return;
|
||||||
|
os->NotifyObservers(nsnull, "application-background", nsnull);
|
||||||
|
}
|
||||||
|
void onSwitcherExited() {
|
||||||
|
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
|
||||||
|
if (!os)
|
||||||
|
return;
|
||||||
|
os->NotifyObservers(nsnull, "application-foreground", nsnull);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -6,8 +6,12 @@ tail =
|
||||||
[test_bug332389.js]
|
[test_bug332389.js]
|
||||||
[test_bug333505.js]
|
[test_bug333505.js]
|
||||||
[test_bug364285-1.js]
|
[test_bug364285-1.js]
|
||||||
|
# Bug 676998: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_bug374754.js]
|
[test_bug374754.js]
|
||||||
[test_bug476919.js]
|
[test_bug476919.js]
|
||||||
|
# Bug 676998: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_bug478086.js]
|
[test_bug478086.js]
|
||||||
[test_bug656331.js]
|
[test_bug656331.js]
|
||||||
[test_compmgr_warnings.js]
|
[test_compmgr_warnings.js]
|
||||||
|
@ -15,6 +19,8 @@ tail =
|
||||||
[test_file_equality.js]
|
[test_file_equality.js]
|
||||||
[test_hidden_files.js]
|
[test_hidden_files.js]
|
||||||
[test_home.js]
|
[test_home.js]
|
||||||
|
# Bug 676998: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_iniProcessor.js]
|
[test_iniProcessor.js]
|
||||||
[test_ioutil.js]
|
[test_ioutil.js]
|
||||||
[test_localfile.js]
|
[test_localfile.js]
|
||||||
|
@ -28,5 +34,9 @@ skip-if = os == "win" # See bug: 676412
|
||||||
[test_streams.js]
|
[test_streams.js]
|
||||||
[test_stringstream.js]
|
[test_stringstream.js]
|
||||||
[test_symlinks.js]
|
[test_symlinks.js]
|
||||||
|
# Bug 676998: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_systemInfo.js]
|
[test_systemInfo.js]
|
||||||
|
# Bug 676998: test fails consistently on Android
|
||||||
|
fail-if = os == "android"
|
||||||
[test_versioncomparator.js]
|
[test_versioncomparator.js]
|
||||||
|
|
Загрузка…
Ссылка в новой задаче