Merge mozilla-central to mozilla-inbound

This commit is contained in:
Carsten "Tomcat" Book 2015-11-04 12:31:11 +01:00
Родитель 9d98f9a481 3e11f2fe34
Коммит 66acd27cd3
106 изменённых файлов: 1654 добавлений и 2148 удалений

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

@ -183,7 +183,7 @@ CONTEXTS.SelectorContext = Class({
let selector = this.selector;
while (!(popupNode instanceof Ci.nsIDOMDocument)) {
if (popupNode.mozMatchesSelector(selector))
if (popupNode.matches(selector))
return popupNode;
popupNode = popupNode.parentNode;

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

@ -294,21 +294,21 @@ exports.testStringOverload = createProxyTest(html, function (helper, assert) {
);
});
exports["test MozMatchedSelector"] = createProxyTest("", function (helper) {
exports["test Element.matches()"] = createProxyTest("", function (helper) {
helper.createWorker(
'new ' + function ContentScriptScope() {
// Check mozMatchesSelector XrayWrappers bug:
// mozMatchesSelector returns bad results when we are not calling it from the node itself
// SEE BUG 658909: mozMatchesSelector returns incorrect results with XrayWrappers
assert(document.createElement( "div" ).mozMatchesSelector("div"),
"mozMatchesSelector works while being called from the node");
assert(document.documentElement.mozMatchesSelector.call(
// Check matches XrayWrappers bug (Bug 658909):
// Test that Element.matches() does not return bad results when we are
// not calling it from the node itself.
assert(document.createElement( "div" ).matches("div"),
"matches works while being called from the node");
assert(document.documentElement.matches.call(
document.createElement( "div" ),
"div"
),
"mozMatchesSelector works while being called from a " +
"matches works while being called from a " +
"function reference to " +
"document.documentElement.mozMatchesSelector.call");
"document.documentElement.matches.call");
done();
}
);

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

@ -294,21 +294,21 @@ exports.testStringOverload = createProxyTest(html, function (helper, assert) {
);
});
exports["test MozMatchedSelector"] = createProxyTest("", function (helper) {
exports["test Element.matches()"] = createProxyTest("", function (helper) {
helper.createWorker(
'new ' + function ContentScriptScope() {
// Check mozMatchesSelector XrayWrappers bug:
// mozMatchesSelector returns bad results when we are not calling it from the node itself
// SEE BUG 658909: mozMatchesSelector returns incorrect results with XrayWrappers
assert(document.createElement( "div" ).mozMatchesSelector("div"),
"mozMatchesSelector works while being called from the node");
assert(document.documentElement.mozMatchesSelector.call(
// Check matches XrayWrappers bug (Bug 658909):
// Test that Element.matches() does not return bad results when we are
// not calling it from the node itself.
assert(document.createElement( "div" ).matches("div"),
"matches works while being called from the node");
assert(document.documentElement.matches.call(
document.createElement( "div" ),
"div"
),
"mozMatchesSelector works while being called from a " +
"matches works while being called from a " +
"function reference to " +
"document.documentElement.mozMatchesSelector.call");
"document.documentElement.matches.call");
done();
}
);

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="06de78d2c61c084956640c480280ba518b2fe29f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="47da49f8206788d70d834c3a63d9245d50c89103"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="06de78d2c61c084956640c480280ba518b2fe29f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="47da49f8206788d70d834c3a63d9245d50c89103"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>

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

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="06de78d2c61c084956640c480280ba518b2fe29f"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="47da49f8206788d70d834c3a63d9245d50c89103"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="4ace9aaee0e048dfda11bb787646c59982a3dc80"/>

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

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="06de78d2c61c084956640c480280ba518b2fe29f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="47da49f8206788d70d834c3a63d9245d50c89103"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="27de93fe66c3e80e157d157bd52ca99565351669"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="38934e434c6c49ffdf7492f20f7258e7c3934b49"/>
@ -31,7 +31,7 @@
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="b89fda71fcd0fa0cf969310e75be3ea33e048b44"/>
<project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="2e7d5348f35575870b3c7e567a9a9f6d66f8d6c5"/>
<project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" revision="1342fd7b4b000ac3e76a5dfe111a0de9d710b4c8"/>
<project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9" revision="a356cc4cab8b8e6b4642525b689c72de35dc6d12"/>
<project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9" revision="812c0404c93290459f7be7870702480ceea9f5d7"/>
<project groups="linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" path="prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" revision="1b26ad444462ccbd97f6319565b4735f7bd779e5"/>
<project name="device/common" path="device/common" revision="4e1a38704dcfadef60ed2da3cfeba02a56b069d2"/>
<project name="device/sample" path="device/sample" revision="b045905b46c8b4ee630d0c2aee7db63eaec722d9"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="06de78d2c61c084956640c480280ba518b2fe29f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="47da49f8206788d70d834c3a63d9245d50c89103"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="06de78d2c61c084956640c480280ba518b2fe29f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="47da49f8206788d70d834c3a63d9245d50c89103"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="06de78d2c61c084956640c480280ba518b2fe29f"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="47da49f8206788d70d834c3a63d9245d50c89103"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="4ace9aaee0e048dfda11bb787646c59982a3dc80"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="06de78d2c61c084956640c480280ba518b2fe29f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="47da49f8206788d70d834c3a63d9245d50c89103"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>

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

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "06de78d2c61c084956640c480280ba518b2fe29f",
"git_revision": "47da49f8206788d70d834c3a63d9245d50c89103",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "53578330b30736e8fef30dee4eccf296e2d53ca3",
"revision": "44029d7d66e6ed745dd19fc6378d1a986382fc84",
"repo_path": "integration/gaia-central"
}

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="06de78d2c61c084956640c480280ba518b2fe29f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="47da49f8206788d70d834c3a63d9245d50c89103"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>

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

@ -18,7 +18,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="06de78d2c61c084956640c480280ba518b2fe29f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="47da49f8206788d70d834c3a63d9245d50c89103"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="27de93fe66c3e80e157d157bd52ca99565351669"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="38934e434c6c49ffdf7492f20f7258e7c3934b49"/>
@ -32,7 +32,7 @@
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="b89fda71fcd0fa0cf969310e75be3ea33e048b44"/>
<project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="2e7d5348f35575870b3c7e567a9a9f6d66f8d6c5"/>
<project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" revision="1342fd7b4b000ac3e76a5dfe111a0de9d710b4c8"/>
<project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9" revision="a356cc4cab8b8e6b4642525b689c72de35dc6d12"/>
<project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9" revision="812c0404c93290459f7be7870702480ceea9f5d7"/>
<project groups="linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" path="prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" revision="1b26ad444462ccbd97f6319565b4735f7bd779e5"/>
<project name="device/common" path="device/common" revision="4e1a38704dcfadef60ed2da3cfeba02a56b069d2"/>
<project name="device/sample" path="device/sample" revision="b045905b46c8b4ee630d0c2aee7db63eaec722d9"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="06de78d2c61c084956640c480280ba518b2fe29f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="47da49f8206788d70d834c3a63d9245d50c89103"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>

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

@ -95,7 +95,7 @@
// host and the cert is bad (STS Spec section 7.3) or if the
// certerror is in a frame (bug 633691).
if (cssClass == "badStsCert" || window != top) {
document.getElementById("advancedPanel").setAttribute("hidden", "true");
document.getElementById("exceptionDialogButton").setAttribute("hidden", "true");
}
if (cssClass != "badStsCert") {
document.getElementById("badStsCertExplanation").setAttribute("hidden", "true");

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

@ -2,10 +2,11 @@
* http://creativecommons.org/publicdomain/zero/1.0/ */
// This is testing the aboutCertError page (Bug 1207107). It's a start,
// but should be expanded to include cert_domain_link / badStsCert
// but should be expanded to include cert_domain_link
const GOOD_PAGE = "https://example.com/";
const BAD_CERT = "https://expired.example.com/";
const BAD_STS_CERT = "https://badchain.include-subdomains.pinning.example.com:443";
add_task(function* checkReturnToAboutHome() {
info("Loading a bad cert page directly and making sure 'return to previous page' goes to about:home");
@ -68,6 +69,26 @@ add_task(function* checkReturnToPreviousPage() {
gBrowser.removeCurrentTab();
});
add_task(function* checkBadStsCert() {
info("Loading a badStsCert and making sure exception button doesn't show up");
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, GOOD_PAGE);
let browser = gBrowser.selectedBrowser;
info("Loading and waiting for the cert error");
let certErrorLoaded = waitForCertErrorLoad(browser);
BrowserTestUtils.loadURI(browser, BAD_STS_CERT);
yield certErrorLoaded;
let exceptionButtonHidden = yield ContentTask.spawn(browser, null, function* () {
let doc = content.document;
let exceptionButton = doc.getElementById("exceptionDialogButton");
return exceptionButton.hidden;
});
ok(exceptionButtonHidden, "Exception button is hidden");
gBrowser.removeCurrentTab();
});
function waitForCertErrorLoad(browser) {
return new Promise(resolve => {
info("Waiting for DOMContentLoaded event");

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

@ -40,10 +40,8 @@ body,
}
.mozilla-logo {
background: url("../img/mozilla-logo.svg#logo") no-repeat;
background-size: contain;
height: 26px;
width: 100px;
height: 30px;
}
/* Standalone Overlay wrapper */
@ -95,9 +93,6 @@ html[dir="rtl"] .standalone-overlay-wrapper > .general-support-url {
.standalone-overlay-wrapper > .standalone-moz-logo {
width: 50px;
height: 13px;
background-size: contain;
background-image: url("../img/mozilla-logo.svg#logo-white");
background-repeat: no-repeat;
position: absolute;
bottom: 0;
right: 0;

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

@ -122,7 +122,7 @@ loop.standaloneRoomViews = (function(mozL10n) {
),
React.createElement(ToSView, {dispatcher: this.props.dispatcher}),
React.createElement("p", {className: "mozilla-logo"})
React.createElement("img", {className: "mozilla-logo", src: "img/mozilla-logo.svg#logo"})
)
)
);
@ -654,7 +654,7 @@ loop.standaloneRoomViews = (function(mozL10n) {
React.createElement("div", {className: "standalone-overlay-wrapper"},
React.createElement("div", {className: "hello-logo"}),
React.createElement(GeneralSupportURL, {dispatcher: this.props.dispatcher}),
React.createElement("div", {className: "standalone-moz-logo"})
React.createElement("img", {className: "standalone-moz-logo", src: "img/mozilla-logo.svg#logo-white"})
)
);
}

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

@ -122,7 +122,7 @@ loop.standaloneRoomViews = (function(mozL10n) {
}
</div>
<ToSView dispatcher={this.props.dispatcher} />
<p className="mozilla-logo" />
<img className="mozilla-logo" src="img/mozilla-logo.svg#logo" />
</div>
</div>
);
@ -654,7 +654,7 @@ loop.standaloneRoomViews = (function(mozL10n) {
<div className="standalone-overlay-wrapper">
<div className="hello-logo"></div>
<GeneralSupportURL dispatcher={this.props.dispatcher} />
<div className="standalone-moz-logo" />
<img className="standalone-moz-logo" src="img/mozilla-logo.svg#logo-white" />
</div>
);
}

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

@ -67,6 +67,7 @@ app.get("/content/c/config.js", getConfigFile);
// /content - for the standalone files.
app.use("/ui", express.static(path.join(__dirname, "..", "ui")));
app.use("/ui/img/", express.static(path.join(__dirname, "..", "standalone", "content", "img")));
app.use("/ui/loop/", express.static(path.join(__dirname, "..", "content")));
app.use("/ui/shared/", express.static(path.join(__dirname, "..", "content",
"shared")));

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

@ -31,6 +31,11 @@ player.animationDurationLabel=Duration:
# displayed before the animation delay.
player.animationDelayLabel=Delay:
# LOCALIZATION NOTE (player.animationRateLabel):
# This string is displayed in each animation player widget. It is the label
# displayed before the animation playback rate.
player.animationRateLabel=Playback rate:
# LOCALIZATION NOTE (player.animationIterationCountLabel):
# This string is displayed in each animation player widget. It is the label
# displayed before the number of times the animation is set to repeat.

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

@ -188,8 +188,8 @@ case "$target" in
esac
])
AC_DEFUN([MOZ_ANDROID_STLPORT],
AC_DEFUN([MOZ_ANDROID_CPU_ARCH],
[
if test "$OS_TARGET" = "Android" -a -z "$gonkdir"; then
@ -209,7 +209,13 @@ if test "$OS_TARGET" = "Android" -a -z "$gonkdir"; then
esac
AC_SUBST(ANDROID_CPU_ARCH)
fi
])
AC_DEFUN([MOZ_ANDROID_STLPORT],
[
if test "$OS_TARGET" = "Android" -a -z "$gonkdir"; then
cpu_arch_dir="$ANDROID_CPU_ARCH"
if test "$MOZ_THUMB2" = 1; then
cpu_arch_dir="$cpu_arch_dir/thumb"

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

@ -321,7 +321,11 @@ if test -n "$gonkdir" ; then
direct_nspr_config=1
android_cxx_stl=mozstlport
else
MOZ_ANDROID_NDK
if test "$COMPILE_ENVIRONMENT"; then
MOZ_ANDROID_NDK
else
AC_DEFINE(ANDROID)
fi # COMPILE_ENVIRONMENT
case "$target" in
*-android*|*-linuxandroid*)
@ -1197,7 +1201,14 @@ esac
dnl Configure platform-specific CPU architecture compiler options.
dnl ==============================================================
MOZ_ARCH_OPTS
if test "$COMPILE_ENVIRONMENT"; then
MOZ_ARCH_OPTS
else
if test "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk"; then
dnl Default Android builds to ARMv7.
MOZ_ARCH=armv7-a
fi
fi # COMPILE_ENVIRONMENT
dnl =================================================================
dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
@ -1246,7 +1257,10 @@ dnl Android libstdc++, placed here so it can use MOZ_ARCH
dnl computed above.
dnl ========================================================
MOZ_ANDROID_STLPORT
MOZ_ANDROID_CPU_ARCH
if test "$COMPILE_ENVIRONMENT"; then
MOZ_ANDROID_STLPORT
fi # COMPILE_ENVIRONMENT
dnl ========================================================
dnl Suppress Clang Argument Warnings
@ -2532,6 +2546,7 @@ esac
if test -z "$COMPILE_ENVIRONMENT"; then
SKIP_COMPILER_CHECKS=1
SKIP_LIBRARY_CHECKS=1
PKG_SKIP_STRIP=1
else
MOZ_COMPILER_OPTS
fi # COMPILE_ENVIRONMENT

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

@ -86,6 +86,8 @@ var getServerTraits = Task.async(function*(target) {
method: "stopAnimationPlayerUpdates" },
{ name: "hasSetPlaybackRate", actor: "animationplayer",
method: "setPlaybackRate" },
{ name: "hasSetPlaybackRates", actor: "animations",
method: "setPlaybackRates" },
{ name: "hasTargetNode", actor: "domwalker",
method: "getNodeFromActor" },
{ name: "hasSetCurrentTimes", actor: "animations",
@ -284,6 +286,23 @@ var AnimationsController = {
}
}),
/**
* Set all known animations' playback rates to the provided rate.
* @param {Number} rate.
* @return {Promise} Resolves when the rate has been set.
*/
setPlaybackRateAll: Task.async(function*(rate) {
if (this.traits.hasSetPlaybackRates) {
// If the backend can set all playback rates at the same time, use that.
yield this.animationsFront.setPlaybackRates(this.animationPlayers, rate);
} else if (this.traits.hasSetPlaybackRate) {
// Otherwise, fall back to setting each rate individually.
for (let animation of this.animationPlayers) {
yield animation.setPlaybackRate(rate);
}
}
}),
// AnimationPlayerFront objects are managed by this controller. They are
// retrieved when refreshAnimationPlayers is called, stored in the
// animationPlayers array, and destroyed when refreshAnimationPlayers is

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

@ -22,6 +22,7 @@
<div id="timeline-toolbar" class="theme-toolbar">
<button id="rewind-timeline" standalone="true" class="devtools-button"></button>
<button id="pause-resume-timeline" standalone="true" class="devtools-button pause-button paused"></button>
<span id="timeline-rate"></span>
<span id="timeline-current-time" class="label"></span>
</div>
<div id="players"></div>

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

@ -3,12 +3,14 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* globals AnimationsController, document, performance, promise,
gToolbox, gInspector, requestAnimationFrame, cancelAnimationFrame, L10N */
/* globals AnimationsController, document, promise, gToolbox, gInspector */
"use strict";
const {AnimationsTimeline} = require("devtools/client/animationinspector/components");
const {
AnimationsTimeline,
RateSelector
} = require("devtools/client/animationinspector/components");
const {formatStopwatchTime} = require("devtools/client/animationinspector/utils");
var $ = (selector, target = document) => target.querySelector(selector);
@ -39,6 +41,7 @@ var AnimationsPanel = {
this.playTimelineButtonEl = $("#pause-resume-timeline");
this.rewindTimelineButtonEl = $("#rewind-timeline");
this.timelineCurrentTimeEl = $("#timeline-current-time");
this.rateSelectorEl = $("#timeline-rate");
// If the server doesn't support toggling all animations at once, hide the
// whole global toolbar.
@ -49,7 +52,8 @@ var AnimationsPanel = {
// Binding functions that need to be called in scope.
for (let functionName of ["onPickerStarted", "onPickerStopped",
"refreshAnimationsUI", "toggleAll", "onTabNavigated",
"onTimelineDataChanged", "playPauseTimeline", "rewindTimeline"]) {
"onTimelineDataChanged", "playPauseTimeline", "rewindTimeline",
"onRateChanged"]) {
this[functionName] = this[functionName].bind(this);
}
let hUtils = gToolbox.highlighterUtils;
@ -58,12 +62,16 @@ var AnimationsPanel = {
this.animationsTimelineComponent = new AnimationsTimeline(gInspector);
this.animationsTimelineComponent.init(this.playersEl);
if (AnimationsController.traits.hasSetPlaybackRate) {
this.rateSelectorComponent = new RateSelector();
this.rateSelectorComponent.init(this.rateSelectorEl);
}
this.startListeners();
yield this.refreshAnimationsUI();
this.initialized.resolve();
this.emit(this.PANEL_INITIALIZED);
}),
@ -83,10 +91,15 @@ var AnimationsPanel = {
this.animationsTimelineComponent.destroy();
this.animationsTimelineComponent = null;
if (this.rateSelectorComponent) {
this.rateSelectorComponent.destroy();
this.rateSelectorComponent = null;
}
this.playersEl = this.errorMessageEl = null;
this.toggleAllButtonEl = this.pickerButtonEl = null;
this.playTimelineButtonEl = this.rewindTimelineButtonEl = null;
this.timelineCurrentTimeEl = null;
this.timelineCurrentTimeEl = this.rateSelectorEl = null;
this.destroyed.resolve();
}),
@ -107,6 +120,10 @@ var AnimationsPanel = {
this.animationsTimelineComponent.on("timeline-data-changed",
this.onTimelineDataChanged);
if (this.rateSelectorComponent) {
this.rateSelectorComponent.on("rate-changed", this.onRateChanged);
}
},
stopListeners: function() {
@ -125,6 +142,10 @@ var AnimationsPanel = {
this.animationsTimelineComponent.off("timeline-data-changed",
this.onTimelineDataChanged);
if (this.rateSelectorComponent) {
this.rateSelectorComponent.off("rate-changed", this.onRateChanged);
}
},
togglePlayers: function(isVisible) {
@ -173,13 +194,23 @@ var AnimationsPanel = {
.catch(e => console.error(e));
},
/**
* Set the playback rate of all current animations shown in the timeline to
* the value of this.rateSelectorEl.
*/
onRateChanged: function(e, rate) {
AnimationsController.setPlaybackRateAll(rate)
.then(() => this.refreshAnimationsStateAndUI())
.catch(e => console.error(e));
},
onTabNavigated: function() {
this.toggleAllButtonEl.classList.remove("paused");
},
onTimelineDataChanged: function(e, data) {
this.timelineData = data;
let {isMoving, isPaused, isUserDrag, time} = data;
let {isMoving, isUserDrag, time} = data;
this.playTimelineButtonEl.classList.toggle("paused", !isMoving);
@ -232,6 +263,11 @@ var AnimationsPanel = {
AnimationsController.animationPlayers,
AnimationsController.documentCurrentTime);
// Re-render the rate selector component.
if (this.rateSelectorComponent) {
this.rateSelectorComponent.render(AnimationsController.animationPlayers);
}
// If there are no players to show, show the error message instead and
// return.
if (!AnimationsController.animationPlayers.length) {

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

@ -34,6 +34,8 @@ const L10N = new ViewHelpers.L10N(STRINGS_URI);
const MILLIS_TIME_FORMAT_MAX_DURATION = 4000;
// The minimum spacing between 2 time graduation headers in the timeline (px).
const TIME_GRADUATION_MIN_SPACING = 40;
// List of playback rate presets displayed in the timeline toolbar.
const PLAYBACK_RATES = [.1, .25, .5, 1, 2, 5, 10];
// The size of the fast-track icon (for compositor-running animations), this is
// used to position the icon correctly.
const FAST_TRACK_ICON_SIZE = 20;
@ -187,6 +189,10 @@ AnimationTargetNode.prototype = {
this.previewEl.appendChild(document.createTextNode(">"));
}
this.startListeners();
},
startListeners: function() {
// Init events for highlighting and selecting the node.
this.previewEl.addEventListener("mouseover", this.onPreviewMouseOver);
this.previewEl.addEventListener("mouseout", this.onPreviewMouseOut);
@ -200,15 +206,19 @@ AnimationTargetNode.prototype = {
TargetNodeHighlighter.on("highlighted", this.onTargetHighlighterLocked);
},
destroy: function() {
TargetNodeHighlighter.unhighlight().catch(e => console.error(e));
stopListeners: function() {
TargetNodeHighlighter.off("highlighted", this.onTargetHighlighterLocked);
this.inspector.off("markupmutation", this.onMarkupMutations);
this.previewEl.removeEventListener("mouseover", this.onPreviewMouseOver);
this.previewEl.removeEventListener("mouseout", this.onPreviewMouseOut);
this.previewEl.removeEventListener("click", this.onSelectNodeClick);
this.highlightNodeEl.removeEventListener("click", this.onHighlightNodeClick);
},
destroy: function() {
TargetNodeHighlighter.unhighlight().catch(e => console.error(e));
this.stopListeners();
this.el.remove();
this.el = this.tagNameEl = this.idEl = this.classEl = null;
@ -217,21 +227,26 @@ AnimationTargetNode.prototype = {
},
get highlighterUtils() {
return this.inspector.toolbox.highlighterUtils;
if (this.inspector && this.inspector.toolbox) {
return this.inspector.toolbox.highlighterUtils;
}
return null;
},
onPreviewMouseOver: function() {
if (!this.nodeFront) {
if (!this.nodeFront || !this.highlighterUtils) {
return;
}
this.highlighterUtils.highlightNodeFront(this.nodeFront);
this.highlighterUtils.highlightNodeFront(this.nodeFront)
.catch(e => console.error(e));
},
onPreviewMouseOut: function() {
if (!this.nodeFront) {
if (!this.nodeFront || !this.highlighterUtils) {
return;
}
this.highlighterUtils.unhighlight();
this.highlighterUtils.unhighlight()
.catch(e => console.error(e));
},
onSelectNodeClick: function() {
@ -331,6 +346,90 @@ AnimationTargetNode.prototype = {
})
};
/**
* UI component responsible for displaying a playback rate selector UI.
* The rendering logic is such that a predefined list of rates is generated.
* If *all* animations passed to render share the same rate, then that rate is
* selected in the <select> element, otherwise, the empty value is selected.
* If the rate that all animations share isn't part of the list of predefined
* rates, than that rate is added to the list.
*/
function RateSelector() {
this.onRateChanged = this.onRateChanged.bind(this);
EventEmitter.decorate(this);
}
exports.RateSelector = RateSelector;
RateSelector.prototype = {
init: function(containerEl) {
this.selectEl = createNode({
parent: containerEl,
nodeType: "select",
attributes: {"class": "devtools-button"}
});
this.selectEl.addEventListener("change", this.onRateChanged);
},
destroy: function() {
this.selectEl.removeEventListener("change", this.onRateChanged);
this.selectEl.remove();
this.selectEl = null;
},
getAnimationsRates: function(animations) {
return sortedUnique(animations.map(a => a.state.playbackRate));
},
getAllRates: function(animations) {
let animationsRates = this.getAnimationsRates(animations);
if (animationsRates.length > 1) {
return PLAYBACK_RATES;
}
return sortedUnique(PLAYBACK_RATES.concat(animationsRates));
},
render: function(animations) {
let allRates = this.getAnimationsRates(animations);
let hasOneRate = allRates.length === 1;
this.selectEl.innerHTML = "";
if (!hasOneRate) {
// When the animations displayed have mixed playback rates, we can't
// select any of the predefined ones, instead, insert an empty rate.
createNode({
parent: this.selectEl,
nodeType: "option",
attributes: {value: "", selector: "true"},
textContent: "-"
});
}
for (let rate of this.getAllRates(animations)) {
let option = createNode({
parent: this.selectEl,
nodeType: "option",
attributes: {value: rate},
textContent: L10N.getFormatStr("player.playbackRateLabel", rate)
});
// If there's only one rate and this is the option for it, select it.
if (hasOneRate && rate === allRates[0]) {
option.setAttribute("selected", "true");
}
}
},
onRateChanged: function() {
let rate = parseFloat(this.selectEl.value);
if (!isNaN(rate)) {
this.emit("rate-changed", rate);
}
}
};
/**
* The TimeScale helper object is used to know which size should something be
* displayed with in the animation panel, depending on the animations that are
@ -858,21 +957,49 @@ AnimationTimeBlock.prototype = {
getTooltipText: function(state) {
let getTime = time => L10N.getFormatStr("player.timeLabel",
L10N.numberWithDecimals(time / 1000, 2));
// The type isn't always available, older servers don't send it.
let title =
let text = "";
// Adding the name (the type isn't always available, older servers don't
// send it).
text +=
state.type
? L10N.getFormatStr("timeline." + state.type + ".nameLabel", state.name)
: state.name;
let delay = L10N.getStr("player.animationDelayLabel") + " " +
getTime(state.delay);
let duration = L10N.getStr("player.animationDurationLabel") + " " +
getTime(state.duration);
let iterations = L10N.getStr("player.animationIterationCountLabel") + " " +
(state.iterationCount ||
L10N.getStr("player.infiniteIterationCountText"));
let compositor = state.isRunningOnCompositor
? L10N.getStr("player.runningOnCompositorTooltip")
: "";
return [title, duration, iterations, delay, compositor].join("\n");
text += "\n";
// Adding the delay.
text += L10N.getStr("player.animationDelayLabel") + " ";
text += getTime(state.delay);
text += "\n";
// Adding the duration.
text += L10N.getStr("player.animationDurationLabel") + " ";
text += getTime(state.duration);
text += "\n";
// Adding the iteration count (the infinite symbol, or an integer).
// XXX: see bug 1219608 to remove this if the count is 1.
text += L10N.getStr("player.animationIterationCountLabel") + " ";
text += state.iterationCount ||
L10N.getStr("player.infiniteIterationCountText");
text += "\n";
// Adding the playback rate if it's different than 1.
if (state.playbackRate !== 1) {
text += L10N.getStr("player.animationRateLabel") + " ";
text += state.playbackRate;
text += "\n";
}
// Adding a note that the animation is running on the compositor thread if
// needed.
if (state.isRunningOnCompositor) {
text += L10N.getStr("player.runningOnCompositorTooltip");
}
return text;
}
};
let sortedUnique = arr => [...new Set(arr)].sort((a, b) => a > b);

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

@ -28,6 +28,7 @@ support-files =
[browser_animation_timeline_currentTime.js]
[browser_animation_timeline_header.js]
[browser_animation_timeline_pause_button.js]
[browser_animation_timeline_rate_selector.js]
[browser_animation_timeline_rewind_button.js]
[browser_animation_timeline_scrubber_exists.js]
[browser_animation_timeline_scrubber_movable.js]

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

@ -0,0 +1,54 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Check that the timeline toolbar contains a playback rate selector UI and that
// it can be used to change the playback rate of animations in the timeline.
// Also check that it displays the rate of the current animations in case they
// all have the same rate, or that it displays the empty value in case they
// have mixed rates.
add_task(function*() {
yield addTab(TEST_URL_ROOT + "doc_simple_animation.html");
let {panel, controller, inspector, toolbox} = yield openAnimationInspector();
// In this test, we disable the highlighter on purpose because of the way
// events are simulated to select an option in the playbackRate <select>.
// Indeed, this may cause mousemove events to be triggered on the nodes that
// are underneath the <select>, and these are AnimationTargetNode instances.
// Simulating mouse events on them will cause the highlighter to emit requests
// and this might cause the test to fail if they happen after it has ended.
disableHighlighter(toolbox);
let select = panel.rateSelectorEl.firstChild;
ok(select, "The rate selector exists");
info("Change all of the current animations' rates to 0.5");
yield changeTimelinePlaybackRate(panel, .5);
checkAllAnimationsRatesChanged(controller, select, .5);
info("Select just one animated node and change its rate only");
yield selectNode(".animated", inspector);
yield changeTimelinePlaybackRate(panel, 2);
checkAllAnimationsRatesChanged(controller, select, 2);
info("Select the <body> again, it should now have mixed-rates animations");
yield selectNode("body", inspector);
is(select.value, "", "The selected rate is empty");
info("Change the rate for these mixed-rate animations");
yield changeTimelinePlaybackRate(panel, 1);
checkAllAnimationsRatesChanged(controller, select, 1);
});
function checkAllAnimationsRatesChanged({animationPlayers}, select, rate) {
ok(animationPlayers.every(({state}) => state.playbackRate === rate),
"All animations' rates have been set to " + rate);
is(select.value, rate, "The right value is displayed in the select");
}

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

@ -480,6 +480,11 @@ function* assertScrubberMoving(panel, isMoving) {
}
}
/**
* Click the play/pause button in the timeline toolbar and wait for animations
* to update.
* @param {AnimationsPanel} panel
*/
function* clickTimelinePlayPauseButton(panel) {
let onUiUpdated = panel.once(panel.UI_UPDATED_EVENT);
@ -491,6 +496,11 @@ function* clickTimelinePlayPauseButton(panel) {
yield waitForAllAnimationTargets(panel);
}
/**
* Click the rewind button in the timeline toolbar and wait for animations to
* update.
* @param {AnimationsPanel} panel
*/
function* clickTimelineRewindButton(panel) {
let onUiUpdated = panel.once(panel.UI_UPDATED_EVENT);
@ -501,3 +511,52 @@ function* clickTimelineRewindButton(panel) {
yield onUiUpdated;
yield waitForAllAnimationTargets(panel);
}
/**
* Select a rate inside the playback rate selector in the timeline toolbar and
* wait for animations to update.
* @param {AnimationsPanel} panel
* @param {Number} rate The new rate value to be selected
*/
function* changeTimelinePlaybackRate(panel, rate) {
let onUiUpdated = panel.once(panel.UI_UPDATED_EVENT);
let select = panel.rateSelectorEl.firstChild;
let win = select.ownerDocument.defaultView;
// Get the right option.
let option = [...select.options].filter(o => o.value === rate + "")[0];
if (!option) {
ok(false,
"Could not find an option for rate " + rate + " in the rate selector. " +
"Values are: " + [...select.options].map(o => o.value));
return;
}
// Simulate the right events to select the option in the drop-down.
EventUtils.synthesizeMouseAtCenter(select, {type: "mousedown"}, win);
EventUtils.synthesizeMouseAtCenter(option, {type: "mouseup"}, win);
yield onUiUpdated;
yield waitForAllAnimationTargets(panel);
// Simulate a mousemove outside of the rate selector area to avoid subsequent
// tests from failing because of unwanted mouseover events.
EventUtils.synthesizeMouseAtCenter(win.document.querySelector("#timeline-toolbar"),
{type: "mousemove"}, win);
}
/**
* Prevent the toolbox common highlighter from making backend requests.
* @param {Toolbox} toolbox
*/
function disableHighlighter(toolbox) {
toolbox._highlighter = {
showBoxModel: () => new Promise(r => r()),
hideBoxModel: () => new Promise(r => r()),
pick: () => new Promise(r => r()),
cancelPick: () => new Promise(r => r()),
destroy: () => {},
traits: {}
};
}

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

@ -23,7 +23,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
loader.lazyRequireGetter(this, "DebuggerServer", "devtools/server/main", true);
loader.lazyRequireGetter(this, "DebuggerClient", "devtools/shared/client/main", true);
const DefaultTools = require("devtools/client/definitions").defaultTools;
const {defaultTools: DefaultTools, defaultThemes: DefaultThemes} =
require("devtools/client/definitions");
const EventEmitter = require("devtools/shared/event-emitter");
const Telemetry = require("devtools/client/shared/telemetry");
const {JsonView} = require("devtools/client/jsonview/main");
@ -286,10 +287,17 @@ DevTools.prototype = {
let currTheme = Services.prefs.getCharPref("devtools.theme");
// Change the current theme if it's being dynamically removed together
// with the owner (bootstrapped) extension.
// But, do not change it if the application is just shutting down.
if (!Services.startup.shuttingDown && theme.id == currTheme) {
// Note that we can't check if `theme` is an item
// of `DefaultThemes` as we end up reloading definitions
// module and end up with different theme objects
let isCoreTheme = DefaultThemes.some(t => t.id === themeId);
// Reset the theme if an extension theme that's currently applied
// is being removed.
// Ignore shutdown since addons get disabled during that time.
if (!Services.startup.shuttingDown &&
!isCoreTheme &&
theme.id == currTheme) {
Services.prefs.setCharPref("devtools.theme", "light");
let data = {

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

@ -150,8 +150,9 @@ devtools.jar:
content/aboutdebugging/aboutdebugging.js (aboutdebugging/aboutdebugging.js)
% skin devtools classic/1.0 %skin/
* skin/themes/common.css (themes/common.css)
* skin/themes/dark-theme.css (themes/dark-theme.css)
* skin/themes/light-theme.css (themes/light-theme.css)
skin/themes/dark-theme.css (themes/dark-theme.css)
skin/themes/light-theme.css (themes/light-theme.css)
skin/themes/toolbars.css (themes/toolbars.css)
skin/themes/variables.css (themes/variables.css)
skin/themes/images/add.svg (themes/images/add.svg)
skin/themes/images/filters.svg (themes/images/filters.svg)

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

@ -85,6 +85,7 @@ skip-if = os == 'linux' # bug 1186322
[browser_perf-overview-selection-03.js]
[browser_perf-overview-time-interval.js]
[browser_perf-private-browsing.js]
skip-if = os == 'linux' # bug 1210140
[browser_perf-states.js]
skip-if = debug # bug 1203888
[browser_perf-refresh.js]

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

@ -134,3 +134,4 @@ skip-if = buildapp == 'mulet' || e10s # The developertoolbar error count isn't c
[browser_treeWidget_keyboard_interaction.js]
[browser_treeWidget_mouse_interaction.js]
[browser_devices.js]
[browser_theme_switching.js]

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

@ -0,0 +1,32 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
var toolbox;
add_task(function*() {
let target = TargetFactory.forTab(gBrowser.selectedTab);
let toolbox = yield gDevTools.showToolbox(target);
let root = toolbox.frame.contentDocument.documentElement;
let platform = root.getAttribute("platform");
let expectedPlatform = getPlatform();
is(platform, expectedPlatform, ":root[platform] is correct");
let theme = Services.prefs.getCharPref("devtools.theme");
let className = "theme-" + theme;
ok(root.classList.contains(className), ":root has " + className + " class (current theme)");
yield toolbox.destroy();
});
function getPlatform() {
let {OS} = Services.appinfo;
if (OS == "WINNT") {
return "win";
} else if (OS == "Darwin") {
return "mac";
} else {
return "linux";
}
}

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

@ -107,6 +107,17 @@
const {require} = Components.utils.import("resource://devtools/shared/Loader.jsm", {});
const StylesheetUtils = require("sdk/stylesheet/utils");
let os;
let platform = navigator.platform;
if (platform.startsWith("Win")) {
os = "win";
} else if (platform.startsWith("Mac")) {
os = "mac";
} else {
os = "linux";
}
documentElement.setAttribute("platform", os);
if (documentElement.hasAttribute("force-theme")) {
switchTheme(documentElement.getAttribute("force-theme"));
} else {

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

@ -161,6 +161,13 @@ body {
}
}
#timeline-rate select {
-moz-appearance: none;
text-align: center;
color: inherit;
font-family: inherit;
}
/* Animation timeline component */
.animation-timeline {

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

@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@import url(variables.css);
@import url(toolbars.css);
body {
margin: 0;
@ -374,6 +375,3 @@ div.CodeMirror span.eval-text {
background-color: #0f171f;
color: var(--theme-body-color);
}
%include toolbars.inc.css

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

@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@import url(variables.css);
@import url(toolbars.css);
body {
margin: 0;
@ -372,6 +373,3 @@ div.CodeMirror span.eval-text {
box-shadow: 0 0 4px rgba(128, 128, 128, .5);
background-color: var(--theme-sidebar-background);
}
%include toolbars.inc.css

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

@ -87,7 +87,7 @@ html, body, #app, #memory-tool {
* TODO bug 1213100
* Once we figure out how to store invertable buttons (pseudo element like in
* this case?) we should add a .invertable class to handle this generally,
* rather than the definitions in toolbars.inc.css.
* rather than the definitions in toolbars.css.
*
* @see bug 1173397 for another inverted related bug
*/

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

@ -1,8 +1,7 @@
%if 0
/* vim:set ts=2 sw=2 sts=2 et: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
%endif
/* CSS Variables specific to the devtools toolbar that aren't defined by the themes */
.theme-light {
@ -332,15 +331,16 @@
-moz-appearance: none;
margin: 1px 3px;
border: 1px solid;
%ifdef XP_MACOSX
border-radius: 20px;
%else
border-radius: 2px;
%endif
padding: 4px 6px;
border-color: var(--theme-splitter-color);
}
:root[platform="mac"] .devtools-textinput,
:root[platform="mac"] .devtools-searchinput {
border-radius: 20px;
}
.devtools-searchinput {
padding: 0;
-moz-padding-start: 22px;
@ -401,7 +401,6 @@
.devtools-rule-searchbox {
-moz-box-flex: 1;
padding-right: 23px;
width: 100%;
font: inherit;
}
@ -409,6 +408,7 @@
.devtools-rule-searchbox[filled] {
background-color: var(--searchbox-background-color);
border-color: var(--searchbox-border-color);
padding-right: 23px;
}
.devtools-style-searchbox-no-match {

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

@ -228,8 +228,8 @@ Object.defineProperty(ASPp, "b2gBinary", {
file = this.addon.getResourceURI().QueryInterface(Ci.nsIFileURL).file;
file.append("firefox");
let binaries = {
win32: "firefox-bin.exe",
mac64: "B2G.app/Contents/MacOS/firefox-bin",
win32: "firefox.exe",
mac64: "FirefoxNightly.app/Contents/MacOS/firefox-bin",
linux32: "firefox-bin",
linux64: "firefox-bin",
};

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

@ -410,7 +410,7 @@ var AnimationPlayerActor = ActorClass({
* Set the current time of the animation player.
*/
setCurrentTime: method(function(currentTime) {
this.player.currentTime = currentTime;
this.player.currentTime = currentTime * this.player.playbackRate;
}, {
request: {
currentTime: Arg(0, "number")
@ -849,6 +849,23 @@ var AnimationsActor = exports.AnimationsActor = ActorClass({
shouldPause: Arg(2, "boolean")
},
response: {}
}),
/**
* Set the playback rate of several animations at the same time.
* @param {Array} players A list of AnimationPlayerActor.
* @param {Number} rate The new rate.
*/
setPlaybackRates: method(function(players, rate) {
for (let player of players) {
player.setPlaybackRate(rate);
}
}, {
request: {
players: Arg(0, "array:animationplayer"),
rate: Arg(1, "number")
},
response: {}
})
});

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

@ -230,6 +230,12 @@ function WebappsActor(aConnection) {
WebappsActor.prototype = {
actorPrefix: "webapps",
// For now, launch and close requests are only supported on B2G products
// like devices, mulet/simulators, graphene and b2gdroid.
// We set that attribute on the prototype in order to allow test
// to enable this feature.
supportsLaunch: require("devtools/shared/system").constants.MOZ_B2G,
disconnect: function () {
try {
this.unwatchApps();
@ -873,9 +879,7 @@ WebappsActor.prototype = {
let deferred = promise.defer();
if (Services.appinfo.ID &&
Services.appinfo.ID != "{3c2e2abc-06d4-11e1-ac3b-374f68613e61}" &&
Services.appinfo.ID != "{d1bfe7d9-c01e-4237-998b-7b5f960a4314}") {
if (!this.supportsLaunch) {
return { error: "notSupported",
message: "Not B2G. Can't launch app." };
}

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

@ -4,7 +4,8 @@
"use strict";
// Check that a player's playbackRate can be changed.
// Check that a player's playbackRate can be changed, and that multiple players
// can have their rates changed at the same time.
add_task(function*() {
let {client, walker, animations} =
@ -32,6 +33,19 @@ add_task(function*() {
state = yield player.getCurrentState();
is(state.playbackRate, 1, "The playbackRate was changed back");
info("Retrieve several animation players and set their rates");
node = yield walker.querySelector(walker.rootNode, "body");
let players = yield animations.getAnimationPlayersForNode(node);
info("Change all animations in <body> to .5 rate");
yield animations.setPlaybackRates(players, .5);
info("Query their states and check they are correct");
for (let player of players) {
let state = yield player.getCurrentState();
is(state.playbackRate, .5, "The playbackRate was updated");
}
yield closeDebuggerClient(client);
gBrowser.removeCurrentTab();
});

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

@ -90,6 +90,10 @@ function setup() {
WebappOSUtils.getPackagePath = function(aApp) {
return aApp.basePath + "/" + aApp.id;
}
// Enable launch/close method of the webapps actor
let {WebappsActor} = require("devtools/server/actors/webapps");
WebappsActor.prototype.supportsLaunch = true;
}
function do_get_webappsdir() {

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

@ -1318,7 +1318,7 @@ BluetoothAdapter::HandlePullVCardListingReq(const BluetoothValue& aValue)
} else if (name.EqualsLiteral("searchKey")) {
init.mSearchKey = static_cast<vCardSearchKeyType>(value.get_uint32_t());
} else if (name.EqualsLiteral("searchText")) {
init.mSearchValue = value.get_nsString();
init.mSearchValue = NS_ConvertUTF8toUTF16(value.get_nsCString());
} else if (name.EqualsLiteral("maxListCount")) {
init.mMaxListCount = value.get_uint32_t();
} else if (name.EqualsLiteral("listStartOffset")) {

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

@ -44,22 +44,6 @@ function testAddContact(aIcc, aType, aMozContact, aPin2) {
// We only support SIM in emulator, so we don't have anr and email field.
ok(aResult.tel.length == 1);
ok(!aResult.email);
// Get ICC contact for checking new contact
return aIcc.readContacts(aType)
.then((aResult) => {
let contact = aResult[aResult.length - 1];
is(contact.name[0], aMozContact.name[0]);
// Maximum digits of the Dialling Number is 20, and maximum digits of Extension is 20.
is(contact.tel[0].value, aMozContact.tel[0].value.substring(0, 40));
is(contact.id.substring(0, aIcc.iccInfo.iccid.length), aIcc.iccInfo.iccid);
return contact.id;
})
.then((aContactId) => {
// Clean up contact
return removeContact(aIcc, aContactId, aType, aPin2);
});
}, (aError) => {
if (aType === "fdn" && aPin2 === undefined) {
ok(aError.name === "SimPin2",
@ -67,31 +51,61 @@ function testAddContact(aIcc, aType, aMozContact, aPin2) {
} else {
ok(false, "Cannot add " + aType + " contact: " + aError.name);
}
})
});
}
function removeContact(aIcc, aContactId, aType, aPin2) {
log("removeContact: contactId=" + aContactId +
", type=" + aType + ", pin2=" + aPin2);
function removeContacts(aIcc, aContacts, aType, aPin2) {
log("removeContacts: type=" + aType + ", pin2=" + aPin2);
let promise = Promise.resolve();
let contact = new mozContact({});
contact.id = aContactId;
// Clean up contacts
for (let i = 0; i < aContacts.length ; i++) {
let contact = new mozContact({});
contact.id = aContacts[i].id;
promise = promise.then(() => aIcc.updateContact(aType, contact, aPin2));
}
return promise;
}
return aIcc.updateContact(aType, contact, aPin2);
function testAddContacts(aIcc, aType, aPin2) {
let promise = Promise.resolve();
for (let i = 0; i < TEST_ADD_DATA.length; i++) {
let test_data = TEST_ADD_DATA[i];
promise = promise.then(() => testAddContact(aIcc, aType, test_data, aPin2));
}
// Get ICC contact for checking new contacts
promise = promise.then(() => aIcc.readContacts(aType))
.then((aResult) => {
aResult = aResult.slice(aResult.length - TEST_ADD_DATA.length);
for (let i = 0; i < aResult.length ; i++) {
let contact = aResult[i];
let expectedResult = TEST_ADD_DATA[i];
is(contact.name[0], expectedResult.name[0]);
// Maximum digits of the Dialling Number is 20, and maximum digits of Extension is 20.
is(contact.tel[0].value, expectedResult.tel[0].value.substring(0, 40));
is(contact.id.substring(0, aIcc.iccInfo.iccid.length), aIcc.iccInfo.iccid);
}
return removeContacts(aIcc, aResult, aType, aPin2);
});
return promise;
}
// Start tests
startTestCommon(function() {
let icc = getMozIcc();
let promise = Promise.resolve();
for (let i = 0; i < TEST_ADD_DATA.length; i++) {
let test_data = TEST_ADD_DATA[i];
return Promise.resolve()
// Test add adn contacts
promise = promise.then(() => testAddContact(icc, "adn", test_data))
// Test add fdn contacts
.then(() => testAddContact(icc, "fdn", test_data, "0000"))
// Test add fdn contacts without passing pin2
.then(() => testAddContact(icc, "fdn", test_data));
}
return promise;
.then(() => testAddContacts(icc, "adn"))
// Test add fdn contacts
.then(() => testAddContacts(icc, "fdn", "0000"))
// Test one fdn contact without passing pin2
.then(() => testAddContact(icc, "fdn", TEST_ADD_DATA[0]));
});

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

@ -52,36 +52,65 @@ function testUpdateContact(aIcc, aType, aContactId, aMozContact, aExpect, aPin2)
return aIcc.updateContact(aType, contact, aPin2)
.then((aResult) => {
// Get ICC contact for checking expect contact
return aIcc.readContacts(aType)
.then((aResult) => {
let contact = aResult[aContactId - 1];
is(contact.name[0], aMozContact.name[0]);
if (aExpect.number == null) {
is(contact.tel, null);
} else {
is(contact.tel[0].value, aExpect.number);
}
is(contact.id, aIcc.iccInfo.iccid + aContactId);
});
}, (aError) => {
if (aType === "fdn" && aPin2 === undefined) {
ok(aError.name === "SimPin2",
"expected error when pin2 is not provided");
} else {
ok(false, "Cannot update " + aType + " contact: " + aError.name);
}
});
if (aExpect.number === null) {
is(aResult.tel, null);
} else {
is(aResult.tel[0].value, aExpect.number);
ok(aResult.tel.length == 1);
}
// We only support SIM in emulator, so we don't have anr and email field.
ok(!aResult.email);
is(contact.id, aIcc.iccInfo.iccid + aContactId);
}, (aError) => {
if (aType === "fdn" && aPin2 === undefined) {
ok(aError.name === "SimPin2",
"expected error when pin2 is not provided");
} else {
ok(false, "Cannot update " + aType + " contact: " + aError.name);
}
});
}
function revertContact(aIcc, aContact, aType, aPin2) {
log("revertContact: contact:" + JSON.stringify(aContact) +
", type=" + aType + ", pin2=" + aPin2);
function revertContacts(aIcc, aContacts, aType, aPin2) {
log("revertContacts type=" + aType + ", pin2=" + aPin2);
let promise = Promise.resolve();
return aIcc.updateContact(aType, aContact, aPin2);
for (let i = 0; i < aContacts.length; i++) {
let aContact = aContacts[i];
promise = promise.then(() => aIcc.updateContact(aType, aContact, aPin2));
}
return promise;
}
function testUpdateContacts(aIcc, aType, aCacheContacts, aPin2) {
let promise = Promise.resolve();
for (let i = 0; i < TEST_UPDATE_DATA.length; i++) {
let test_data = TEST_UPDATE_DATA[i];
promise = promise.then(() => testUpdateContact(aIcc, aType, test_data.id,
test_data.data, test_data.expect,
aPin2));
}
// Get ICC contact for checking expect contacts
promise = promise.then(() => aIcc.readContacts(aType))
.then((aResult) => {
for (let i = 0; i < TEST_UPDATE_DATA.length; i++) {
let expectedResult = TEST_UPDATE_DATA[i];
let contact = aResult[expectedResult.id - 1];
is(contact.name[0], expectedResult.data.name[0]);
is(contact.id, aIcc.iccInfo.iccid + expectedResult.id);
if (expectedResult.expect.number === null) {
is(contact.tel, null);
} else {
is(contact.tel[0].value, expectedResult.expect.number);
}
}
return revertContacts(aIcc, aCacheContacts, aType, aPin2);
});
return promise;
}
// Start tests
@ -98,25 +127,12 @@ startTestCommon(function() {
.then((aResult) => {
fdnContacts = aResult;
})
.then(() => {
let promise = Promise.resolve();
for (let i = 0; i < TEST_UPDATE_DATA.length; i++) {
let test_data = TEST_UPDATE_DATA[i];
let adnContact = adnContacts[test_data.id - 1];
let fdnContact = fdnContacts[test_data.id - 1];
// Test update adn contacts
promise = promise.then(() => testUpdateContact(icc, "adn", test_data.id,
test_data.data, test_data.expect))
// Test update fdn contacts
.then(() => testUpdateContact(icc, "fdn", test_data.id, test_data.data,
test_data.expect))
// Test update fdn contacts without passing pin2
.then(() => testUpdateContact(icc, "fdn", test_data.id, test_data.data,
test_data.expect, "0000"))
.then(() => revertContact(icc, adnContact, "adn"))
.then(() => revertContact(icc, fdnContact, "fdn", "0000"));
}
return promise;
});
// Test update adn contacts
.then(() => testUpdateContacts(icc, "adn", adnContacts))
// Test update fdn contacts
.then(() => testUpdateContacts(icc, "fdn", fdnContacts, "0000"))
// Test one fdn contact without passing pin2
.then(() => testUpdateContact(icc, "fdn", TEST_UPDATE_DATA[0].id,
TEST_UPDATE_DATA[0].data,
TEST_UPDATE_DATA[0].expect));
});

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

@ -771,14 +771,21 @@ var Modem = Modems[0];
.then(() => {
ok(outCall instanceof TelephonyCall, "check instance");
is(outCall.id.number, number);
is(outCall.state, "dialing");
is(outCall.serviceId, serviceId);
})
.then(() => {
// A CDMA call goes to connected state directly when the operator find
// its callee, which makes the "connected" state in CDMA calls behaves
// like the "alerting" state in GSM calls.
let state = Modems[serviceId].isGSM() ? "alerting" : "connected";
// Sometimes the dialing state is missing, see Bug 1220548.
if (outCall.state === state) {
log("got " + state + " state, dialing is missing");
return;
}
is(outCall.state, "dialing", "check state");
return waitForNamedStateEvent(outCall, state);
});
}
@ -801,13 +808,20 @@ var Modem = Modems[0];
ok(outCall instanceof TelephonyCall, "check instance");
ok(outCall);
is(outCall.id.number, number);
is(outCall.state, "dialing");
})
.then(() => {
// Similar to function |dial|, a CDMA call directly goes to connected
// state when the operator find its callee.
let state = Modems[outCall.serviceId].isGSM() ? "alerting"
: "connected";
// Sometimes the dialing state is missing, see Bug 1220548.
if (outCall.state === state) {
log("got " + state + " state, dialing is missing");
return;
}
is(outCall.state, "dialing", "check state");
return waitForNamedStateEvent(outCall, state);
})
.then(() => {
@ -835,6 +849,13 @@ var Modem = Modems[0];
ok(call instanceof TelephonyCall, "check instance");
is(call.id.number, number, "check number");
// Sometimes the dialing state is missing, see Bug 1220548.
if (call.state === "alerting") {
log("got alerting state, dialing is missing");
return;
}
is(call.state, "dialing", "check call state");
return waitForNamedStateEvent(call, "alerting");

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

@ -815,7 +815,7 @@ public class BrowserSearch extends HomeFragment
mSearchTerm = searchTerm;
mAutocompleteHandler = handler;
if (isVisible()) {
if (mAdapter != null) {
if (isNewFilter) {
// The adapter depends on the search term to determine its number
// of items. Make it we notify the view about it.

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

@ -101,11 +101,8 @@
<!ENTITY settings "Settings">
<!ENTITY settings_title "Settings">
<!ENTITY pref_category_input_options "Input options">
<!ENTITY pref_category_advanced "Advanced">
<!ENTITY pref_category_customize "Customize">
<!ENTITY pref_category_customize_summary "Home, search, tabs, import">
<!ENTITY pref_category_customize_alt_summary "Home, search, tabs, open later, import">
<!ENTITY pref_category_general "General">
<!ENTITY pref_category_general_summary "Home, language, zoom, full-screen browsing">
<!-- Localization note (pref_category_language) : This is the preferences
section in which the user picks the locale in which to display Firefox
@ -153,8 +150,8 @@
<!ENTITY pref_category_search3 "Search">
<!ENTITY pref_category_search_summary "Customize your search providers">
<!ENTITY pref_category_display "Display">
<!ENTITY pref_category_display_summary "Text, title bar, full-screen browsing">
<!ENTITY pref_category_accessibility "Accessibility">
<!ENTITY pref_category_accessibility_summary "Text size, voice input">
<!ENTITY pref_category_privacy_short "Privacy">
<!ENTITY pref_category_privacy_summary2 "Control logins, cookies, tracking, data">
<!ENTITY pref_category_vendor "&vendorShortName;">
@ -172,12 +169,12 @@
The &formatI; in the string will be replaced by a small image of the icon described, and can be moved to wherever
it is applicable. -->
<!ENTITY pref_search_hint "TIP: Add any website to your list of search providers by long-pressing on its search field and then tapping the &formatI; icon.">
<!ENTITY pref_category_devtools "Developer tools">
<!ENTITY pref_category_advanced "Advanced">
<!ENTITY pref_category_advanced_summary "Import, plugins, developer tools">
<!ENTITY pref_developer_remotedebugging "Remote debugging">
<!ENTITY pref_developer_remotedebugging_usb "Remote debugging via USB">
<!ENTITY pref_developer_remotedebugging_wifi "Remote debugging via Wi-Fi">
<!ENTITY pref_developer_remotedebugging_wifi_disabled_summary "Wi-Fi debugging requires your device to have a QR code reader app installed.">
<!ENTITY pref_category_logins "Logins">
<!ENTITY pref_remember_signons2 "Remember logins">
<!ENTITY pref_open_external_urls_privately_title "Open links in Private browsing">
<!ENTITY pref_open_external_urls_privately_summary "For all external links opened in &brandShortName;">
@ -203,13 +200,13 @@
<!ENTITY home_homepage_use_current_tab "Use current tab">
<!-- Localization note: These are shown in the left sidebar on tablets -->
<!ENTITY pref_header_customize "Customize">
<!ENTITY pref_header_display "Display">
<!ENTITY pref_header_general "General">
<!ENTITY pref_header_search "Search">
<!ENTITY pref_header_privacy_short "Privacy">
<!ENTITY pref_header_accessibility "Accessibility">
<!ENTITY pref_header_advanced "Advanced">
<!ENTITY pref_header_help "Help">
<!ENTITY pref_header_language "Language">
<!ENTITY pref_header_vendor "&vendorShortName;">
<!ENTITY pref_header_devtools "Developer tools">
<!ENTITY pref_cookies_menu "Cookies">
<!ENTITY pref_cookies_accept_all "Enabled">
@ -253,8 +250,7 @@
<!ENTITY pref_char_encoding "Character encoding">
<!ENTITY pref_char_encoding_on "Show menu">
<!ENTITY pref_char_encoding_off "Don\'t show menu">
<!ENTITY pref_clear_private_data2 "Clear now">
<!ENTITY pref_clear_private_data_category "Clear private data">
<!ENTITY pref_clear_private_data_now "Clear private data now">
<!ENTITY pref_clear_on_exit_title2 "Clear on exit">
<!ENTITY pref_clear_on_exit_summary2 "&brandShortName; will automatically clear your data whenever you select \u0022Quit\u0022 from the main menu">
<!ENTITY pref_clear_on_exit_dialog_title "Select which data to clear">

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

@ -85,17 +85,13 @@ public class GeckoPreferenceFragment extends PreferenceFragment {
* Return the title to use for this preference fragment. This allows
* for us to redisplay this fragment in a different locale.
*
* We only return titles for the preference screens that are in the
* flow for selecting a locale, and thus might need to be redisplayed.
* We only return titles for the preference screens that are
* launched directly, and thus might need to be redisplayed.
*
* This method sets the title that you see on non-multi-pane devices.
*/
private String getTitle() {
final int res = getResource();
if (res == R.xml.preferences_locale) {
return getString(R.string.pref_category_language);
}
if (res == R.xml.preferences) {
return getString(R.string.settings_title);
}
@ -191,7 +187,7 @@ public class GeckoPreferenceFragment extends PreferenceFragment {
boolean isMultiPane = Versions.feature11Plus &&
((PreferenceActivity) activity).isMultiPane();
resid = isMultiPane ? R.xml.preferences_customize_tablet : R.xml.preferences;
resid = isMultiPane ? R.xml.preferences_general_tablet : R.xml.preferences;
}
return resid;

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

@ -78,7 +78,6 @@ import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.Toast;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@ -126,15 +125,14 @@ OnSharedPreferenceChangeListener
private static final String PREFS_HEALTHREPORT_LINK = NON_PREF_PREFIX + "healthreport.link";
private static final String PREFS_DEVTOOLS_REMOTE_USB_ENABLED = "devtools.remote.usb.enabled";
private static final String PREFS_DEVTOOLS_REMOTE_WIFI_ENABLED = "devtools.remote.wifi.enabled";
private static final String PREFS_DISPLAY_TITLEBAR_MODE = "browser.chrome.titlebarMode";
private static final String PREFS_SYNC = NON_PREF_PREFIX + "sync";
private static final String PREFS_TRACKING_PROTECTION = "privacy.trackingprotection.state";
private static final String PREFS_TRACKING_PROTECTION_PB = "privacy.trackingprotection.pbmode.enabled";
public static final String PREFS_OPEN_URLS_IN_PRIVATE = NON_PREF_PREFIX + "openExternalURLsPrivately";
public static final String PREFS_VOICE_INPUT_ENABLED = NON_PREF_PREFIX + "voice_input_enabled";
public static final String PREFS_QRCODE_ENABLED = NON_PREF_PREFIX + "qrcode_enabled";
private static final String PREFS_DEVTOOLS = NON_PREF_PREFIX + "devtools.enabled";
private static final String PREFS_DISPLAY = NON_PREF_PREFIX + "display.enabled";
private static final String PREFS_ADVANCED = NON_PREF_PREFIX + "advanced.enabled";
private static final String PREFS_ACCESSIBILITY = NON_PREF_PREFIX + "accessibility.enabled";
private static final String PREFS_CUSTOMIZE_HOME = NON_PREF_PREFIX + "customize_home";
private static final String PREFS_CUSTOMIZE_IMAGE_BLOCKING = "browser.image_blocking.enabled";
private static final String PREFS_TRACKING_PROTECTION_PRIVATE_BROWSING = "privacy.trackingprotection.pbmode.enabled";
@ -154,7 +152,6 @@ OnSharedPreferenceChangeListener
public static final String PREFS_RESTORE_SESSION = NON_PREF_PREFIX + "restoreSession3";
public static final String PREFS_SUGGESTED_SITES = NON_PREF_PREFIX + "home_suggested_sites";
public static final String PREFS_TAB_QUEUE = NON_PREF_PREFIX + "tab_queue";
public static final String PREFS_CUSTOMIZE_SCREEN = NON_PREF_PREFIX + "customize_screen";
public static final String PREFS_TAB_QUEUE_LAST_SITE = NON_PREF_PREFIX + "last_site";
public static final String PREFS_TAB_QUEUE_LAST_TIME = NON_PREF_PREFIX + "last_time";
@ -247,8 +244,8 @@ OnSharedPreferenceChangeListener
title = R.string.pref_category_language;
} else if (res == R.xml.preferences_vendor) {
title = R.string.pref_category_vendor;
} else if (res == R.xml.preferences_customize) {
title = R.string.pref_category_customize;
} else if (res == R.xml.preferences_general) {
title = R.string.pref_category_general;
} else if (res == R.xml.preferences_search) {
title = R.string.pref_category_search;
}
@ -289,8 +286,8 @@ OnSharedPreferenceChangeListener
updateActionBarTitle(R.string.settings_title);
}
updateTitle(R.string.pref_header_language);
updateBreadcrumbTitle(R.string.pref_header_language);
// Update the title to for the preference pane that we're currently showing.
updateTitle(R.string.pref_header_general);
// Don't finish the activity -- we just reloaded all of the
// individual parts! -- but when it returns, make sure that the
@ -344,7 +341,7 @@ OnSharedPreferenceChangeListener
// This is the default header, because it's the first one.
// I know, this is an affront to all human decency. And yet.
updateTitle(getString(R.string.pref_header_customize));
updateTitle(getString(R.string.pref_header_general));
}
if (onIsMultiPane()) {
@ -472,7 +469,7 @@ OnSharedPreferenceChangeListener
if (!onIsMultiPane()) {
fragmentArgs.putString(INTENT_EXTRA_RESOURCES, "preferences");
} else {
fragmentArgs.putString(INTENT_EXTRA_RESOURCES, "preferences_customize_tablet");
fragmentArgs.putString(INTENT_EXTRA_RESOURCES, "preferences_general_tablet");
}
}
@ -496,14 +493,9 @@ OnSharedPreferenceChangeListener
while (iterator.hasNext()) {
Header header = iterator.next();
if (header.id == R.id.pref_header_language && !localeSwitchingIsEnabled) {
// If locale switching is disabled, remove the section
// entirely. This logic will need to be extended when
// content language selection (Bug 881510) is implemented.
if (header.id == R.id.pref_header_advanced && !RestrictedProfiles.isAllowed(this, Restriction.DISALLOW_DEVELOPER_TOOLS)) {
iterator.remove();
} else if (header.id == R.id.pref_header_devtools && !RestrictedProfiles.isAllowed(this, Restriction.DISALLOW_DEVELOPER_TOOLS)) {
iterator.remove();
} else if (header.id == R.id.pref_header_display && !RestrictedProfiles.isAllowed(this, Restriction.DISALLOW_DISPLAY_SETTINGS)) {
} else if (header.id == R.id.pref_header_accessibility && !RestrictedProfiles.isAllowed(this, Restriction.DISALLOW_DISPLAY_SETTINGS)) {
iterator.remove();
}
}
@ -703,24 +695,13 @@ OnSharedPreferenceChangeListener
} else if (pref instanceof PanelsPreferenceCategory) {
mPanelsPreferenceCategory = (PanelsPreferenceCategory) pref;
}
if(TabQueueHelper.TAB_QUEUE_ENABLED && PREFS_CUSTOMIZE_SCREEN.equals(key)) {
pref.setSummary(getString(R.string.pref_category_customize_alt_summary));
}
if (getResources().getString(R.string.pref_category_input_options).equals(key)) {
if (!InputOptionsUtils.supportsVoiceRecognizer(getApplicationContext(), getResources().getString(R.string.voicesearch_prompt)) &&
!InputOptionsUtils.supportsQrCodeReader(getApplicationContext())) {
preferences.removePreference(pref);
i--;
continue;
}
}
if (PREFS_DEVTOOLS.equals(key) &&
if (PREFS_ADVANCED.equals(key) &&
!RestrictedProfiles.isAllowed(this, Restriction.DISALLOW_DEVELOPER_TOOLS)) {
preferences.removePreference(pref);
i--;
continue;
}
if (PREFS_DISPLAY.equals(key) && !RestrictedProfiles.isAllowed(this, Restriction.DISALLOW_DISPLAY_SETTINGS)) {
if (PREFS_ACCESSIBILITY.equals(key) && !RestrictedProfiles.isAllowed(this, Restriction.DISALLOW_DISPLAY_SETTINGS)) {
preferences.removePreference(pref);
i--;
continue;
@ -854,13 +835,6 @@ OnSharedPreferenceChangeListener
return true;
}
});
} else if (PREFS_DISPLAY_TITLEBAR_MODE.equals(key)) {
if (HardwareUtils.isTablet()) {
// New tablet always shows URLS, not titles.
preferences.removePreference(pref);
i--;
continue;
}
} else if (handlers.containsKey(key)) {
PrefHandler handler = handlers.get(key);
if (!handler.setupPref(this, pref)) {

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

@ -154,7 +154,4 @@
<color name="private_active_text">#FFFFFF</color>
<!-- This color is from a 2.3 Samsung device. -->
<color name="gingerbread_menu_background_color">#1b1b1b</color>
</resources>

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

@ -13,9 +13,12 @@
<item name="windowNoTitle">true</item>
<item name="android:windowContentOverlay">@null</item>
<!-- AppCompat sets this to transparent by default:
http://stackoverflow.com/a/31777488 -->
<item name="android:panelBackground">@color/gingerbread_menu_background_color</item>
<!-- Gingerbread "More" menu background color; AppCompat sets this to
transparent by default: http://stackoverflow.com/a/31777488.
This color is set anecdotally to make all text colors, which change
by device, visible. Standard colors are #8D8D8D & #C8C8C8 (disabled)
and #000000 has also been seen. -->
<item name="android:panelBackground">@color/text_and_tabs_tray_grey</item>
</style>
<style name="GeckoDialogBase" parent="@android:style/Theme.Dialog">

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

@ -3,23 +3,23 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!-- Tablet only: Sync is nested within the "Customize" header on tablets,
<!-- Tablet only: Sync is nested within the "General" header on tablets,
instead of being a top-level menu item.
See xml-v11/preferences.xml for single-pane v11+ phone layout. -->
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
<header android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
android:title="@string/pref_header_customize">
android:title="@string/pref_header_general">
<extra android:name="resource"
android:value="preferences_customize_tablet"/>
android:value="preferences_general_tablet"/>
</header>
<header android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
android:title="@string/pref_header_display"
android:id="@+id/pref_header_display">
android:title="@string/pref_header_search"
android:id="@+id/pref_header_search">
<extra android:name="resource"
android:value="preferences_display"/>
android:value="preferences_search"/>
</header>
<header android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
@ -29,10 +29,17 @@
</header>
<header android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
android:title="@string/pref_header_language"
android:id="@+id/pref_header_language">
android:title="@string/pref_header_accessibility"
android:id="@+id/pref_header_accessibility">
<extra android:name="resource"
android:value="preferences_locale" />
android:value="preferences_accessibility"/>
</header>
<header android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
android:title="@string/pref_header_advanced"
android:id="@+id/pref_header_advanced">
<extra android:name="resource"
android:value="preferences_advanced"/>
</header>
<header android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
@ -41,11 +48,4 @@
android:value="preferences_vendor"/>
</header>
<header android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
android:title="@string/pref_header_devtools"
android:id="@+id/pref_header_devtools">
<extra android:name="resource"
android:value="preferences_devtools"/>
</header>
</preference-headers>

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

@ -16,23 +16,22 @@
android:summary="@string/pref_sync_summary"
android:persistent="false" />
<PreferenceScreen android:title="@string/pref_category_customize"
android:summary="@string/pref_category_customize_summary"
android:key="android.not_a_preference.customize_screen"
<PreferenceScreen android:title="@string/pref_category_general"
android:summary="@string/pref_category_general_summary"
android:key="android.not_a_preference.general_screen"
android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
<extra android:name="resource"
android:value="preferences_customize"/>
android:value="preferences_general"/>
</PreferenceScreen>
<PreferenceScreen android:title="@string/pref_category_display"
android:summary="@string/pref_category_display_summary"
android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
android:key="android.not_a_preference.display.enabled" >
<PreferenceScreen android:title="@string/pref_category_search"
android:summary="@string/pref_category_search_summary"
android:key="android.not_a_preference.search_screen"
android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
<extra android:name="resource"
android:value="preferences_display" />
android:value="preferences_search"/>
</PreferenceScreen>
<PreferenceScreen android:title="@string/pref_category_privacy_short"
android:summary="@string/pref_category_privacy_summary"
android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
@ -40,13 +39,32 @@
android:value="preferences_privacy" />
</PreferenceScreen>
<PreferenceScreen android:title="@string/pref_category_language"
android:summary="@string/pref_category_language_summary"
android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
<PreferenceScreen android:title="@string/pref_category_accessibility"
android:summary="@string/pref_category_accessibility_summary"
android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
android:key="android.not_a_preference.accessibility.enabled" >
<extra android:name="resource"
android:value="preferences_locale" />
android:value="preferences_accessibility" />
</PreferenceScreen>
<PreferenceScreen android:title="@string/pref_category_advanced"
android:summary="@string/pref_category_advanced_summary"
android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
android:key="android.not_a_preference.advanced.enabled" >
<extra android:name="resource"
android:value="preferences_advanced"/>
</PreferenceScreen>
<org.mozilla.gecko.preferences.PrivateDataPreference
android:key="android.not_a_preference.privacy.clear"
android:title="@string/pref_clear_private_data_now"
android:persistent="true"
android:positiveButtonText="@string/button_clear_data"
gecko:entries="@array/pref_private_data_entries"
gecko:entryValues="@array/pref_private_data_values"
gecko:entryKeys="@array/pref_private_data_keys"
gecko:initialValues="@array/pref_private_data_defaults" />
<PreferenceScreen android:title="@string/pref_category_vendor"
android:summary="@string/pref_category_vendor_summary"
android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
@ -54,12 +72,4 @@
android:value="preferences_vendor"/>
</PreferenceScreen>
<PreferenceScreen android:title="@string/pref_category_devtools"
android:summary="@string/pref_developer_remotedebugging"
android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
android:key="android.not_a_preference.devtools.enabled" >
<extra android:name="resource"
android:value="preferences_devtools"/>
</PreferenceScreen>
</PreferenceScreen>

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

@ -1,68 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!-- Changes should be mirrored to preferences_customize_tablet.xml. -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gecko="http://schemas.android.com/apk/res-auto"
android:enabled="false">
<PreferenceScreen android:key="android.not_a_preference.customize_home"
android:title="@string/pref_category_home"
android:summary="@string/pref_category_home_summary"
android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
<extra android:name="resource"
android:value="preferences_home" />
</PreferenceScreen>
<PreferenceScreen android:title="@string/pref_category_search"
android:summary="@string/pref_category_search_summary"
android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
<extra android:name="resource"
android:value="preferences_search"/>
</PreferenceScreen>
<ListPreference android:key="android.not_a_preference.restoreSession3"
android:title="@string/pref_restore"
android:defaultValue="quit"
android:entries="@array/pref_restore_entries"
android:entryValues="@array/pref_restore_values"
android:persistent="true" />
<CheckBoxPreference android:key="browser.image_blocking.enabled"
android:title="@string/pref_tap_to_load_images_title"
android:summary="@string/pref_tap_to_load_images_summary2"
android:defaultValue="false"/>
<CheckBoxPreference android:key="android.not_a_preference.tab_queue"
android:title="@string/pref_tab_queue_title"
android:summary="@string/pref_tab_queue_summary"
android:defaultValue="false" />
<CheckBoxPreference android:key="android.not_a_preference.openExternalURLsPrivately"
android:title="@string/pref_open_external_urls_privately_title"
android:summary="@string/pref_open_external_urls_privately_summary"
android:defaultValue="false" />
<org.mozilla.gecko.preferences.AndroidImportPreference
android:key="android.not_a_preference.import_android"
gecko:entries="@array/pref_import_android_entries"
gecko:entryValues="@array/pref_import_android_values"
gecko:initialValues="@array/pref_import_android_defaults"
gecko:entryKeys="@array/pref_import_android_keys"
android:title="@string/pref_import_android"
android:summary="@string/pref_import_android_summary"
android:positiveButtonText="@string/bookmarkhistory_button_import"
android:negativeButtonText="@string/button_cancel"
android:persistent="false" />
<ListPreference android:key="app.update.autodownload"
android:title="@string/pref_update_autodownload"
android:entries="@array/pref_update_autodownload_entries"
android:entryValues="@array/pref_update_autodownload_values"
android:persistent="false" />
</PreferenceScreen>

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

@ -1,74 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!-- Tablet only: The contents under the "Customize" header for tablets,
See xml-v11/preferences.xml for single-pane v11+ phone layout.
Changes to preferences should be mirrored to preferences_customize.xml. -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gecko="http://schemas.android.com/apk/res-auto"
android:title="@string/pref_category_customize"
android:enabled="false">
<org.mozilla.gecko.preferences.SyncPreference android:key="android.not_a_preference.sync"
android:title="@string/pref_sync"
android:persistent="false" />
<PreferenceScreen android:key="android.not_a_preference.customize_home"
android:title="@string/pref_category_home"
android:summary="@string/pref_category_home_summary"
android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
<extra android:name="resource"
android:value="preferences_home" />
</PreferenceScreen>
<PreferenceScreen android:title="@string/pref_category_search"
android:summary="@string/pref_category_search_summary"
android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
<extra android:name="resource"
android:value="preferences_search"/>
</PreferenceScreen>
<ListPreference android:key="android.not_a_preference.restoreSession3"
android:title="@string/pref_restore"
android:defaultValue="quit"
android:entries="@array/pref_restore_entries"
android:entryValues="@array/pref_restore_values"
android:persistent="true" />
<CheckBoxPreference android:key="browser.image_blocking.enabled"
android:title="@string/pref_tap_to_load_images_title"
android:summary="@string/pref_tap_to_load_images_summary2"
android:defaultValue="false"/>
<CheckBoxPreference android:key="android.not_a_preference.tab_queue"
android:title="@string/pref_tab_queue_title"
android:summary="@string/pref_tab_queue_summary"
android:defaultValue="false" />
<CheckBoxPreference android:key="android.not_a_preference.openExternalURLsPrivately"
android:title="@string/pref_open_external_urls_privately_title"
android:summary="@string/pref_open_external_urls_privately_summary"
android:defaultValue="false" />
<org.mozilla.gecko.preferences.AndroidImportPreference
android:key="android.not_a_preference.import_android"
gecko:entries="@array/pref_import_android_entries"
gecko:entryValues="@array/pref_import_android_values"
gecko:initialValues="@array/pref_import_android_defaults"
android:title="@string/pref_import_android"
android:summary="@string/pref_import_android_summary"
android:positiveButtonText="@string/bookmarkhistory_button_import"
android:negativeButtonText="@string/button_cancel"
android:persistent="false" />
<ListPreference android:key="app.update.autodownload"
android:title="@string/pref_update_autodownload"
android:entries="@array/pref_update_autodownload_entries"
android:entryValues="@array/pref_update_autodownload_values"
android:persistent="false" />
</PreferenceScreen>

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

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!-- Changes should be mirrored to preferences_general_tablet.xml. -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gecko="http://schemas.android.com/apk/res-auto"
android:enabled="false">
<PreferenceScreen android:key="android.not_a_preference.general_home"
android:title="@string/pref_category_home"
android:summary="@string/pref_category_home_summary"
android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
<extra android:name="resource"
android:value="preferences_home" />
</PreferenceScreen>
<PreferenceScreen android:title="@string/pref_category_language"
android:summary="@string/pref_category_language_summary"
android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
<extra android:name="resource"
android:value="preferences_locale" />
</PreferenceScreen>
<ListPreference android:key="browser.chrome.titlebarMode"
android:title="@string/pref_titlebar_mode"
android:entries="@array/pref_titlebar_mode_entries"
android:entryValues="@array/pref_titlebar_mode_values"
android:persistent="false" />
<CheckBoxPreference android:key="browser.chrome.dynamictoolbar"
android:title="@string/pref_scroll_title_bar2"
android:summary="@string/pref_scroll_title_bar_summary" />
<CheckBoxPreference android:key="android.not_a_preference.tab_queue"
android:title="@string/pref_tab_queue_title"
android:summary="@string/pref_tab_queue_summary"
android:defaultValue="false" />
<CheckBoxPreference android:key="android.not_a_preference.openExternalURLsPrivately"
android:title="@string/pref_open_external_urls_privately_title"
android:summary="@string/pref_open_external_urls_privately_summary"
android:defaultValue="false" />
</PreferenceScreen>

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

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!-- Tablet only: The contents under the "General" header for tablets,
See xml-v11/preferences.xml for single-pane v11+ phone layout.
Changes to preferences should be mirrored to preferences_general.xml. -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gecko="http://schemas.android.com/apk/res-auto"
android:title="@string/pref_category_general"
android:enabled="false">
<org.mozilla.gecko.preferences.SyncPreference android:key="android.not_a_preference.sync"
android:title="@string/pref_sync"
android:persistent="false" />
<PreferenceScreen android:key="android.not_a_preference.general_home"
android:title="@string/pref_category_home"
android:summary="@string/pref_category_home_summary"
android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
<extra android:name="resource"
android:value="preferences_home" />
</PreferenceScreen>
<PreferenceScreen android:title="@string/pref_category_language"
android:summary="@string/pref_category_language_summary"
android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
<extra android:name="resource"
android:value="preferences_locale" />
</PreferenceScreen>
<CheckBoxPreference android:key="browser.chrome.dynamictoolbar"
android:title="@string/pref_scroll_title_bar2"
android:summary="@string/pref_scroll_title_bar_summary" />
<CheckBoxPreference android:key="android.not_a_preference.tab_queue"
android:title="@string/pref_tab_queue_title"
android:summary="@string/pref_tab_queue_summary"
android:defaultValue="false" />
<CheckBoxPreference android:key="android.not_a_preference.openExternalURLsPrivately"
android:title="@string/pref_open_external_urls_privately_title"
android:summary="@string/pref_open_external_urls_privately_summary"
android:defaultValue="false" />
<org.mozilla.gecko.preferences.PrivateDataPreference
android:key="android.not_a_preference.privacy.clear"
android:title="@string/pref_clear_private_data_now"
android:persistent="true"
android:positiveButtonText="@string/button_clear_data"
gecko:entries="@array/pref_private_data_entries"
gecko:entryValues="@array/pref_private_data_values"
gecko:entryKeys="@array/pref_private_data_keys"
gecko:initialValues="@array/pref_private_data_defaults" />
</PreferenceScreen>

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

@ -8,6 +8,18 @@
android:title="@string/pref_category_search"
android:enabled="false">
<PreferenceCategory android:title="@string/pref_category_add_search_providers">
<org.mozilla.gecko.preferences.ModifiableHintPreference
android:layout="@layout/preference_search_tip"
android:enabled="false"
android:selectable="false"/>
</PreferenceCategory>
<org.mozilla.gecko.preferences.SearchPreferenceCategory
android:title="@string/pref_category_installed_search_engines"/>
<CheckBoxPreference android:key="browser.search.suggest.enabled"
android:title="@string/pref_search_suggestions"
android:defaultValue="false"
@ -18,16 +30,4 @@
android:defaultValue="true"
android:persistent="true" />
<org.mozilla.gecko.preferences.SearchPreferenceCategory
android:title="@string/pref_category_installed_search_engines"/>
<PreferenceCategory android:title="@string/pref_category_add_search_providers">
<org.mozilla.gecko.preferences.ModifiableHintPreference
android:layout="@layout/preference_search_tip"
android:enabled="false"
android:selectable="false"/>
</PreferenceCategory>
</PreferenceScreen>

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

@ -8,12 +8,12 @@
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
<header android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
android:id="@+id/pref_header_language">
android:id="@+id/pref_header_search">
</header>
<header android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
android:id="@+id/pref_header_devtools">
android:id="@+id/pref_header_advanced">
</header>
<header android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
android:id="@+id/pref_header_display">
android:id="@+id/pref_header_accessibility">
</header>
</preference-headers>

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

@ -16,26 +16,27 @@
android:summary="@string/pref_sync_summary"
android:persistent="false" />
<PreferenceScreen android:title="@string/pref_category_customize"
android:summary="@string/pref_category_customize_summary"
android:key="android.not_a_preference.customize_screen">
<PreferenceScreen android:title="@string/pref_category_general"
android:summary="@string/pref_category_general_summary"
android:key="android.not_a_preference.general_screen">
<intent android:action="android.intent.action.VIEW"
android:targetPackage="@string/android_package_name"
android:targetClass="org.mozilla.gecko.preferences.GeckoPreferences" >
<extra
android:name="resource"
android:value="preferences_customize" />
android:value="preferences_general" />
</intent>
</PreferenceScreen>
<PreferenceScreen android:title="@string/pref_category_display"
android:summary="@string/pref_category_display_summary" >
<PreferenceScreen android:title="@string/pref_category_search"
android:summary="@string/pref_category_search_summary"
android:key="android.not_a_preference.search_screen">
<intent android:action="android.intent.action.VIEW"
android:targetPackage="@string/android_package_name"
android:targetClass="org.mozilla.gecko.preferences.GeckoPreferences" >
<extra
android:name="resource"
android:value="preferences_display" />
android:value="preferences_search" />
</intent>
</PreferenceScreen>
@ -50,17 +51,39 @@
</intent>
</PreferenceScreen>
<PreferenceScreen android:title="@string/pref_category_language"
android:summary="@string/pref_category_language_summary" >
<PreferenceScreen android:title="@string/pref_category_accessibility"
android:summary="@string/pref_category_accessibility_summary" >
<intent android:action="android.intent.action.VIEW"
android:targetPackage="@string/android_package_name"
android:targetClass="org.mozilla.gecko.preferences.GeckoPreferences" >
<extra
android:name="resource"
android:value="preferences_locale" />
android:name="resource"
android:value="preferences_accessibility" />
</intent>
</PreferenceScreen>
<PreferenceScreen android:title="@string/pref_category_advanced"
android:summary="@string/pref_category_advanced_summary"
android:key="android.not_a_preference.advanced.enabled" >
<intent android:action="android.intent.action.VIEW"
android:targetPackage="@string/android_package_name"
android:targetClass="org.mozilla.gecko.preferences.GeckoPreferences" >
<extra
android:name="resource"
android:value="preferences_advanced" />
</intent>
</PreferenceScreen>
<org.mozilla.gecko.preferences.PrivateDataPreference
android:key="android.not_a_preference.privacy.clear"
android:title="@string/pref_clear_private_data_now"
android:persistent="true"
android:positiveButtonText="@string/button_clear_data"
gecko:entries="@array/pref_private_data_entries"
gecko:entryValues="@array/pref_private_data_values"
gecko:entryKeys="@array/pref_private_data_keys"
gecko:initialValues="@array/pref_private_data_defaults" />
<PreferenceScreen android:title="@string/pref_category_vendor"
android:summary="@string/pref_category_vendor_summary" >
<intent android:action="android.intent.action.VIEW"
@ -71,16 +94,5 @@
android:value="preferences_vendor" />
</intent>
</PreferenceScreen>
<PreferenceScreen android:title="@string/pref_category_devtools"
android:summary="@string/pref_developer_remotedebugging"
android:key="android.not_a_preference.devtools.enabled" >
<intent android:action="android.intent.action.VIEW"
android:targetPackage="@string/android_package_name"
android:targetClass="org.mozilla.gecko.preferences.GeckoPreferences" >
<extra
android:name="resource"
android:value="preferences_devtools" />
</intent>
</PreferenceScreen>
</PreferenceScreen>

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

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/pref_category_accessibility"
android:enabled="false">
<org.mozilla.gecko.preferences.FontSizePreference
android:key="font.size.inflation.minTwips"
android:title="@string/pref_text_size"
android:positiveButtonText="@string/pref_font_size_set"
android:negativeButtonText="@string/button_cancel"
android:persistent="false" />
<CheckBoxPreference android:key="browser.ui.zoom.force-user-scalable"
android:title="@string/pref_zoom_force_enabled"
android:summary="@string/pref_zoom_force_enabled_summary" />
<CheckBoxPreference android:key="ui.zoomedview.enabled"
android:title="@string/pref_magnifying_glass_enabled"
android:summary="@string/pref_magnifying_glass_enabled_summary" />
<CheckBoxPreference android:key="android.not_a_preference.voice_input_enabled"
android:title="@string/pref_voice_input"
android:summary="@string/pref_voice_input_summary"
android:defaultValue="true"/>
<CheckBoxPreference android:key="android.not_a_preference.qrcode_enabled"
android:title="@string/pref_qrcode_enabled"
android:summary="@string/pref_qrcode_enabled_summary"
android:defaultValue="true"/>
</PreferenceScreen>

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

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gecko="http://schemas.android.com/apk/res-auto"
android:title="@string/pref_category_advanced"
android:enabled="false">
<org.mozilla.gecko.preferences.AndroidImportPreference
android:key="android.not_a_preference.import_android"
gecko:entries="@array/pref_import_android_entries"
gecko:entryValues="@array/pref_import_android_values"
gecko:initialValues="@array/pref_import_android_defaults"
android:title="@string/pref_import_android"
android:summary="@string/pref_import_android_summary"
android:positiveButtonText="@string/bookmarkhistory_button_import"
android:negativeButtonText="@string/button_cancel"
android:persistent="false" />
<ListPreference android:key="app.update.autodownload"
android:title="@string/pref_update_autodownload"
android:entries="@array/pref_update_autodownload_entries"
android:entryValues="@array/pref_update_autodownload_values"
android:persistent="false" />
<ListPreference android:key="android.not_a_preference.restoreSession3"
android:title="@string/pref_restore"
android:defaultValue="quit"
android:entries="@array/pref_restore_entries"
android:entryValues="@array/pref_restore_values"
android:persistent="true" />
<CheckBoxPreference android:key="browser.image_blocking.enabled"
android:title="@string/pref_tap_to_load_images_title"
android:summary="@string/pref_tap_to_load_images_summary2"
android:defaultValue="false"/>
<ListPreference android:key="plugin.enable"
android:title="@string/pref_plugins"
android:entries="@array/pref_plugins_entries"
android:entryValues="@array/pref_plugins_values"
android:persistent="false" />
<CheckBoxPreference android:key="media.autoplay.enabled"
android:title="@string/pref_media_autoplay_enabled"
android:summary="@string/pref_media_autoplay_enabled_summary" />
<ListPreference android:key="browser.menu.showCharacterEncoding"
android:title="@string/pref_char_encoding"
android:entries="@array/pref_char_encoding_entries"
android:entryValues="@array/pref_char_encoding_values"
android:persistent="false" />
<CheckBoxPreference android:key="devtools.remote.usb.enabled"
android:title="@string/pref_developer_remotedebugging_usb" />
<org.mozilla.gecko.preferences.AlignRightLinkPreference android:key="android.not_a_preference.remote_debugging.link"
android:title="@string/pref_learn_more"
android:persistent="false"
url="https://developer.mozilla.org/docs/Tools/Remote_Debugging/Debugging_Firefox_for_Android_with_WebIDE" />
<CheckBoxPreference android:key="devtools.remote.wifi.enabled"
android:title="@string/pref_developer_remotedebugging_wifi" />
<org.mozilla.gecko.preferences.AlignRightLinkPreference android:key="android.not_a_preference.remote_debugging.link"
android:title="@string/pref_learn_more"
android:persistent="false"
url="https://developer.mozilla.org/docs/Tools/Remote_Debugging/Debugging_Firefox_for_Android_with_WebIDE" />
</PreferenceScreen>

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

@ -1,77 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gecko="http://schemas.android.com/apk/res-auto"
android:enabled="false">
<PreferenceScreen
android:key="android.not_a_preference.customize_home"
android:title="@string/pref_category_home"
android:summary="@string/pref_category_home_summary" >
<intent android:action="android.intent.action.VIEW"
android:targetPackage="@string/android_package_name"
android:targetClass="org.mozilla.gecko.preferences.GeckoPreferences" >
<extra
android:name="resource"
android:value="preferences_home" />
</intent>
</PreferenceScreen>
<PreferenceScreen android:title="@string/pref_category_search"
android:summary="@string/pref_category_search_summary" >
<intent android:action="android.intent.action.VIEW"
android:targetPackage="@string/android_package_name"
android:targetClass="org.mozilla.gecko.preferences.GeckoPreferences" >
<extra
android:name="resource"
android:value="preferences_search" />
</intent>
</PreferenceScreen>
<ListPreference android:key="android.not_a_preference.restoreSession3"
android:title="@string/pref_restore"
android:defaultValue="quit"
android:entries="@array/pref_restore_entries"
android:entryValues="@array/pref_restore_values"
android:persistent="true" />
<CheckBoxPreference android:key="browser.image_blocking.enabled"
android:title="@string/pref_tap_to_load_images_title"
android:summary="@string/pref_tap_to_load_images_summary2"
android:defaultValue="false"/>
<CheckBoxPreference android:key="android.not_a_preference.tab_queue"
android:title="@string/pref_tab_queue_title"
android:summary="@string/pref_tab_queue_summary"
android:defaultValue="false" />
<CheckBoxPreference android:key="android.not_a_preference.openExternalURLsPrivately"
android:title="@string/pref_open_external_urls_privately_title"
android:summary="@string/pref_open_external_urls_privately_summary"
android:defaultValue="false" />
<org.mozilla.gecko.preferences.AndroidImportPreference
android:key="android.not_a_preference.import_android"
gecko:entries="@array/pref_import_android_entries"
gecko:entryValues="@array/pref_import_android_values"
gecko:initialValues="@array/pref_import_android_defaults"
gecko:entryKeys="@array/pref_import_android_keys"
android:title="@string/pref_import_android"
android:summary="@string/pref_import_android_summary"
android:positiveButtonText="@string/bookmarkhistory_button_import"
android:negativeButtonText="@string/button_cancel"
android:persistent="false" />
<ListPreference android:key="app.update.autodownload"
android:title="@string/pref_update_autodownload"
android:entries="@array/pref_update_autodownload_entries"
android:entryValues="@array/pref_update_autodownload_values"
android:persistent="false" />
</PreferenceScreen>

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

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gecko="http://schemas.android.com/apk/res-auto"
android:title="@string/pref_category_devtools"
android:enabled="false">
<CheckBoxPreference android:key="devtools.remote.usb.enabled"
android:title="@string/pref_developer_remotedebugging_usb" />
<org.mozilla.gecko.preferences.AlignRightLinkPreference android:key="android.not_a_preference.remote_debugging.link"
android:title="@string/pref_learn_more"
android:persistent="false"
url="https://developer.mozilla.org/docs/Tools/Remote_Debugging/Debugging_Firefox_for_Android_with_WebIDE" />
<CheckBoxPreference android:key="devtools.remote.wifi.enabled"
android:title="@string/pref_developer_remotedebugging_wifi" />
<org.mozilla.gecko.preferences.AlignRightLinkPreference android:key="android.not_a_preference.remote_debugging.link"
android:title="@string/pref_learn_more"
android:persistent="false"
url="https://developer.mozilla.org/docs/Tools/Remote_Debugging/Debugging_Firefox_for_Android_with_WebIDE" />
</PreferenceScreen>

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

@ -1,71 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gecko="http://schemas.android.com/apk/res-auto"
android:title="@string/pref_category_display"
android:enabled="false">
<org.mozilla.gecko.preferences.FontSizePreference
android:key="font.size.inflation.minTwips"
android:title="@string/pref_text_size"
android:positiveButtonText="@string/pref_font_size_set"
android:negativeButtonText="@string/button_cancel"
android:persistent="false" />
<ListPreference android:key="browser.chrome.titlebarMode"
android:title="@string/pref_titlebar_mode"
android:entries="@array/pref_titlebar_mode_entries"
android:entryValues="@array/pref_titlebar_mode_values"
android:persistent="false" />
<CheckBoxPreference android:key="browser.chrome.dynamictoolbar"
android:title="@string/pref_scroll_title_bar2"
android:summary="@string/pref_scroll_title_bar_summary" />
<CheckBoxPreference android:key="media.autoplay.enabled"
android:title="@string/pref_media_autoplay_enabled"
android:summary="@string/pref_media_autoplay_enabled_summary" />
<CheckBoxPreference android:key="browser.ui.zoom.force-user-scalable"
android:title="@string/pref_zoom_force_enabled"
android:summary="@string/pref_zoom_force_enabled_summary" />
<CheckBoxPreference android:key="ui.zoomedview.enabled"
android:title="@string/pref_magnifying_glass_enabled"
android:summary="@string/pref_magnifying_glass_enabled_summary" />
<PreferenceCategory android:title="@string/pref_category_input_options"
android:key="@string/pref_category_input_options">
<CheckBoxPreference android:key="android.not_a_preference.voice_input_enabled"
android:title="@string/pref_voice_input"
android:summary="@string/pref_voice_input_summary"
android:defaultValue="true"/>
<CheckBoxPreference android:key="android.not_a_preference.qrcode_enabled"
android:title="@string/pref_qrcode_enabled"
android:summary="@string/pref_qrcode_enabled_summary"
android:defaultValue="true"/>
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_category_advanced">
<ListPreference android:key="browser.menu.showCharacterEncoding"
android:title="@string/pref_char_encoding"
android:entries="@array/pref_char_encoding_entries"
android:entryValues="@array/pref_char_encoding_values"
android:persistent="false" />
<ListPreference android:key="plugin.enable"
android:title="@string/pref_plugins"
android:entries="@array/pref_plugins_entries"
android:entryValues="@array/pref_plugins_values"
android:persistent="false" />
</PreferenceCategory>
</PreferenceScreen>

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

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gecko="http://schemas.android.com/apk/res-auto"
android:enabled="false">
<PreferenceScreen
android:key="android.not_a_preference.general_home"
android:title="@string/pref_category_home"
android:summary="@string/pref_category_home_summary" >
<intent android:action="android.intent.action.VIEW"
android:targetPackage="@string/android_package_name"
android:targetClass="org.mozilla.gecko.preferences.GeckoPreferences" >
<extra
android:name="resource"
android:value="preferences_home" />
</intent>
</PreferenceScreen>
<PreferenceScreen android:title="@string/pref_category_language"
android:summary="@string/pref_category_language_summary" >
<intent android:action="android.intent.action.VIEW"
android:targetPackage="@string/android_package_name"
android:targetClass="org.mozilla.gecko.preferences.GeckoPreferences" >
<extra
android:name="resource"
android:value="preferences_locale" />
</intent>
</PreferenceScreen>
<ListPreference android:key="browser.chrome.titlebarMode"
android:title="@string/pref_titlebar_mode"
android:entries="@array/pref_titlebar_mode_entries"
android:entryValues="@array/pref_titlebar_mode_values"
android:persistent="false" />
<CheckBoxPreference android:key="browser.chrome.dynamictoolbar"
android:title="@string/pref_scroll_title_bar2"
android:summary="@string/pref_scroll_title_bar_summary" />
<CheckBoxPreference android:key="android.not_a_preference.tab_queue"
android:title="@string/pref_tab_queue_title"
android:summary="@string/pref_tab_queue_summary"
android:defaultValue="false" />
<CheckBoxPreference android:key="android.not_a_preference.openExternalURLsPrivately"
android:title="@string/pref_open_external_urls_privately_title"
android:summary="@string/pref_open_external_urls_privately_summary"
android:defaultValue="false" />
</PreferenceScreen>

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

@ -8,6 +8,17 @@
android:title="@string/pref_category_privacy_short"
android:enabled="false">
<CheckBoxPreference android:key="privacy.donottrackheader.enabled"
android:title="@string/pref_donottrack_title"
android:summary="@string/pref_donottrack_summary"
android:persistent="false" />
<org.mozilla.gecko.preferences.AlignRightLinkPreference
android:key="android.not_a_preference.donottrackheader.learn_more"
android:title="@string/pref_learn_more"
android:persistent="false"
url="https://www.mozilla.org/firefox/dnt/" />
<CheckBoxPreference android:key="privacy.trackingprotection.pbmode.enabled"
android:title="@string/pref_tracking_protection_title"
android:summary="@string/pref_tracking_protection_summary"
@ -25,64 +36,68 @@
android:persistent="false"
url="https://support.mozilla.org/kb/firefox-android-tracking-protection" />
<CheckBoxPreference android:key="privacy.donottrackheader.enabled"
android:title="@string/pref_donottrack_title"
android:summary="@string/pref_donottrack_summary"
android:persistent="false" />
<org.mozilla.gecko.preferences.AlignRightLinkPreference
android:key="android.not_a_preference.donottrackheader.learn_more"
android:title="@string/pref_learn_more"
android:persistent="false"
url="https://www.mozilla.org/firefox/dnt/" />
<ListPreference android:key="network.cookie.cookieBehavior"
android:title="@string/pref_cookies_menu"
android:entries="@array/pref_cookies_entries"
android:entryValues="@array/pref_cookies_values"
android:persistent="false" />
<PreferenceCategory android:title="@string/pref_category_logins">
<org.mozilla.gecko.preferences.LinkPreference android:key="android.not_a_preference.signon.manage"
android:title="@string/pref_manage_logins"
url="about:logins"/>
<org.mozilla.gecko.preferences.LinkPreference android:key="android.not_a_preference.signon.manage"
android:title="@string/pref_manage_logins"
url="about:logins"/>
<CheckBoxPreference android:key="signon.rememberSignons"
android:title="@string/pref_remember_signons"
android:persistent="false" />
<CheckBoxPreference android:key="signon.rememberSignons"
android:title="@string/pref_remember_signons"
android:persistent="false" />
<CheckBoxPreference android:key="privacy.masterpassword.enabled"
android:title="@string/pref_use_master_password"
android:persistent="false" />
<CheckBoxPreference android:key="privacy.masterpassword.enabled"
android:title="@string/pref_use_master_password"
android:persistent="false" />
</PreferenceCategory>
<!-- This pref is persisted in both Gecko and Java -->
<org.mozilla.gecko.preferences.ListCheckboxPreference
android:key="android.not_a_preference.history.clear_on_exit"
gecko:entries="@array/pref_private_data_entries"
gecko:entryValues="@array/pref_private_data_values"
gecko:initialValues="@array/pref_clear_on_exit_defaults"
<!-- keys prefixed with "android.not_a_preference." are not synced with Gecko -->
<PreferenceCategory android:key="android.not_a_preference.category_private_data" android:title="@string/pref_clear_private_data_category">
android:title="@string/pref_clear_on_exit_title"
android:summary="@string/pref_clear_on_exit_summary2"
<org.mozilla.gecko.preferences.PrivateDataPreference
android:key="android.not_a_preference.privacy.clear"
android:title="@string/pref_clear_private_data"
android:persistent="true"
android:positiveButtonText="@string/button_clear_data"
gecko:entries="@array/pref_private_data_entries"
gecko:entryValues="@array/pref_private_data_values"
gecko:entryKeys="@array/pref_private_data_keys"
gecko:initialValues="@array/pref_private_data_defaults" />
android:dialogTitle="@string/pref_clear_on_exit_dialog_title"
android:positiveButtonText="@string/button_set"/>
<!-- This pref is persisted in both Gecko and Java -->
<org.mozilla.gecko.preferences.ListCheckboxPreference
android:key="android.not_a_preference.history.clear_on_exit"
gecko:entries="@array/pref_private_data_entries"
gecko:entryValues="@array/pref_private_data_values"
gecko:initialValues="@array/pref_clear_on_exit_defaults"
<PreferenceCategory android:key="android.not_a_preference.datareporting.preferences"
android:title="@string/pref_category_datareporting">
android:title="@string/pref_clear_on_exit_title"
android:summary="@string/pref_clear_on_exit_summary2"
<CheckBoxPreference android:key="toolkit.telemetry.enabled"
android:title="@string/datareporting_telemetry_title"
android:summary="@string/datareporting_telemetry_summary" />
android:dialogTitle="@string/pref_clear_on_exit_dialog_title"
android:positiveButtonText="@string/button_set"/>
<CheckBoxPreference android:key="datareporting.crashreporter.submitEnabled"
android:title="@string/datareporting_crashreporter_title_short"
android:summary="@string/datareporting_crashreporter_summary"
android:defaultValue="false" />
<CheckBoxPreference android:key="android.not_a_preference.app.geo.reportdata"
android:title="@string/datareporting_wifi_title"
android:summary="@string/datareporting_wifi_geolocation_summary" />
<org.mozilla.gecko.preferences.AlignRightLinkPreference android:key="android.not_a_preference.geo.learn_more"
android:title="@string/pref_learn_more"
android:persistent="false"
url="https://location.services.mozilla.com/" />
<CheckBoxPreference android:key="android.not_a_preference.healthreport.uploadEnabled"
android:title="@string/datareporting_fhr_title"
android:summary="@string/datareporting_fhr_summary2"
android:defaultValue="true" />
<org.mozilla.gecko.preferences.AlignRightLinkPreference android:key="android.not_a_preference.healthreport.link"
android:title="@string/datareporting_abouthr_title"
android:persistent="false"
url="about:healthreport" />
</PreferenceCategory>

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

@ -8,15 +8,14 @@
android:title="@string/pref_category_search"
android:enabled="false">
<CheckBoxPreference android:key="browser.search.suggest.enabled"
android:title="@string/pref_search_suggestions"
android:defaultValue="false"
android:persistent="false" />
<PreferenceCategory android:title="@string/pref_category_add_search_providers">
<CheckBoxPreference android:key="android.not_a_preference.search.search_history.enabled"
android:title="@string/pref_history_search_suggestions"
android:defaultValue="true"
android:persistent="true" />
<org.mozilla.gecko.preferences.ModifiableHintPreference
android:layout="@layout/preference_search_tip"
android:enabled="false"
android:selectable="false"/>
</PreferenceCategory>
<org.mozilla.gecko.preferences.SearchPreferenceCategory
android:title="@string/pref_category_installed_search_engines"/>
@ -28,13 +27,14 @@
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_category_add_search_providers">
<CheckBoxPreference android:key="browser.search.suggest.enabled"
android:title="@string/pref_search_suggestions"
android:defaultValue="false"
android:persistent="false" />
<org.mozilla.gecko.preferences.ModifiableHintPreference
android:layout="@layout/preference_search_tip"
android:enabled="false"
android:selectable="false"/>
</PreferenceCategory>
<CheckBoxPreference android:key="android.not_a_preference.search.search_history.enabled"
android:title="@string/pref_history_search_suggestions"
android:defaultValue="true"
android:persistent="true" />
</PreferenceScreen>

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

@ -22,37 +22,4 @@
android:persistent="false"
url="about:feedback" />
<PreferenceCategory android:key="android.not_a_preference.datareporting.preferences"
android:title="@string/pref_category_datareporting">
<CheckBoxPreference android:key="toolkit.telemetry.enabled"
android:title="@string/datareporting_telemetry_title"
android:summary="@string/datareporting_telemetry_summary" />
<CheckBoxPreference android:key="datareporting.crashreporter.submitEnabled"
android:title="@string/datareporting_crashreporter_title_short"
android:summary="@string/datareporting_crashreporter_summary"
android:defaultValue="false" />
<CheckBoxPreference android:key="android.not_a_preference.app.geo.reportdata"
android:title="@string/datareporting_wifi_title"
android:summary="@string/datareporting_wifi_geolocation_summary" />
<org.mozilla.gecko.preferences.AlignRightLinkPreference android:key="android.not_a_preference.geo.learn_more"
android:title="@string/pref_learn_more"
android:persistent="false"
url="https://location.services.mozilla.com/" />
<CheckBoxPreference android:key="android.not_a_preference.healthreport.uploadEnabled"
android:title="@string/datareporting_fhr_title"
android:summary="@string/datareporting_fhr_summary2"
android:defaultValue="true" />
<org.mozilla.gecko.preferences.AlignRightLinkPreference android:key="android.not_a_preference.healthreport.link"
android:title="@string/datareporting_abouthr_title"
android:persistent="false"
url="about:healthreport" />
</PreferenceCategory>
</PreferenceScreen>

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

@ -140,16 +140,13 @@
<string name="settings">&settings;</string>
<string name="settings_title">&settings_title;</string>
<string name="pref_category_input_options">&pref_category_input_options;</string>
<string name="pref_category_advanced">&pref_category_advanced;</string>
<string name="pref_category_customize">&pref_category_customize;</string>
<string name="pref_category_customize_summary">&pref_category_customize_summary;</string>
<string name="pref_category_customize_alt_summary">&pref_category_customize_alt_summary;</string>
<string name="pref_category_general">&pref_category_general;</string>
<string name="pref_category_general_summary">&pref_category_general_summary;</string>
<string name="pref_category_search">&pref_category_search3;</string>
<string name="pref_category_search_summary">&pref_category_search_summary;</string>
<string name="pref_category_display">&pref_category_display;</string>
<string name="pref_category_display_summary">&pref_category_display_summary;</string>
<string name="pref_category_accessibility">&pref_category_accessibility;</string>
<string name="pref_category_accessibility_summary">&pref_category_accessibility_summary;</string>
<string name="pref_category_privacy_short">&pref_category_privacy_short;</string>
<string name="pref_category_privacy_summary">&pref_category_privacy_summary2;</string>
<string name="pref_category_vendor">&pref_category_vendor;</string>
@ -167,7 +164,8 @@
<string name="pref_browser_locale">&pref_browser_locale;</string>
<string name="locale_system_default">&locale_system_default;</string>
<string name="pref_category_devtools">&pref_category_devtools;</string>
<string name="pref_category_advanced">&pref_category_advanced;</string>
<string name="pref_category_advanced_summary">&pref_category_advanced_summary;</string>
<string name="pref_developer_remotedebugging">&pref_developer_remotedebugging;</string>
<string name="pref_developer_remotedebugging_usb">&pref_developer_remotedebugging_usb;</string>
<string name="pref_developer_remotedebugging_wifi">&pref_developer_remotedebugging_wifi;</string>
@ -189,16 +187,15 @@
<string name="home_homepage_title">&home_homepage_title;</string>
<string name="home_homepage_use_current_tab">&home_homepage_use_current_tab;</string>
<string name="pref_header_customize">&pref_header_customize;</string>
<string name="pref_header_display">&pref_header_display;</string>
<string name="pref_header_general">&pref_header_general;</string>
<string name="pref_header_search">&pref_header_search;</string>
<string name="pref_header_accessibility">&pref_header_accessibility;</string>
<string name="pref_header_privacy_short">&pref_header_privacy_short;</string>
<string name="pref_header_language">&pref_header_language;</string>
<string name="pref_header_advanced">&pref_header_advanced;</string>
<string name="pref_header_vendor">&pref_header_vendor;</string>
<string name="pref_header_devtools">&pref_header_devtools;</string>
<string name="pref_learn_more">&pref_learn_more;</string>
<string name="pref_category_logins">&pref_category_logins;</string>
<string name="pref_remember_signons">&pref_remember_signons2;</string>
<string name="pref_open_external_urls_privately_title">&pref_open_external_urls_privately_title;</string>
@ -226,8 +223,7 @@
<string name="pref_char_encoding">&pref_char_encoding;</string>
<string name="pref_char_encoding_on">&pref_char_encoding_on;</string>
<string name="pref_char_encoding_off">&pref_char_encoding_off;</string>
<string name="pref_clear_private_data">&pref_clear_private_data2;</string>
<string name="pref_clear_private_data_category">&pref_clear_private_data_category;</string>
<string name="pref_clear_private_data_now">&pref_clear_private_data_now;</string>
<string name="pref_clear_on_exit_title">&pref_clear_on_exit_title2;</string>
<string name="pref_clear_on_exit_summary2">&pref_clear_on_exit_summary2;</string>
<string name="pref_clear_on_exit_dialog_title">&pref_clear_on_exit_dialog_title;</string>

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

@ -65,8 +65,8 @@ final class UnusedResourcesUtil {
};
public static final int[] USED_IN_PREFS = {
R.xml.preferences_devtools,
R.xml.preferences_display,
R.xml.preferences_advanced,
R.xml.preferences_accessibility,
R.xml.preferences_home,
R.xml.preferences_privacy,
};

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

@ -118,10 +118,5 @@ MOZ_ADDON_SIGNING=1
# usage of the framework.
MOZ_SWITCHBOARD=1
# Use native Firefox Accounts UI after Nightly.
if ! test "$NIGHTLY_BUILD"; then
MOZ_ANDROID_NATIVE_ACCOUNT_UI=1
fi
# Disable GeckoView by default.
export MOZ_DISABLE_GECKOVIEW=1

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

@ -31,9 +31,6 @@ skip-if = android_version == "10" || android_version == "18"
# [src/org/mozilla/gecko/tests/testBookmarkKeyword.java] # see bug 915350
[src/org/mozilla/gecko/tests/testBrowserProvider.java]
[src/org/mozilla/gecko/tests/testBrowserSearchVisibility.java]
[src/org/mozilla/gecko/tests/testClearPrivateData.java]
# disabled on 2.3, bug 948591; on 4.3, bug 1000643
skip-if = android_version == "10" || android_version == "18"
[src/org/mozilla/gecko/tests/testDBUtils.java]
[src/org/mozilla/gecko/tests/testDistribution.java]
[src/org/mozilla/gecko/tests/testDoorHanger.java]
@ -50,9 +47,6 @@ skip-if = android_version == "18"
skip-if = true
# [src/org/mozilla/gecko/tests/testHistory.java] # see bug 915350
[src/org/mozilla/gecko/tests/testHomeBanner.java]
[src/org/mozilla/gecko/tests/testImportFromAndroid.java]
# disabled on 2.3 and 4.3 bug 979552
skip-if = android_version == "10" || android_version == "18"
[src/org/mozilla/gecko/tests/testInputUrlBar.java]
# disabled on 2.3 bug 1165511
skip-if = android_version == "10"
@ -63,10 +57,6 @@ skip-if = android_version == "18"
# [src/org/mozilla/gecko/tests/testHomeListsProvider.java] # see bug 952310
[src/org/mozilla/gecko/tests/testLoad.java]
[src/org/mozilla/gecko/tests/testMailToContextMenu.java]
# [src/org/mozilla/gecko/tests/testMasterPassword.java] disabled for being finicky, see bug 1033013
# disabled on 2.3; bug 979603
# disabled on 4.0; bug 1006242
# skip-if = android_version == "10" || android_version == "15"
[src/org/mozilla/gecko/tests/testNewTab.java]
# disabled on 4.3, bug 1145851
skip-if = android_version == "18"
@ -95,17 +85,8 @@ skip-if = android_version == "10" || android_version == "18"
[src/org/mozilla/gecko/tests/testSessionOOMRestore.java]
# disabled on Android 2.3, bug 979600; on 4.3, bug 1145879
skip-if = android_version == "10" || android_version == "18"
[src/org/mozilla/gecko/tests/testSettingsMenuItems.java]
# disabled on Android 2.3, bug 979552; on 4.3, bug 1144898
skip-if = android_version == "10" || android_version == "18"
# [src/org/mozilla/gecko/tests/testShareLink.java] # see bug 915897
[src/org/mozilla/gecko/tests/testSystemPages.java]
# disabled on 2.3, bug 979603; on 4.3, bug 1142811
skip-if = android_version == "10" || android_version == "18"
# [src/org/mozilla/gecko/tests/testThumbnails.java] # see bug 813107
[src/org/mozilla/gecko/tests/testTitleBar.java]
# disabled on Android 2.3, bug 979552; on 4.3, bug 1145881
skip-if = android_version == "10" || android_version == "18"
# [src/org/mozilla/gecko/tests/testVkbOverlap.java] # see bug 907274
# Using JavascriptTest

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

@ -19,7 +19,6 @@ import org.json.JSONObject;
import org.mozilla.gecko.Actions;
import org.mozilla.gecko.Element;
import org.mozilla.gecko.GeckoAppShell;
import org.mozilla.gecko.GeckoEvent;
import org.mozilla.gecko.GeckoProfile;
import org.mozilla.gecko.GeckoThread;
import org.mozilla.gecko.R;
@ -29,10 +28,8 @@ import org.mozilla.gecko.Tabs;
import android.app.Activity;
import android.content.ContentValues;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.res.AssetManager;
import android.content.res.Resources;
import android.database.Cursor;
import android.os.Build;
import android.os.SystemClock;
@ -143,14 +140,6 @@ abstract class BaseTest extends BaseRobocopTest {
}
}
public void assertMatches(String value, String regex, String name) {
if (value == null) {
mAsserter.ok(false, name, "Expected /" + regex + "/, got null");
return;
}
mAsserter.ok(value.matches(regex), name, "Expected /" + regex +"/, got \"" + value + "\"");
}
/**
* Click on the URL bar to focus it and enter editing mode.
*/
@ -300,10 +289,6 @@ abstract class BaseTest extends BaseRobocopTest {
return result;
}
protected interface BooleanTest {
public boolean test();
}
public void SqliteCompare(String dbName, String sqlCommand, ContentValues[] cvs) {
File profile = new File(mProfile);
String dbPath = new File(profile, dbName).getPath();
@ -564,12 +549,6 @@ abstract class BaseTest extends BaseRobocopTest {
}
}
// Used to hide/show the virtual keyboard
public void toggleVKB() {
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Activity.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0);
}
public void addTab() {
mSolo.clickOnView(mSolo.getView(R.id.tabs));
// wait for addTab to appear (this is usually immediate)
@ -682,17 +661,6 @@ abstract class BaseTest extends BaseRobocopTest {
mSolo.clickOnView(getTabViewAt(index));
}
/**
* Closes the tab at the specified index.
*
* @param index Index of tab to close
*/
public void closeTabAt(final int index) {
View closeButton = getTabViewAt(index).findViewById(R.id.close);
mSolo.clickOnView(closeButton);
}
public final void runOnUiThreadSync(Runnable runnable) {
RobocopUtils.runOnUiThreadSync(getActivity(), runnable);
}
@ -731,14 +699,6 @@ abstract class BaseTest extends BaseRobocopTest {
}
}
public void clearPrivateData() {
selectSettingsItem(mStringHelper.PRIVACY_SECTION_LABEL, mStringHelper.CLEAR_PRIVATE_DATA_LABEL);
Actions.EventExpecter clearData = mActions.expectGeckoEvent("Sanitize:Finished");
mSolo.clickOnText("Clear data");
clearData.blockForEvent();
clearData.unregisterListener();
}
class Device {
public final String version; // 2.x or 3.x or 4.x
public String type; // "tablet" or "phone"
@ -774,14 +734,6 @@ abstract class BaseTest extends BaseRobocopTest {
mAsserter.dumpLog("Exception in detectDevice", e);
}
}
public void rotate() {
if (getActivity().getRequestedOrientation () == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
mSolo.setActivityOrientation(Solo.PORTRAIT);
} else {
mSolo.setActivityOrientation(Solo.LANDSCAPE);
}
}
}
class Navigation {
@ -829,23 +781,6 @@ abstract class BaseTest extends BaseRobocopTest {
pageShowExpecter.unregisterListener();
}
public void reload() {
if (devType.equals("tablet")) {
mSolo.waitForView(R.id.reload);
mSolo.clickOnView(mSolo.getView(R.id.reload));
} else {
mActions.sendSpecialKey(Actions.SpecialKey.MENU);
waitForText("^New Tab$");
if (!osVersion.equals("2.x")) {
mSolo.waitForView(R.id.reload);
mSolo.clickOnView(mSolo.getView(R.id.reload));
} else {
mSolo.clickOnText("^Reload$");
}
ensureMenuClosed();
}
}
// DEPRECATED!
// Use BaseTest.toggleBookmark() in new code.
public void bookmark() {

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

@ -100,98 +100,22 @@ public class StringHelper {
public final String ROBOCOP_BIG_MAILTO_TITLE = "Big Mailto";
public final String ROBOCOP_BLANK_PAGE_01_TITLE = "Browser Blank Page 01";
public final String ROBOCOP_BLANK_PAGE_02_TITLE = "Browser Blank Page 02";
public final String ROBOCOP_BLANK_PAGE_03_TITLE = "Browser Blank Page 03";
public final String ROBOCOP_BLANK_PAGE_04_TITLE = "Browser Blank Page 04";
public final String ROBOCOP_BLANK_PAGE_05_TITLE = "Browser Blank Page 05";
public final String ROBOCOP_BOXES_TITLE = "Browser Box test";
public final String ROBOCOP_GEOLOCATION_TITLE = "Geolocation Test Page";
public final String ROBOCOP_LOGIN_TITLE = "Robocop Login";
public final String ROBOCOP_OFFLINE_STORAGE_TITLE = "Robocop offline storage";
public final String ROBOCOP_PICTURE_LINK_TITLE = "Picture Link";
public final String ROBOCOP_SEARCH_TITLE = "Robocop Search Engine";
public final String ROBOCOP_TEXT_PAGE_TITLE = "Robocop Text Page";
public final String ROBOCOP_INPUT_TITLE = "Robocop Input";
// Distribution tile labels
public final String DISTRIBUTION1_LABEL = "Distribution 1";
public final String DISTRIBUTION2_LABEL = "Distribution 2";
// Import strings
public final String BOOKMARKS;
public final String IMPORT;
// Settings menu strings
// Section labels - ordered as found in the settings menu
public final String CUSTOMIZE_SECTION_LABEL;
public final String DISPLAY_SECTION_LABEL;
public final String PRIVACY_SECTION_LABEL;
public final String MOZILLA_SECTION_LABEL;
public final String DEVELOPER_TOOLS_SECTION_LABEL;
// Option labels
// Customize
public final String SYNC_LABEL;
public final String IMPORT_FROM_ANDROID_LABEL;
public final String TABS_LABEL;
// Display
public final String TEXT_SIZE_LABEL;
public final String TITLE_BAR_LABEL = "Title bar";
public final String SCROLL_TITLE_BAR_LABEL;
public final String VOICE_INPUT_TITLE_LABEL;
public final String VOICE_INPUT_SUMMARY_LABEL;
public final String QRCODE_INPUT_TITLE_LABEL;
public final String QRCODE_INPUT_SUMMARY_LABEL;
public final String CHARACTER_ENCODING_LABEL;
public final String PLUGINS_LABEL;
// Title bar
public final String SHOW_PAGE_TITLE_LABEL = "Show page title";
public final String SHOW_PAGE_ADDRESS_LABEL = "Show page address";
// Privacy
public final String TRACKING_PROTECTION_LABEL;
public final String TRACKING_PROTECTION_PROMPT_TITLE;
public final String TRACKING_PROTECTION_PROMPT_BUTTON;
public final String DNT_LABEL;
public final String COOKIES_LABEL;
public final String REMEMBER_LOGINS_LABEL;
public final String MANAGE_LOGINS_LABEL;
public final String MASTER_PASSWORD_LABEL;
public final String CLEAR_PRIVATE_DATA_LABEL;
public final String ENABLED_EXCLUDE_3RD_PARTY;
public final String BROWSING_HISTORY;
public final String SEARCH_HISTORY;
public final String DOWNLOADS;
public final String FORM_HISTORY;
public final String COOKIES_AND_LOGINS;
public final String CACHE;
public final String OFFLINE_DATA;
public final String SITE_SETTINGS;
public final String CLEAR_DATA_BUTTON;
// Mozilla
public final String BRAND_NAME = "(Fennec|Nightly|Aurora|Firefox Beta|Firefox)";
public final String ABOUT_LABEL = "About " + BRAND_NAME ;
public final String FAQS_LABEL;
public final String FEEDBACK_LABEL;
public final String LOCATION_SERVICES_LABEL = "Mozilla Location Service";
public final String HEALTH_REPORT_LABEL = BRAND_NAME + " Health Report";
public final String MY_HEALTH_REPORT_LABEL;
public final String DATA_CHOICES;
public final String HEALTH_REPORT_EXPLANATION;
public final String MOZ_LOCATION;
public final String MOZ_LOCATION_MSG;
public final String LEARN_MORE;
public final String CRASH_REPORTER;
public final String CRASH_REPORTER_MSG;
public final String TELEMETRY;
public final String TELEMETRY_MSG;
// Developer tools
public final String REMOTE_DEBUGGING_USB_LABEL;
public final String REMOTE_DEBUGGING_WIFI_LABEL;
public final String LEARN_MORE_LABEL;
// Labels for the about:home tabs
public final String HISTORY_LABEL;
@ -199,7 +123,6 @@ public class StringHelper {
public final String BOOKMARKS_LABEL;
public final String READING_LIST_LABEL;
public final String TODAY_LABEL;
public final String TABS_FROM_LAST_TIME_LABEL = "Open all tabs from last time";
// Desktop default bookmarks folders
public final String BOOKMARKS_UP_TO;
@ -363,73 +286,9 @@ public class StringHelper {
TITLE_PLACE_HOLDER = res.getString(R.string.url_bar_default_text);
// Import strings
IMPORT = res.getString(R.string.bookmarkhistory_button_import);
BOOKMARKS = res.getString(R.string.bookmarks_title);
// Settings menu strings
// Section labels - ordered as found in the settings menu
CUSTOMIZE_SECTION_LABEL = res.getString(R.string.pref_category_customize);
DISPLAY_SECTION_LABEL = res.getString(R.string.pref_category_display);
PRIVACY_SECTION_LABEL = res.getString(R.string.pref_category_privacy_short);
MOZILLA_SECTION_LABEL = res.getString(R.string.pref_category_vendor);
DEVELOPER_TOOLS_SECTION_LABEL = res.getString(R.string.pref_category_devtools);
// Option labels
// Customize
SYNC_LABEL = res.getString(R.string.pref_sync);
IMPORT_FROM_ANDROID_LABEL = res.getString(R.string.pref_import_android);
TABS_LABEL = res.getString(R.string.pref_restore);
// Display
TEXT_SIZE_LABEL = res.getString(R.string.pref_text_size);
SCROLL_TITLE_BAR_LABEL = res.getString(R.string.pref_scroll_title_bar2);
VOICE_INPUT_TITLE_LABEL = res.getString(R.string.pref_voice_input);
VOICE_INPUT_SUMMARY_LABEL = res.getString(R.string.pref_voice_input_summary);
QRCODE_INPUT_TITLE_LABEL = res.getString(R.string.pref_qrcode_enabled);
QRCODE_INPUT_SUMMARY_LABEL = res.getString(R.string.pref_qrcode_enabled_summary);
CHARACTER_ENCODING_LABEL = res.getString(R.string.pref_char_encoding);
PLUGINS_LABEL = res.getString(R.string.pref_plugins);
// Privacy
TRACKING_PROTECTION_LABEL = res.getString(R.string.pref_tracking_protection_title);
TRACKING_PROTECTION_PROMPT_TITLE = res.getString(R.string.tracking_protection_prompt_title);
TRACKING_PROTECTION_PROMPT_BUTTON = res.getString(R.string.tracking_protection_prompt_action_button);
DNT_LABEL = res.getString(R.string.pref_donottrack_title);
COOKIES_LABEL = res.getString(R.string.pref_cookies_menu);
REMEMBER_LOGINS_LABEL = res.getString(R.string.pref_remember_signons);
MANAGE_LOGINS_LABEL = res.getString(R.string.pref_manage_logins);
MASTER_PASSWORD_LABEL = res.getString(R.string.pref_use_master_password);
CLEAR_PRIVATE_DATA_LABEL = res.getString(R.string.pref_clear_private_data);
ENABLED_EXCLUDE_3RD_PARTY = res.getString(R.string.pref_cookies_not_accept_foreign);
BROWSING_HISTORY = res.getString(R.string.pref_private_data_history2);
SEARCH_HISTORY = res.getString(R.string.pref_private_data_searchHistory);
DOWNLOADS = res.getString(R.string.pref_private_data_downloadFiles2);
FORM_HISTORY = res.getString(R.string.pref_private_data_formdata2);
COOKIES_AND_LOGINS = res.getString(R.string.pref_private_data_cookies2);
CACHE = res.getString(R.string.pref_private_data_cache);
OFFLINE_DATA = res.getString(R.string.pref_private_data_offlineApps);
SITE_SETTINGS = res.getString(R.string.pref_private_data_siteSettings);
CLEAR_DATA_BUTTON = res.getString(R.string.button_clear_data);
// Mozilla
FAQS_LABEL = res.getString(R.string.pref_vendor_faqs);
FEEDBACK_LABEL = res.getString(R.string.pref_vendor_feedback);
DATA_CHOICES = res.getString(R.string.pref_category_datareporting);
MY_HEALTH_REPORT_LABEL = res.getString(R.string.datareporting_abouthr_title);
HEALTH_REPORT_EXPLANATION = res.getString(R.string.datareporting_fhr_summary2);
MOZ_LOCATION = res.getString(R.string.datareporting_wifi_title);
MOZ_LOCATION_MSG = res.getString(R.string.datareporting_wifi_geolocation_summary);
LEARN_MORE = res.getString(R.string.pref_learn_more);
CRASH_REPORTER = res.getString(R.string.datareporting_crashreporter_title_short);
CRASH_REPORTER_MSG = res.getString(R.string.datareporting_crashreporter_summary);
TELEMETRY = res.getString(R.string.datareporting_telemetry_title);
TELEMETRY_MSG = res.getString(R.string.datareporting_telemetry_summary);
// Developer tools
REMOTE_DEBUGGING_USB_LABEL = res.getString(R.string.pref_developer_remotedebugging_usb);
REMOTE_DEBUGGING_WIFI_LABEL = res.getString(R.string.pref_developer_remotedebugging_wifi);
LEARN_MORE_LABEL = res.getString(R.string.pref_learn_more);
// Labels for the about:home tabs
HISTORY_LABEL = res.getString(R.string.home_history_title);

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

@ -1,135 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.tests;
import org.mozilla.gecko.R;
import com.jayway.android.robotium.solo.Condition;
import android.view.View;
import android.widget.ImageView;
/**
* This patch tests the clear private data options:
* - clear history option by: adding and checking that clear private
* data option removes the history items but not the users bookmarks
* - clear site settings and clear saved password by: checking
* each option present in the doorhanger and clearing the settings from
* the URL bar context menu and settings menu
*/
public class testClearPrivateData extends PixelTest {
private final int TEST_WAIT_MS = 10000;
public void testClearPrivateData() {
blockForGeckoReady();
clearHistory();
clearSiteSettings();
clearPassword();
}
private void clearHistory() {
// Loading a page and adding a second one as bookmark to have user made bookmarks and history
String blank1 = getAbsoluteUrl(mStringHelper.ROBOCOP_BLANK_PAGE_01_URL);
String blank2 = getAbsoluteUrl(mStringHelper.ROBOCOP_BLANK_PAGE_02_URL);
String title = mStringHelper.ROBOCOP_BLANK_PAGE_01_TITLE;
loadUrlAndWait(blank1);
verifyUrlBarTitle(blank1);
mDatabaseHelper.addMobileBookmark(mStringHelper.ROBOCOP_BLANK_PAGE_02_TITLE, blank2);
// Checking that the history list is not empty
verifyHistoryCount(1);
//clear and check for device
checkDevice(title, blank1);
// Checking that history list is empty
verifyHistoryCount(0);
// Checking that the user made bookmark is not removed
mAsserter.ok(mDatabaseHelper.isBookmark(blank2), "Checking that bookmarks have not been removed", "User made bookmarks were not removed with private data");
}
private void verifyHistoryCount(final int expectedCount) {
boolean match = waitForCondition(new Condition() {
@Override
public boolean isSatisfied() {
return mDatabaseHelper.getBrowserDBUrls(DatabaseHelper.BrowserDataType.HISTORY).size() == expectedCount;
}
}, TEST_WAIT_MS);
mAsserter.ok(match, "Checking that the number of history items is correct", String.valueOf(expectedCount) + " history items present in the database");
}
public void clearSiteSettings() {
String titleGeolocation = mStringHelper.ROBOCOP_GEOLOCATION_TITLE;
String url = getAbsoluteUrl(mStringHelper.ROBOCOP_GEOLOCATION_URL);
loadCheckDismiss(mStringHelper.GEO_ALLOW, url, mStringHelper.GEO_MESSAGE);
checkOption(mStringHelper.GEO_ALLOW, mStringHelper.CLEAR);
loadCheckDismiss(mStringHelper.GEO_DENY, url, mStringHelper.GEO_MESSAGE);
checkOption(mStringHelper.GEO_DENY, mStringHelper.CANCEL);
checkDevice(titleGeolocation, url);
}
public void clearPassword(){
String passwordStrings[] = { mStringHelper.LOGIN_MESSAGE, mStringHelper.LOGIN_ALLOW, mStringHelper.LOGIN_DENY };
String title = mStringHelper.ROBOCOP_BLANK_PAGE_01_TITLE;
String loginUrl = getAbsoluteUrl(mStringHelper.ROBOCOP_LOGIN_01_URL);
loadCheckDismiss(passwordStrings[1], loginUrl, passwordStrings[0]);
checkOption(mStringHelper.CONTEXT_MENU_SITE_SETTINGS_SAVE_PASSWORD, mStringHelper.CLEAR);
loadCheckDismiss(passwordStrings[2], loginUrl, passwordStrings[0]);
checkDevice(title, getAbsoluteUrl(mStringHelper.ROBOCOP_BLANK_PAGE_01_URL));
}
// clear private data and verify the device type because for phone there is an extra back action to exit the settings menu
public void checkDevice(final String title, final String url) {
clearPrivateData();
if (mDevice.type.equals("phone")) {
mSolo.goBack();
mAsserter.ok(waitForText(mStringHelper.PRIVACY_SECTION_LABEL), "waiting to perform one back", "one back");
}
mSolo.goBack();
verifyUrlBarTitle(url);
}
// Load a URL, verify that the doorhanger appears and dismiss it
public void loadCheckDismiss(String option, String url, String message) {
loadUrlAndWait(url);
waitForText(message);
mAsserter.is(mSolo.searchText(message), true, "Doorhanger:" + message + " has been displayed");
mSolo.clickOnButton(option);
mAsserter.is(mSolo.searchText(message), false, "Doorhanger:" + message + " has been hidden");
}
//Verify if there are settings to be clear if so clear them from the URL bar context menu
public void checkOption(String option, String button) {
if (mDevice.version.equals("2.x")) {
// Use the context menu in pre-11
final View toolbarView = mSolo.getView(R.id.browser_toolbar);
mSolo.clickLongOnView(toolbarView);
mAsserter.ok(waitForText(mStringHelper.CONTEXT_MENU_ITEMS_IN_URL_BAR[2]), "Waiting for the pop-up to open", "Pop up was opened");
} else {
// Use the Page menu in 11+
openSiteSecurityDoorHanger();
mAsserter.ok(waitForText(mStringHelper.CONTEXT_MENU_ITEMS_IN_URL_BAR[2]), "Waiting for the submenu to open for " + option + " on " + button, "Submenu was opened");
}
mSolo.clickOnText(mStringHelper.CONTEXT_MENU_ITEMS_IN_URL_BAR[2]);
mAsserter.ok(waitForText(option), "Verify that the option: " + option + " is in the list", "The option is in the list. There are settings to clear");
mSolo.clickOnButton(button);
}
private void openSiteSecurityDoorHanger() {
mSolo.waitForCondition(new Condition() {
@Override
public boolean isSatisfied() {
ImageView btn = (ImageView) mSolo.getView(R.id.favicon);
mSolo.clickOnView(btn);
return true;
}
}, TEST_WAIT_MS);
}
}

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

@ -1,230 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.tests;
import java.util.ArrayList;
import org.mozilla.gecko.AppConstants;
import org.mozilla.gecko.GeckoProfile;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;
import android.provider.Browser;
import com.jayway.android.robotium.solo.Condition;
/**
* This test covers the Import from Android feature
* The test will save the existing bookmarks and history then will do an Import
* After the import it will check that the bookmarks and history items from Android are imported
* Then it will test that the old data from Firefox is not lost
* At the end will test that a second import will not duplicate information
*/
public class testImportFromAndroid extends AboutHomeTest {
private static final int MAX_WAIT_TIMEOUT = 15000;
ArrayList<String> androidData = new ArrayList<String>();
ArrayList<String> firefoxHistory = new ArrayList<String>();
public void testImportFromAndroid() {
ArrayList<String> firefoxBookmarks = new ArrayList<String>();
ArrayList<String> oldFirefoxHistory = new ArrayList<String>();
ArrayList<String> oldFirefoxBookmarks = new ArrayList<String>();
blockForGeckoReady();
// Get the Android history
androidData = getAndroidUrls("history");
// Add some overlapping data from the Android Stock Browser to Firefox before import
addData();
// Get the initial bookmarks and history
oldFirefoxBookmarks = mDatabaseHelper.getBrowserDBUrls(DatabaseHelper.BrowserDataType.BOOKMARKS);
oldFirefoxHistory = mDatabaseHelper.getBrowserDBUrls(DatabaseHelper.BrowserDataType.HISTORY);
// Import the bookmarks and history
importDataFromAndroid();
// Get the Android history and the Firefox bookmarks and history lists
firefoxHistory = mDatabaseHelper.getBrowserDBUrls(DatabaseHelper.BrowserDataType.HISTORY);
firefoxBookmarks = mDatabaseHelper.getBrowserDBUrls(DatabaseHelper.BrowserDataType.BOOKMARKS);
/**
* Add a delay to make sure the imported items are added to the array lists
* if there are a lot of history items in the Android Browser database
*/
boolean success = waitForCondition(new Condition() {
@Override
public boolean isSatisfied() {
if (androidData.size() <= firefoxHistory.size()) {
return true;
} else {
return false;
}
}
}, MAX_WAIT_MS);
/**
* Verify the history and bookmarks are imported
* Android history also contains the android bookmarks so we don't need to get them separately here
*/
for (String url:androidData) {
mAsserter.ok(firefoxHistory.contains(url)||firefoxBookmarks.contains(url), "Checking if Android" + (firefoxBookmarks.contains(url) ? " Bookmark" : " History item") + " is present", url + " was imported");
}
// Verify the original Firefox Bookmarks are not deleted
for (String url:oldFirefoxBookmarks) {
mAsserter.ok(firefoxBookmarks.contains(url), "Checking if original Firefox Bookmark is present", " Firefox Bookmark " + url + " was not removed");
}
// Verify the original Firefox History is not deleted
for (String url:oldFirefoxHistory) {
mAsserter.ok(firefoxHistory.contains(url), "Checking original Firefox History item is present", " Firefox History item " + url + " was not removed");
}
// Import data again and make sure bookmarks are not duplicated
importDataFromAndroid();
// Verify bookmarks are not duplicated
ArrayList<String> verifiedBookmarks = new ArrayList<String>();
firefoxBookmarks = mDatabaseHelper.getBrowserDBUrls(DatabaseHelper.BrowserDataType.BOOKMARKS);
for (String url:firefoxBookmarks) {
if (verifiedBookmarks.contains(url)) {
mAsserter.ok(false, "Bookmark " + url + " should not be duplicated", "Bookmark is duplicated");
} else {
verifiedBookmarks.add(url);
mAsserter.ok(true, "Bookmark " + url + " was not duplicated", "Bookmark is unique");
}
}
// Verify history count is not increased after the second import
mAsserter.ok(firefoxHistory.size() == mDatabaseHelper.getBrowserDBUrls(DatabaseHelper.BrowserDataType.HISTORY).size(), "The number of history entries was not increased", "None of the items were duplicated");
}
private void addData() {
ArrayList<String> androidBookmarks = getAndroidUrls("bookmarks");
// Add a few Bookmarks from Android to Firefox Mobile
for (String url:androidBookmarks) {
// Add every 3rd bookmark to Firefox Mobile
if ((androidBookmarks.indexOf(url) % 3) == 0) {
mDatabaseHelper.addMobileBookmark("Bookmark Number" + String.valueOf(androidBookmarks.indexOf(url)), url);
}
}
// Add a few history items in Firefox Mobile
ContentResolver resolver = getActivity().getContentResolver();
Uri uri = Uri.parse("content://" + AppConstants.ANDROID_PACKAGE_NAME + ".db.browser/history");
uri = uri.buildUpon().appendQueryParameter("profile", GeckoProfile.DEFAULT_PROFILE)
.appendQueryParameter("sync", "true").build();
for (String url:androidData) {
// Add every 3rd website from Android History to Firefox Mobile
if ((androidData.indexOf(url) % 3) == 0) {
ContentValues values = new ContentValues();
values.put("title", "Page" + url);
values.put("url", url);
values.put("date", System.currentTimeMillis());
values.put("visits", androidData.indexOf(url));
resolver.insert(uri, values);
}
}
}
private void importDataFromAndroid() {
waitForText(mStringHelper.TITLE_PLACE_HOLDER);
selectSettingsItem(mStringHelper.CUSTOMIZE_SECTION_LABEL, mStringHelper.IMPORT_FROM_ANDROID_LABEL);
// Wait for the Import form Android pop-up to be opened. It has the same title as the option so waiting for the "Cancel" button
waitForText("Cancel");
mSolo.clickOnButton("Import");
// Wait until the import pop-up is dismissed. This depending on the number of items in the android history can take up to a few seconds
boolean importComplete = waitForCondition(new Condition() {
@Override
public boolean isSatisfied() {
return !mSolo.searchText("Please wait...");
}
}, MAX_WAIT_TIMEOUT);
mAsserter.ok(importComplete, "Waiting for import to finish and the pop-up to be dismissed", "Import was completed and the pop-up was dismissed");
// Import has finished. Waiting to get back to the Settings Menu and looking for the Import&Export subsection
if ("phone".equals(mDevice.type)) {
// Phones don't have headers like tablets, so we need to pop up one more level.
waitForText(mStringHelper.IMPORT_FROM_ANDROID_LABEL);
mSolo.goBack();
}
waitForText(mStringHelper.PRIVACY_SECTION_LABEL); // Settings is a header for the settings menu page. Waiting for Privacy ensures we are back in the top Settings view
mSolo.goBack(); // Exit Settings
// Make sure the settings menu has been closed.
mAsserter.ok(mSolo.waitForText(mStringHelper.TITLE_PLACE_HOLDER), "Waiting for search bar", "Search bar found");
}
public ArrayList<String> getAndroidUrls(String data) {
// Return bookmarks or history depending on what the user asks for
ArrayList<String> urls = new ArrayList<String>();
ContentResolver resolver = getActivity().getContentResolver();
Cursor cursor = null;
try {
if (data.equals("history")) {
cursor = getAllVisitedUrls(resolver);
} else if (data.equals("bookmarks")) {
cursor = getAllBookmarks(resolver);
}
if (cursor != null) {
cursor.moveToFirst();
for (int i = 0; i < cursor.getCount(); i++ ) {
urls.add(cursor.getString(cursor.getColumnIndex("url")));
if(!cursor.isLast()) {
cursor.moveToNext();
}
}
}
} finally {
if (cursor != null) {
cursor.close();
}
}
return urls;
}
public void deleteImportedData() {
// Bookmarks
ArrayList<String> androidBookmarks = getAndroidUrls("bookmarks");
for (String url:androidBookmarks) {
mDatabaseHelper.deleteBookmark(url);
}
// History
for (String url:androidData) {
mDatabaseHelper.deleteHistoryItem(url);
}
}
private static Cursor getAllVisitedUrls(ContentResolver resolver) {
final Uri authorityUri = Uri.parse("content://com.android.browser");
final Uri contentUri = Uri.withAppendedPath(authorityUri, "combined");
return resolver.query(contentUri,
new String[] { "url" }, null, null,
"created ASC");
}
private static Cursor getAllBookmarks(ContentResolver resolver) {
final Uri bookmarksUri = Uri.parse("content://browser/bookmarks");
return resolver.query(bookmarksUri,
new String[] { "url" },
"folder = 0", null, null);
}
@Override
public void tearDown() throws Exception {
deleteImportedData();
super.tearDown();
}
}

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

@ -1,230 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.tests;
import org.mozilla.gecko.Actions;
/* This patch tests the Master Password feature first by enabling the password,
then testing it on a login page and finally disabling the password */
public class testMasterPassword extends PixelTest {
Device dev;
public void testMasterPassword() {
blockForGeckoReady();
dev = new Device();
String password = ("Good");
String badPassword = ("Bad");
enableMasterPassword(password, badPassword);
verifyLoginPage(password, badPassword);
disableMasterPassword(password, badPassword);
}
public void enableMasterPassword(String password, String badPassword) {
// Look for the 'Settings' menu if this device/OS uses it
selectSettingsItem(mStringHelper.PRIVACY_SECTION_LABEL, mStringHelper.MASTER_PASSWORD_LABEL);
waitForText("^Create Master Password$");
// Verify that the OK button is not activated until both fields are filled
closeTabletKeyboard();
mAsserter.ok(!mSolo.getButton("OK").isEnabled(), "Verify if the OK button is inactive", "The OK button is inactive until both fields are filled");
// Verify that the OK button is not activated until the Confirm password field is filled
editPasswordField(0, password);
mAsserter.ok(!mSolo.getButton("OK").isEnabled(), "Verify if the OK button is inactive", "The OK button is inactive until the Confirm password field is filled");
// Verify that the OK button is not activated until both fields contain the same password
editPasswordField(1, badPassword);
mAsserter.ok(!mSolo.getButton("OK").isEnabled(), "Verify if the OK button is inactive", "The OK button is inactive until both fields contain the same password");
// Verify that the OK button is not activated until the Password field is filled
mSolo.clearEditText(0);
mAsserter.ok(!mSolo.getButton("OK").isEnabled(), "Verify if the OK button is inactive", "The OK button is inactive until the Password field is filled");
// Check that the Master Password is not set when canceling the action
mSolo.clickOnEditText(0);
mActions.sendKeys(password);
mSolo.clearEditText(1);
mSolo.clickOnEditText(1);
mActions.sendKeys(password);
waitForText("^Cancel$");
mSolo.clickOnText("^Cancel$");
waitForText("^" + mStringHelper.MASTER_PASSWORD_LABEL + "$");
mSolo.clickOnText("^" + mStringHelper.MASTER_PASSWORD_LABEL + "$");
mAsserter.ok(mSolo.waitForText("^Create Master Password$"), "Checking if no password was set if the action was canceled", "No password was set");
// Enable Master Password
mSolo.clickOnEditText(0);
mActions.sendKeys(password);
mSolo.clickOnEditText(1);
mActions.sendKeys(password);
// Verify that the input characters are converted to dots automatically
mAsserter.ok(waitForText("."), "waiting to convert the letters in dots", "The letters are converted in dots");
mSolo.clickOnButton("OK");
// Verify that the Master Password was set
mSolo.searchText("Privacy");
mAsserter.ok(mSolo.waitForText("^Use master password$"), "Checking if Use master password is present", "Use master password is present");
mSolo.clickOnText("^Use master password$");
mAsserter.ok(mSolo.waitForText("Remove Master Password"), "Checking if the password is enabled", "The password is enabled");
clickOnButton("Cancel"); // Go back to settings menu
if ("phone".equals(mDevice.type)) {
// Phones don't have headers like tablets, so we need to pop up one more level.
waitForText("Use master password");
mSolo.goBack();
}
waitForText(mStringHelper.SETTINGS_LABEL);
mSolo.goBack();// Close the Settings Menu
}
public void disableMasterPassword(String password, String badPassword) {
// Look for the 'Settings' menu if this device/OS uses it
selectSettingsItem(mStringHelper.PRIVACY_SECTION_LABEL, mStringHelper.MASTER_PASSWORD_LABEL);
waitForText("^Remove Master Password$");
// Verify that the OK button is not activated if the password field is empty
closeTabletKeyboard();
mAsserter.ok(!mSolo.getButton("OK").isEnabled(), "Verify if the OK button is inactive", "The OK button is inactive if the password field is empty");
// Verify that the OK button is activated if the password field contains characters
editPasswordField(0, badPassword);
mAsserter.ok(mSolo.getButton("OK").isEnabled(), "Verify if the OK button is activated", "The OK button is activated even if the wrong password is filled");
mSolo.clickOnButton("OK");
mAsserter.ok(mSolo.waitForText("^Incorrect password$"), "Waiting for Incorrect password notification", "The Incorrect password notification appears");
// Disable Master Password
mSolo.clickOnText("^Use master password$");
waitForText("^Remove Master Password$");
closeTabletKeyboard();
editPasswordField(0, password);
mSolo.clickOnButton("OK");
// Verify that the Master Password was disabled
mSolo.searchText("Privacy");
mAsserter.ok(mSolo.waitForText("^Use master password$"), "Checking if Use master password is present", "Use master password is present");
mSolo.clickOnText("^Use master password$");
mAsserter.ok(waitForText("^Create Master Password$"), "Checking if the password is disabled", "The password is disabled");
clickOnButton("Cancel"); // Go back to settings menu
}
public void editPasswordField(int i, String password) {
mSolo.clickOnEditText(i);
mActions.sendKeys(password);
toggleVKB(); // Don't use BACK; this will close the password dialog on devices with hardware keyboard.
}
public void noDoorhangerDisplayed(String LOGIN_URL) {
waitForText("Browser Blank Page 01|Enter Search or Address");
inputAndLoadUrl(LOGIN_URL);
mAsserter.is(waitForText("Save password for"), false, "Doorhanger notification is hidden");
}
public void doorhangerDisplayed(String LOGIN_URL) {
waitForText("Browser Blank Page 01|Enter Search or Address");
inputAndLoadUrl(LOGIN_URL);
mAsserter.is(mSolo.waitForText("Save password for"), true, "Doorhanger notification is displayed");
}
// Checks to see if the device is a Tablet, because for those devices we need an extra back action to close the keyboard
public void closeTabletKeyboard() {
if (dev.type.equals("tablet")) {
mSolo.sleep(1500);
toggleVKB();// Close the keyboard for tablets
}
}
@Override
public void clearPrivateData() {
// Look for the 'Settings' menu if this device/OS uses it
selectSettingsItem(mStringHelper.PRIVACY_SECTION_LABEL, mStringHelper.CLEAR_PRIVATE_DATA_LABEL);
waitForText("Browsing history"); // Make sure the Clear private data pop-up is displayed
Actions.EventExpecter clearPrivateDataEventExpecter = mActions.expectGeckoEvent("Sanitize:Finished");
if (mSolo.searchText("Clear data") && !mSolo.searchText("Cookies")) {
mSolo.clickOnText("^Clear data$");
clearPrivateDataEventExpecter.blockForEvent();
} else { // For some reason the pop-up was not opened
if (mSolo.searchText("Cookies")) {
mSolo.clickOnText("^Clear private data$");
waitForText("Browsing history"); // Make sure the Clear private data pop-up is displayed
mSolo.clickOnText("^Clear data$");
clearPrivateDataEventExpecter.blockForEvent();
} else {
mAsserter.ok(false, "Something happened and the clear data dialog could not be opened", "Failed to clear data");
}
}
// Check that the Master Password isn't disabled by clearing private data
waitForText("^Use master password$");
mSolo.clickOnText("^Use master password$");
mAsserter.ok(mSolo.searchText("^Remove Master Password$"), "Checking if the master password was disabled by clearing private data", "The master password is not disabled by clearing private data");
clickOnButton("Cancel"); // Close the Master Password menu
if ("phone".equals(mDevice.type)) {
// Phones don't have headers like tablets, so we need to pop up one more level.
waitForText("Use master password");
mSolo.goBack();
}
waitForText(mStringHelper.SETTINGS_LABEL);
mSolo.goBack();// Close the Settings Menu
// Make sure the settings menu has been closed.
mAsserter.ok(mSolo.waitForText("Browser Blank Page 01"), "Waiting for blank browser page after exiting settings", "Blank browser page present");
}
public void verifyLoginPage(String password, String badPassword) {
String LOGIN_URL = getAbsoluteUrl(mStringHelper.ROBOCOP_LOGIN_01_URL);
String option [] = {"Save", "Don't save"};
doorhangerDisplayed(LOGIN_URL);// Check that the doorhanger is displayed
// TODO: Remove this hack -- see bug 915449
mSolo.sleep(2000);
for (String item:option) {
if (item.equals("Save")) {
final String OK_BUTTON_LABEL = "^OK$";
final String SAVE_BUTTON_LABEL = "^Save$";
mAsserter.ok(mSolo.waitForText(SAVE_BUTTON_LABEL), "Checking if Save option is present", "Save option is present");
mSolo.clickOnButton(SAVE_BUTTON_LABEL);
// Verify that the Master Password isn't deactivated when the password field is empty
closeTabletKeyboard();
waitForText(OK_BUTTON_LABEL);
mSolo.clickOnButton(OK_BUTTON_LABEL);
// Verify that the Master Password isn't deactivated when using the wrong password
closeTabletKeyboard();
editPasswordField(0, badPassword);
waitForText(OK_BUTTON_LABEL);
mSolo.clickOnButton(OK_BUTTON_LABEL);
// Verify that the Master Password is deactivated when using the right password
closeTabletKeyboard();
editPasswordField(0, password);
waitForText(OK_BUTTON_LABEL);
mSolo.clickOnButton(OK_BUTTON_LABEL);
// Verify that the Master Password is triggered once per session
noDoorhangerDisplayed(LOGIN_URL);// Check that the doorhanger isn't displayed
} else {
clearPrivateData();
doorhangerDisplayed(LOGIN_URL);// Check that the doorhanger is displayed
mAsserter.ok(mSolo.waitForText("Don't save"), "Checking if Don't save option is present again", "Don't save option is present again");
mSolo.clickOnText("Don't save");
doorhangerDisplayed(LOGIN_URL);// Check that the doorhanger is displayed again
mAsserter.ok(mSolo.waitForText("Don't save"), "Checking if Don't save option is present again", "Don't save option is present again");
mSolo.clickOnText("Don't save");
// Make sure the settings menu has been closed.
mAsserter.ok(mSolo.waitForText("Browser Blank Page 01"), "Waiting for blank browser page after exiting settings", "Blank browser page present");
}
}
}
}

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

@ -1,307 +0,0 @@
package org.mozilla.gecko.tests;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.mozilla.gecko.R;
import org.mozilla.gecko.Actions;
import org.mozilla.gecko.AppConstants;
import org.mozilla.gecko.tabqueue.TabQueueHelper;
import org.mozilla.gecko.util.HardwareUtils;
import org.mozilla.gecko.util.InputOptionsUtils;
/** This patch tests the Sections present in the Settings Menu and the
* default values for them
*/
public class testSettingsMenuItems extends PixelTest {
// Customize menu items.
String[] PATH_CUSTOMIZE;
String[][] OPTIONS_CUSTOMIZE;
// Home panel menu items.
String[] PATH_HOME;
String[][] OPTIONS_HOME;
// Display menu items.
String[] PATH_DISPLAY;
String[] TITLE_BAR_LABEL_ARR;
String[][] OPTIONS_DISPLAY;
// Privacy menu items.
String[] PATH_PRIVACY;
String[][] OPTIONS_PRIVACY;
// Mozilla/vendor menu items.
String[] PATH_MOZILLA;
String[][] OPTIONS_MOZILLA;
// Developer menu items.
String[] PATH_DEVELOPER;
String[][] OPTIONS_DEVELOPER;
/*
* This sets up a hierarchy of settings to test.
*
* The keys are String arrays representing the path through menu items
* (the single-item arrays being top-level categories), and each value
* is a List of menu items contained within each category.
*
* Each menu item is itself an array as follows:
* - item title
* - default string value of item (optional)
* - string values of options that are displayed once clicked (optional).
*/
public void setupSettingsMap(Map<String[], List<String[]>> settingsMap) {
/**
* The following String[][] (arrays) match the menu hierarchy for each section.
* Each String[] (array) represents the menu items/choices in the following order:
*
* itemTitle { defaultValue [options] }
*
* where defaultValue is optional, and there can be multiple options.
*
* These menu items are the ones that are always present - to test menu items that differ
* based on build (e.g., release vs. nightly), add the items in <code>addConditionalSettings</code>.
*/
PATH_CUSTOMIZE = new String[] { mStringHelper.CUSTOMIZE_SECTION_LABEL };
OPTIONS_CUSTOMIZE = new String[][] {
{ mStringHelper.CUSTOMIZE_HOME},
{ mStringHelper.SEARCH_TITLE, "", mStringHelper.SEARCH_SUGGESTIONS, mStringHelper.SEARCH_INSTALLED},
{ mStringHelper.TABS_LABEL, mStringHelper.DONT_RESTORE_TABS, mStringHelper.ALWAYS_RESTORE_TABS, mStringHelper.DONT_RESTORE_QUIT },
{ mStringHelper.IMPORT_FROM_ANDROID_LABEL, "", mStringHelper.BOOKMARKS, mStringHelper.HISTORY, mStringHelper.IMPORT },
};
PATH_HOME = new String[] { mStringHelper.CUSTOMIZE_SECTION_LABEL, mStringHelper.CUSTOMIZE_HOME };
OPTIONS_HOME = new String[][] {
{ mStringHelper.PANELS },
{ mStringHelper.AUTOMATIC_UPDATES, mStringHelper.ENABLED, mStringHelper.ENABLED, mStringHelper.OVER_WIFI_OPTION},
};
PATH_DISPLAY = new String[] { mStringHelper.DISPLAY_SECTION_LABEL };
TITLE_BAR_LABEL_ARR = new String[] { mStringHelper.TITLE_BAR_LABEL, mStringHelper.SHOW_PAGE_ADDRESS_LABEL,
mStringHelper.SHOW_PAGE_TITLE_LABEL, mStringHelper.SHOW_PAGE_ADDRESS_LABEL };
OPTIONS_DISPLAY = new String[][] {
{ mStringHelper.TEXT_SIZE_LABEL },
TITLE_BAR_LABEL_ARR,
{ mStringHelper.SCROLL_TITLE_BAR_LABEL, mStringHelper.HIDE_TITLE_BAR },
{ mStringHelper.ADVANCED},
{ mStringHelper.CHARACTER_ENCODING_LABEL, mStringHelper.DONT_SHOW_MENU, mStringHelper.SHOW_MENU, mStringHelper.DONT_SHOW_MENU },
{ mStringHelper.PLUGINS_LABEL, mStringHelper.TAP_TO_PLAY, mStringHelper.ENABLED, mStringHelper.TAP_TO_PLAY, mStringHelper.DISABLED },
};
PATH_PRIVACY = new String[] { mStringHelper.PRIVACY_SECTION_LABEL };
OPTIONS_PRIVACY = new String[][] {
{ mStringHelper.TRACKING_PROTECTION_LABEL },
{ mStringHelper.DNT_LABEL },
{ mStringHelper.COOKIES_LABEL, mStringHelper.ENABLED, mStringHelper.ENABLED_EXCLUDE_3RD_PARTY, mStringHelper.ENABLED },
{ mStringHelper.REMEMBER_LOGINS_LABEL },
{ mStringHelper.MANAGE_LOGINS_LABEL },
{ mStringHelper.MASTER_PASSWORD_LABEL },
{ mStringHelper.CLEAR_PRIVATE_DATA_LABEL, "", mStringHelper.BROWSING_HISTORY,
mStringHelper.SEARCH_HISTORY, mStringHelper.DOWNLOADS, mStringHelper.FORM_HISTORY,
mStringHelper.COOKIES_AND_LOGINS, mStringHelper.CLEAR_PRIVATE_DATA_LABEL, mStringHelper.CACHE,
mStringHelper.OFFLINE_DATA, mStringHelper.SITE_SETTINGS, mStringHelper.CLEAR_DATA_BUTTON },
};
PATH_MOZILLA = new String[] { mStringHelper.MOZILLA_SECTION_LABEL };
OPTIONS_MOZILLA = new String[][] {
{ mStringHelper.ABOUT_LABEL },
{ mStringHelper.FAQS_LABEL },
{ mStringHelper.FEEDBACK_LABEL },
{ mStringHelper.DATA_CHOICES },
{ mStringHelper.HEALTH_REPORT_LABEL, mStringHelper.HEALTH_REPORT_EXPLANATION },
{ mStringHelper.MY_HEALTH_REPORT_LABEL },
};
PATH_DEVELOPER = new String[] { mStringHelper.DEVELOPER_TOOLS_SECTION_LABEL };
OPTIONS_DEVELOPER = new String[][] {
{ mStringHelper.REMOTE_DEBUGGING_USB_LABEL },
{ mStringHelper.LEARN_MORE_LABEL },
{ mStringHelper.REMOTE_DEBUGGING_WIFI_LABEL },
{ mStringHelper.LEARN_MORE_LABEL },
};
settingsMap.put(PATH_CUSTOMIZE, new ArrayList<String[]>(Arrays.asList(OPTIONS_CUSTOMIZE)));
settingsMap.put(PATH_HOME, new ArrayList<String[]>(Arrays.asList(OPTIONS_HOME)));
settingsMap.put(PATH_DISPLAY, new ArrayList<String[]>(Arrays.asList(OPTIONS_DISPLAY)));
settingsMap.put(PATH_PRIVACY, new ArrayList<String[]>(Arrays.asList(OPTIONS_PRIVACY)));
settingsMap.put(PATH_MOZILLA, new ArrayList<String[]>(Arrays.asList(OPTIONS_MOZILLA)));
settingsMap.put(PATH_DEVELOPER, new ArrayList<String[]>(Arrays.asList(OPTIONS_DEVELOPER)));
}
public void testSettingsMenuItems() {
blockForGeckoReady();
Map<String[], List<String[]>> settingsMenuItems = new HashMap<String[], List<String[]>>();
setupSettingsMap(settingsMenuItems);
// Set special handling for Settings items that are conditionally built.
updateConditionalSettings(settingsMenuItems);
selectMenuItem(mStringHelper.SETTINGS_LABEL);
mAsserter.ok(mSolo.waitForText(mStringHelper.SETTINGS_LABEL),
"The Settings menu did not load", mStringHelper.SETTINGS_LABEL);
// Dismiss the Settings screen and verify that the view is returned to about:home page
mSolo.goBack();
// Waiting for page title to appear to be sure that is fully loaded before opening the menu
mAsserter.ok(mSolo.waitForText(mStringHelper.TITLE_PLACE_HOLDER), "about:home did not load",
mStringHelper.TITLE_PLACE_HOLDER);
selectMenuItem(mStringHelper.SETTINGS_LABEL);
mAsserter.ok(mSolo.waitForText(mStringHelper.SETTINGS_LABEL),
"The Settings menu did not load", mStringHelper.SETTINGS_LABEL);
checkForSync(mDevice);
checkMenuHierarchy(settingsMenuItems);
}
/**
* Check for Sync in settings.
*
* Sync location is a top level menu item on phones and small tablets,
* but is under "Customize" on large tablets.
*/
public void checkForSync(Device device) {
mAsserter.ok(mSolo.waitForText(mStringHelper.SYNC_LABEL), "Waiting for Sync option",
mStringHelper.SYNC_LABEL);
}
/**
* Check for conditions for building certain settings, and add them to be tested
* if they are present.
*/
public void updateConditionalSettings(Map<String[], List<String[]>> settingsMap) {
// Preferences dependent on RELEASE_BUILD
if (!AppConstants.RELEASE_BUILD) {
if (AppConstants.MOZ_STUMBLER_BUILD_TIME_ENABLED) {
// Anonymous cell tower/wifi collection
String[] networkReportingUi = { mStringHelper.MOZ_LOCATION, mStringHelper.MOZ_LOCATION_MSG };
settingsMap.get(PATH_MOZILLA).add(networkReportingUi);
String[] learnMoreUi = { mStringHelper.LEARN_MORE };
settingsMap.get(PATH_MOZILLA).add(learnMoreUi);
}
}
// Automatic updates
if (AppConstants.MOZ_UPDATER) {
String[] autoUpdateUi = { mStringHelper.DOWNLOAD_UPDATES_AUTO, mStringHelper.OVER_WIFI_OPTION, mStringHelper.ALWAYS, mStringHelper.OVER_WIFI_OPTION, mStringHelper.NEVER };
settingsMap.get(PATH_CUSTOMIZE).add(autoUpdateUi);
}
// Tab Queue
if (TabQueueHelper.TAB_QUEUE_ENABLED) {
final String[] tabQueue = { mStringHelper.TAB_QUEUE_LABEL, mStringHelper.TAB_QUEUE_SUMMARY };
settingsMap.get(PATH_CUSTOMIZE).add(tabQueue);
}
// Crash reporter
if (AppConstants.MOZ_CRASHREPORTER) {
String[] crashReporterUi = { mStringHelper.CRASH_REPORTER, mStringHelper.CRASH_REPORTER_MSG};
settingsMap.get(PATH_MOZILLA).add(crashReporterUi);
}
// Telemetry
if (AppConstants.MOZ_TELEMETRY_REPORTING) {
String[] telemetryUi = { mStringHelper.TELEMETRY, mStringHelper.TELEMETRY_MSG};
settingsMap.get(PATH_MOZILLA).add(telemetryUi);
}
// Tablet: we don't allow a page title option.
if (HardwareUtils.isTablet()) {
settingsMap.get(PATH_DISPLAY).remove(TITLE_BAR_LABEL_ARR);
}
// Voice input
if (InputOptionsUtils.supportsVoiceRecognizer(this.getActivity().getApplicationContext(), this.getActivity().getResources().getString(R.string.voicesearch_prompt))) {
String[] voiceInputUi = { mStringHelper.VOICE_INPUT_TITLE_LABEL, mStringHelper.VOICE_INPUT_SUMMARY_LABEL };
settingsMap.get(PATH_DISPLAY).add(voiceInputUi);
}
// QR Code input
if (InputOptionsUtils.supportsQrCodeReader(this.getActivity().getApplicationContext())) {
String[] qrCodeInputUi = { mStringHelper.QRCODE_INPUT_TITLE_LABEL, mStringHelper.QRCODE_INPUT_SUMMARY_LABEL };
settingsMap.get(PATH_DISPLAY).add(qrCodeInputUi);
}
}
public void checkMenuHierarchy(Map<String[], List<String[]>> settingsMap) {
// Check the items within each category.
String section = null;
for (Entry<String[], List<String[]>> e : settingsMap.entrySet()) {
final String[] menuPath = e.getKey();
for (String menuItem : menuPath) {
section = "^" + menuItem + "$";
waitForEnabledText(section);
mSolo.clickOnText(section);
}
List<String[]> sectionItems = e.getValue();
// Check each item of the section.
for (String[] item : sectionItems) {
int itemLen = item.length;
// Each item must at least have a title.
mAsserter.ok(item.length > 0, "Section-item", "Each item must at least have a title");
// Check item title.
String itemTitle = "^" + item[0] + "$";
boolean foundText = waitForPreferencesText(itemTitle);
mAsserter.ok(foundText, "Waiting for settings item " + itemTitle + " in section " + section,
"The " + itemTitle + " option is present in section " + section);
// Check item default, if it exists.
if (itemLen > 1) {
String itemDefault = "^" + item[1] + "$";
foundText = waitForPreferencesText(itemDefault);
mAsserter.ok(foundText, "Waiting for settings item default " + itemDefault
+ " in section " + section,
"The " + itemDefault + " default is present in section " + section);
}
// Check item choices, if they exist.
if (itemLen > 2) {
waitForEnabledText(itemTitle);
mSolo.clickOnText(itemTitle);
for (int i = 2; i < itemLen; i++) {
String itemChoice = "^" + item[i] + "$";
foundText = waitForPreferencesText(itemChoice);
mAsserter.ok(foundText, "Waiting for settings item choice " + itemChoice
+ " in section " + section,
"The " + itemChoice + " choice is present in section " + section);
}
// Leave submenu after checking.
if (waitForText("^Cancel$")) {
mSolo.clickOnText("^Cancel$");
} else {
// Some submenus aren't dialogs, but are nested screens; exit using "back".
mSolo.goBack();
}
}
}
// Navigate back if on a phone or small tablets. Large tablets
// shouldn't do this because they use headers and fragments.
if (mDevice.type.equals("phone") || HardwareUtils.isSmallTablet()) {
int menuDepth = menuPath.length;
while (menuDepth > 0) {
mSolo.goBack();
menuDepth--;
// Sleep so subsequent back actions aren't lost.
mSolo.sleep(150);
}
}
}
}
}

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

@ -1,94 +0,0 @@
package org.mozilla.gecko.tests;
import org.mozilla.gecko.Actions;
import org.mozilla.gecko.AppConstants;
/** This patch tests the System Pages first by loading system pages from
* the awesome bar and then from Firefox menu
*/
public class testSystemPages extends PixelTest {
final int mExpectedTabCount = 1;
private static final int AFTER_BACK_SLEEP_MS = 500;
public void testSystemPages() {
blockForGeckoReady();
final String urls [] = { mStringHelper.ABOUT_FIREFOX_URL, mStringHelper.ABOUT_RIGHTS_URL,
mStringHelper.ABOUT_ADDONS_URL, mStringHelper.ABOUT_DOWNLOADS_URL, StringHelper.ABOUT_LOGINS_URL,
mStringHelper.ABOUT_BUILDCONFIG_URL, mStringHelper.ABOUT_FEEDBACK_URL,
mStringHelper.ABOUT_HEALTHREPORT_URL, mStringHelper.ABOUT_SCHEME
};
// Pages to be tested from the menu and their expected urls. This if of the form { {{ <path to item> }, { <expected url> }}* }
String menuItems [][][] = {{{ mStringHelper.DOWNLOADS_LABEL }, { mStringHelper.ABOUT_DOWNLOADS_URL}},
{{ mStringHelper.LOGINS_LABEL}, { StringHelper.ABOUT_LOGINS_URL }},
{{ mStringHelper.ADDONS_LABEL }, { mStringHelper.ABOUT_ADDONS_URL }},
{{ mStringHelper.SETTINGS_LABEL, mStringHelper.MOZILLA_SECTION_LABEL, mStringHelper.ABOUT_LABEL }, { mStringHelper.ABOUT_SCHEME }},
{{ mStringHelper.SETTINGS_LABEL, mStringHelper.MOZILLA_SECTION_LABEL, mStringHelper.FEEDBACK_LABEL }, { mStringHelper.ABOUT_FEEDBACK_URL }},
{{ mStringHelper.SETTINGS_LABEL, mStringHelper.MOZILLA_SECTION_LABEL, mStringHelper.MY_HEALTH_REPORT_LABEL }, { mStringHelper.ABOUT_HEALTHREPORT_URL }}};
/* Load system pages from url and check that the pages are loaded in the same tab */
checkUrl(urls);
/* Verify that the search field is not in the focus by pressing back. That will load the previous
about: page if there is no the keyboard to dismiss, meaning that the search field was not in focus */
loadAndPaint(mStringHelper.ABOUT_ABOUT_URL);
// Press back to verify if the keyboard is dismissed or the previous about: page loads
mSolo.goBack();
// may not get a paint on Back...pause briefly to make sure it completes
mSolo.sleep(AFTER_BACK_SLEEP_MS);
// We will use the "about:" page as our reference page.
loadAndPaint(mStringHelper.ABOUT_SCHEME);
verifyUrl(mStringHelper.ABOUT_SCHEME); // Verify that the previous about: page is loaded, meaning no keyboard was present
// Load system pages by navigating through the UI.
loadItemsByLevel(menuItems);
}
// Load from Url the about: pages,verify the Url and the tabs number
public void checkUrl(String urls []) {
for (String url:urls) {
loadAndPaint(url);
verifyTabCount(mExpectedTabCount);
verifyUrl(url);
}
}
public void loadItemsByLevel(String[][][] menuItems) {
Actions.EventExpecter tabEventExpecter;
Actions.EventExpecter contentEventExpecter;
Actions.RepeatedEventExpecter paintExpecter = mActions.expectPaint();
int expectedTabCount = mExpectedTabCount;
// There's some special casing for about: because it's our starting page.
for (String[][] item : menuItems) {
String [] pathToItem = item[0];
String expectedUrl = item[1][0];
expectedTabCount++;
// Set up listeners to catch the page load we're about to do
tabEventExpecter = mActions.expectGeckoEvent("Tab:Added");
contentEventExpecter = mActions.expectGeckoEvent("DOMContentLoaded");
selectMenuItemByPath(pathToItem);
// Wait for the new tab and page to load
if (mStringHelper.ABOUT_SCHEME.equals(expectedUrl)) {
waitForPaint(paintExpecter); // Waiting for the page to load
paintExpecter.unregisterListener();
} else {
tabEventExpecter.blockForEvent();
contentEventExpecter.blockForEvent();
}
tabEventExpecter.unregisterListener();
contentEventExpecter.unregisterListener();
verifyUrl(expectedUrl);
if (mStringHelper.ABOUT_SCHEME.equals(expectedUrl)) {
// Decreasing because we do not expect this to be in a different tab.
expectedTabCount--;
}
verifyTabCount(expectedTabCount);
}
}
}

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

@ -1,57 +0,0 @@
package org.mozilla.gecko.tests;
import org.mozilla.gecko.util.HardwareUtils;
/**
* This patch tests the option that shows the full URL and title in the URL Bar
*/
public class testTitleBar extends PixelTest {
public void testTitleBar() {
// Because there is no title bar option on new tablet, we don't need to run this test.
if (HardwareUtils.isTablet()) {
return;
}
blockForGeckoReady();
checkOption();
}
public void checkOption() {
String blank1 = getAbsoluteUrl(mStringHelper.ROBOCOP_BLANK_PAGE_01_URL);
String title = mStringHelper.ROBOCOP_BLANK_PAGE_01_TITLE;
// Loading a page
loadUrlAndWait(blank1);
verifyUrlBarTitle(blank1);
// Ensure the title is displayed in the URL Bar
selectOption(mStringHelper.SHOW_PAGE_TITLE_LABEL);
loadUrlAndWait(blank1);
verifyUrlBarTitle(title);
// Ensure the full URL is displayed in the URL Bar
selectOption(mStringHelper.SHOW_PAGE_ADDRESS_LABEL);
loadUrlAndWait(blank1);
verifyUrlBarTitle(blank1);
}
// Entering settings, changing the options: show title/page address option and verifing the device type because for phone there is an extra back action to exit the settings menu
public void selectOption(String option) {
selectSettingsItem(mStringHelper.DISPLAY_SECTION_LABEL, mStringHelper.TITLE_BAR_LABEL);
mAsserter.ok(waitForText(mStringHelper.SHOW_PAGE_TITLE_LABEL), "Waiting for the pop-up to open", "Pop up with the options was openend");
mSolo.clickOnText(option);
mAsserter.ok(waitForText(mStringHelper.CHARACTER_ENCODING_LABEL), "Waiting to press the option", "The pop-up is dismissed once clicked");
if (mDevice.type.equals("phone")) {
mSolo.goBack();
mAsserter.ok(waitForText(mStringHelper.CUSTOMIZE_SECTION_LABEL), "Waiting to perform one back", "One back performed");
mSolo.goBack();
mAsserter.ok(waitForText(mStringHelper.ROBOCOP_BLANK_PAGE_01_URL), "Waiting to exit settings", "Exit settings done");
}
else {
mSolo.goBack();
mAsserter.ok(waitForText(mStringHelper.ROBOCOP_BLANK_PAGE_01_URL), "Waiting to exit settings", "Exit settings done");
}
}
}

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

@ -1,10 +1,12 @@
#!/bin/bash
usage() {
echo "Usage: $0 GECKO_DIR GAIA_DIR MULET_TARBALL_URL"
echo "Usage: $0 GECKO_DIR GAIA_DIR MULET_TARBALL_URL [--release]"
echo " --release"
echo " use xpi name with version and platform"
}
if [ "$#" -ne 3 ]; then
if [ "$#" -lt 3 ]; then
usage
exit
fi
@ -23,30 +25,30 @@ if [ -z $2 ] || [ ! -d $2 ]; then
fi
GAIA_DIR=$2
url_re='^(http|https|ftp)://.*tar.bz2'
if [ -z $3 ] || ! [[ $3 =~ $url_re ]] ; then
url_re='^(http|https|ftp)://.*(tar.bz2|zip|dmg)'
if [ -z $3 ] || ! [[ $3 =~ $url_re ]] && ! [ -f $3 ] ; then
usage
echo "Third argument should be URL to mulet tarball"
echo "Third argument should be URL or a path to mulet tarball"
exit
fi
BUILD_URL=$3
MULET=$3
set -ex
RELEASE=
if [ "$4" == "--release" ]; then
RELEASE=1
fi
WORKDIR=simulator
SIM_DIR=$GECKO_DIR/b2g/simulator
if [[ $BUILD_URL =~ 'linux-x86_64' ]] ; then
if [[ $MULET =~ 'linux-x86_64' ]] ; then
PLATFORM=linux64
elif [[ $BUILD_URL =~ 'linux' ]] ; then
elif [[ $MULET =~ 'linux' ]] ; then
PLATFORM=linux
elif [[ $BUILD_URL =~ 'win32' ]] ; then
elif [[ $MULET =~ 'win32' ]] ; then
PLATFORM=win32
elif [[ $BUILD_URL =~ 'mac64' ]] ; then
elif [[ $MULET =~ 'mac64' ]] ; then
PLATFORM=mac64
fi
if [ -z $PLATFORM ]; then
echo "Unable to compute platform out of mulet URL: $BUILD_URL"
echo "Unable to compute platform out of mulet package filename: $MULET"
exit
fi
echo "PLATFORM: $PLATFORM"
@ -59,16 +61,74 @@ if ! [[ $VERSION =~ $re ]] ; then
fi
echo "B2G VERSION: $VERSION"
mkdir -p $WORKDIR
set -ex
if [ ! -f mulet.tar.bz2 ]; then
wget -O mulet.tar.bz2 $BUILD_URL
WORK_DIR=simulator
rm -rf $WORK_DIR/
mkdir -p $WORK_DIR
# If mulet isn't a file, that's an URL and needs to be downloaded first
if [ ! -f $MULET ]; then
URL=$MULET
MULET=$WORK_DIR/$(basename $URL)
wget -O $MULET $URL
fi
(cd $WORKDIR/ && tar jxvf ../mulet.tar.bz2)
# Not sure it is still useful with mulet...
# remove useless stuff we don't want to ship in simulators
rm -rf $WORKDIR/firefox/gaia $WORKDIR/firefox/B2G.app/Contents/MacOS/gaia $WORKDIR/firefox/B2G.app/Contents/Resources/gaia
# Compute absolute path for all path variables
realpath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}
MULET=$(realpath $MULET)
WORK_DIR=$(realpath $WORK_DIR)
GAIA_DIR=$(realpath $GAIA_DIR)
GECKO_DIR=$(realpath $GECKO_DIR)
SIM_DIR=$(realpath $GECKO_DIR/b2g/simulator)
ADDON_DIR=$(realpath $WORK_DIR/addon)
mkdir -p $ADDON_DIR
# Uncompress the Mulet package
if [[ $MULET =~ .dmg$ ]]; then
mkdir -p $WORK_DIR/dmg
if [ "$(uname)" == "Darwin" ]; then
hdiutil attach -verbose -noautoopen -mountpoint $WORK_DIR/dmg "$MULET"
# Wait for files to show up
# hdiutil uses a helper process, diskimages-helper, which isn't always done its
# work by the time hdiutil exits. So we wait until something shows up in the
# mnt directory. Due to the async nature of diskimages-helper, the best thing
# we can do is to make sure the glob() rsync is making can find files.
i=0
TIMEOUT=900
while [ "$(echo $WORK_DIR/dmg/*)" == "$WORK_DIR/dmg/*" ]; do
if [ $i -gt $TIMEOUT ]; then
echo "Unable to mount dmg file."
exit 1
fi
sleep 1
i=$(expr $i + 1)
done
# Now we can copy everything out of the $MOUNTPOINT directory into the target directory
mkdir -p $ADDON_DIR/firefox
cp -r $WORK_DIR/dmg/FirefoxNightly.app $ADDON_DIR/firefox/
hdiutil detach $WORK_DIR/DMG
else
7z x -o$WORK_DIR/dmg $MULET
mkdir -p $WORK_DIR/dmg/hfs
sudo mount -o loop,ro -t hfsplus $WORK_DIR/dmg/2.hfs $WORK_DIR/dmg/hfs
mkdir -p $ADDON_DIR/firefox
cp -r $WORK_DIR/dmg/hfs/FirefoxNightly.app $ADDON_DIR/firefox/
sudo umount $WORK_DIR/dmg/hfs
fi
rm -rf $WORK_DIR/dmg
elif [[ $MULET =~ .zip$ ]]; then
unzip $MULET -d $ADDON_DIR/
elif [[ $MULET =~ .tar.bz2 ]]; then
(cd $ADDON_DIR/ && tar jxvf $MULET)
else
echo "Unsupported file extension for $MULET"
exit
fi
# Build a gaia profile specific to the simulator in order to:
# - disable the FTU
@ -76,10 +136,18 @@ rm -rf $WORKDIR/firefox/gaia $WORKDIR/firefox/B2G.app/Contents/MacOS/gaia $WORKD
# - set custom settings to disable lockscreen and screen timeout
# - only ship production apps
NOFTU=1 GAIA_APP_TARGET=production SETTINGS_PATH=$SIM_DIR/custom-settings.json make -j1 -C $GAIA_DIR profile
mv $GAIA_DIR/profile $WORKDIR/
cat $SIM_DIR/custom-prefs.js >> $WORKDIR/profile/user.js
mv $GAIA_DIR/profile $ADDON_DIR/
cat $SIM_DIR/custom-prefs.js >> $ADDON_DIR/profile/user.js
MOZ_APP_BUILDID=$(sed -n "s/BuildID=\([0-9]\{8\}\)/\1/p" $WORKDIR/firefox/application.ini)
if [ -f $ADDON_DIR/firefox/application.ini ]; then
APPLICATION_INI=$ADDON_DIR/firefox/application.ini
elif [ -f $ADDON_DIR/firefox/FirefoxNightly.app/Contents/Resources/application.ini ]; then
APPLICATION_INI=$ADDON_DIR/firefox/FirefoxNightly.app/Contents/Resources/application.ini
else
echo "Unable to find application.ini file"
exit
fi
MOZ_APP_BUILDID=$(sed -n "s/BuildID=\([0-9]\{8\}\)/\1/p" $APPLICATION_INI)
echo "BUILDID $MOZ_APP_BUILDID -- VERSION $VERSION"
XPI_NAME=fxos-simulator-$VERSION.$MOZ_APP_BUILDID-$PLATFORM.xpi
@ -102,12 +170,17 @@ sed -e "s/@ADDON_VERSION@/$ADDON_VERSION/" \
-e "s#@ADDON_UPDATE_URL@#$UPDATE_URL#" \
-e "s/@ADDON_NAME@/$ADDON_NAME/" \
-e "s/@ADDON_DESCRIPTION@/$ADDON_DESCRIPTION/" \
$SIM_DIR/install.rdf.in > $WORKDIR/install.rdf
$SIM_DIR/install.rdf.in > $ADDON_DIR/install.rdf
# copy all useful addon file
cp $SIM_DIR/icon.png $WORKDIR/
cp $SIM_DIR/icon64.png $WORKDIR/
cp $SIM_DIR/icon.png $ADDON_DIR/
cp $SIM_DIR/icon64.png $ADDON_DIR/
# Create the final zip .xpi file
mkdir -p artifacts
(cd $WORKDIR && zip -r - .) > artifacts/fxos-simulator.xpi
FILE_NAME=fxos-simulator.xpi
if [ "$RELEASE" ]; then
FILE_NAME=$XPI_NAME
fi
(cd $ADDON_DIR && zip -r - .) > artifacts/$FILE_NAME

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

@ -89,6 +89,9 @@
"@mozilla.org/updates/update-processor;1"
#endif
#define NS_ADDONCONTENTPOLICY_CONTRACTID \
"@mozilla.org/addons/content-policy;1"
#define NS_ADDONPATHSERVICE_CONTRACTID \
"@mozilla.org/addon-path-service;1"
@ -178,5 +181,8 @@
#define NS_APPLICATION_REPUTATION_SERVICE_CID \
{ 0x8576c950, 0xf4a2, 0x11e2, { 0xb7, 0x78, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 } }
#define NS_ADDONCONTENTPOLICY_CID \
{ 0xc26a8241, 0xecf4, 0x4aed, { 0x9f, 0x3c, 0xf1, 0xf5, 0xc7, 0x13, 0xb9, 0xa5 } }
#define NS_ADDON_PATH_SERVICE_CID \
{ 0xa39f39d0, 0xdfb6, 0x11e3, { 0x8b, 0x68, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 } }

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

@ -36,6 +36,7 @@
#include "nsBrowserStatusFilter.h"
#include "mozilla/FinalizationWitnessService.h"
#include "mozilla/NativeOSFileInternals.h"
#include "mozilla/AddonContentPolicy.h"
#include "mozilla/AddonPathService.h"
#if defined(XP_WIN)
@ -125,6 +126,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(FinalizationWitnessService, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(NativeOSFileInternalsService)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(NativeFileWatcherService, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(AddonContentPolicy)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(AddonPathService, AddonPathService::GetInstance)
NS_DEFINE_NAMED_CID(NS_TOOLKIT_APPSTARTUP_CID);
@ -158,6 +160,7 @@ NS_DEFINE_NAMED_CID(NS_UPDATEPROCESSOR_CID);
#endif
NS_DEFINE_NAMED_CID(FINALIZATIONWITNESSSERVICE_CID);
NS_DEFINE_NAMED_CID(NATIVE_OSFILE_INTERNALS_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_ADDONCONTENTPOLICY_CID);
NS_DEFINE_NAMED_CID(NS_ADDON_PATH_SERVICE_CID);
NS_DEFINE_NAMED_CID(NATIVE_FILEWATCHER_SERVICE_CID);
@ -192,6 +195,7 @@ static const Module::CIDEntry kToolkitCIDs[] = {
#endif
{ &kFINALIZATIONWITNESSSERVICE_CID, false, nullptr, FinalizationWitnessServiceConstructor },
{ &kNATIVE_OSFILE_INTERNALS_SERVICE_CID, false, nullptr, NativeOSFileInternalsServiceConstructor },
{ &kNS_ADDONCONTENTPOLICY_CID, false, nullptr, AddonContentPolicyConstructor },
{ &kNS_ADDON_PATH_SERVICE_CID, false, nullptr, AddonPathServiceConstructor },
{ &kNATIVE_FILEWATCHER_SERVICE_CID, false, nullptr, NativeFileWatcherServiceConstructor },
{ nullptr }
@ -228,15 +232,22 @@ static const Module::ContractIDEntry kToolkitContracts[] = {
#endif
{ FINALIZATIONWITNESSSERVICE_CONTRACTID, &kFINALIZATIONWITNESSSERVICE_CID },
{ NATIVE_OSFILE_INTERNALS_SERVICE_CONTRACTID, &kNATIVE_OSFILE_INTERNALS_SERVICE_CID },
{ NS_ADDONCONTENTPOLICY_CONTRACTID, &kNS_ADDONCONTENTPOLICY_CID },
{ NS_ADDONPATHSERVICE_CONTRACTID, &kNS_ADDON_PATH_SERVICE_CID },
{ NATIVE_FILEWATCHER_SERVICE_CONTRACTID, &kNATIVE_FILEWATCHER_SERVICE_CID },
{ nullptr }
};
static const mozilla::Module::CategoryEntry kToolkitCategories[] = {
{ "content-policy", NS_ADDONCONTENTPOLICY_CONTRACTID, NS_ADDONCONTENTPOLICY_CONTRACTID },
{ nullptr }
};
static const Module kToolkitModule = {
Module::kVersion,
kToolkitCIDs,
kToolkitContracts
kToolkitContracts,
kToolkitCategories
};
NSMODULE_DEFN(nsToolkitCompsModule) = &kToolkitModule;

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

@ -33,3 +33,5 @@ support-files =
[test_ext_bookmarks.html]
[test_ext_alarms.html]
[test_ext_background_window_properties.html]
[test_ext_jsversion.html]
skip-if = e10s # Uses a console monitor which doesn't work from a content process. The code being tested doesn't run in a tab content process in any case.

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

@ -0,0 +1,84 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for simple WebExtension</title>
<meta charset="utf-8">
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
<script type="text/javascript" src="head.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<script type="application/javascript;version=1.8">
add_task(function* test_versioned_js() {
// We need to deal with escaping the close script tags.
// May as well consolidate it into one place.
let script = attrs => `<script ${attrs}></${'script'}>`;
let extension = ExtensionTestUtils.loadExtension({
manifest: {
"background": {"page": "background.html"}
},
files: {
"background.html": `
<meta charset="utf-8">
${script('src="background.js" type="application/javascript"')}
${script('src="background-1.js" type="application/javascript;version=1.8"')}
${script('src="background-2.js" type="application/javascript;version=latest"')}
${script('src="background-3.js" type="application/javascript"')}
`,
"background.js": "new " + function () {
browser.runtime.onMessage.addListener(msg => {
browser.test.assertEq(
msg, "background-script-3",
"Expected a message only from the unversioned background script.");
browser.test.sendMessage("finished");
});
},
"background-1.js": "new " + function () {
browser.runtime.sendMessage("background-script-1");
},
"background-2.js": "new " + function () {
browser.runtime.sendMessage("background-script-2");
},
"background-3.js": "new " + function () {
browser.runtime.sendMessage("background-script-3");
},
},
});
let messages = [/Versioned JavaScript.*not supported in WebExtension.*developer\.mozilla\.org/,
/Versioned JavaScript.*not supported in WebExtension.*developer\.mozilla\.org/];
let waitForConsole = new Promise(resolve => {
SimpleTest.monitorConsole(resolve, messages);
});
info("loading extension");
yield Promise.all([extension.startup(),
extension.awaitMessage("finished")]);
info("waiting for console");
SimpleTest.endMonitorConsole();
yield waitForConsole;
info("unloading extension");
yield extension.unload();
info("test complete");
});
</script>
</body>
</html>

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

@ -28,7 +28,7 @@ if (typeof Components != "undefined") {
SharedAll = {};
Cu.import("resource://gre/modules/osfile/osfile_shared_allthreads.jsm", SharedAll);
this.exports = {};
} else if (typeof "module" != "undefined" && typeof "require" != "undefined") {
} else if (typeof module != "undefined" && typeof require != "undefined") {
// Module is loaded with require()
SharedAll = require("resource://gre/modules/osfile/osfile_shared_allthreads.jsm");
} else {

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

@ -28,7 +28,7 @@ if (typeof Components != "undefined") {
SharedAll = {};
Cu.import("resource://gre/modules/osfile/osfile_shared_allthreads.jsm", SharedAll);
this.exports = {};
} else if (typeof "module" != "undefined" && typeof "require" != "undefined") {
} else if (typeof module != "undefined" && typeof require != "undefined") {
// Module is loaded with require()
SharedAll = require("resource://gre/modules/osfile/osfile_shared_allthreads.jsm");
} else {

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

@ -25,7 +25,7 @@ if (typeof Components != "undefined") {
// In non-main thread, |exports| is provided by the module
// loader.
this.exports = {};
} else if (typeof "module" == "undefined" || typeof "exports" == "undefined") {
} else if (typeof module == "undefined" || typeof exports == "undefined") {
throw new Error("Please load this module using require()");
}

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

@ -34,7 +34,7 @@ if (typeof Components != "undefined") {
// In non-main thread, |exports| is provided by the module
// loader.
this.exports = {};
} else if (typeof "module" == "undefined" || typeof "exports" == "undefined") {
} else if (typeof module == "undefined" || typeof exports == "undefined") {
throw new Error("Please load this module using require()");
}

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

@ -9219,6 +9219,16 @@
"keyed": "true",
"description": "Number of warnings, keyed by appName."
},
"DEVTOOLS_HUD_USS": {
"alert_emails": ["rnicoletti@mozilla.com","thills@mozilla.com"],
"expires_in_version": "52",
"kind": "linear",
"keyed": "true",
"low": "20000000",
"high": "100000000",
"n_buckets": 52,
"description": "The USS memory consumed by an application, keyed by appName."
},
"DEVTOOLS_HUD_APP_STARTUP_TIME_CONTENTINTERACTIVE": {
"alert_emails": ["rnicoletti@mozilla.com","thills@mozilla.com"],
"expires_in_version": "52",

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

@ -620,8 +620,8 @@ EnvironmentAddonBuilder.prototype = {
let activeGMPlugins = {};
for (let plugin of allPlugins) {
// Only get GM Plugin info.
if (!plugin.isGMPlugin) {
// Only get info for valid and enabled GMPlugins.
if (!plugin.isGMPlugin || !plugin.isValid || plugin.disabled) {
continue;
}

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

@ -558,10 +558,7 @@ function checkTheme(data) {
}
function checkActiveGMPlugin(data) {
// GMP plugin version defaults to null until GMPDownloader runs to update it.
if (data.version) {
Assert.equal(typeof data.version, "string");
}
Assert.equal(typeof data.version, "string");
Assert.equal(typeof data.userDisabled, "boolean");
Assert.equal(typeof data.applyBackgroundUpdates, "number");
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше