Merge m-c to inbound on a CLOSED TREE.

This commit is contained in:
Ryan VanderMeulen 2014-04-30 16:47:33 -04:00
commit c54f3e2567
50 changed files with 242 additions and 587 deletions

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="a3437e7e204e32f0f93880a43bfc0cef909cb84d"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="8873166797fecfa65c0afa644d2ebcc7d7cb4ed3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="0292e64ef8451df104dcf9ac3b2c6749b81684dd"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="a3437e7e204e32f0f93880a43bfc0cef909cb84d"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="8873166797fecfa65c0afa644d2ebcc7d7cb4ed3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8d6c36d74ba9aefbc8c3618fc93dd4907a0dbf5e"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="65fba428f8d76336b33ddd9e15900357953600ba">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="a3437e7e204e32f0f93880a43bfc0cef909cb84d"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="8873166797fecfa65c0afa644d2ebcc7d7cb4ed3"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
@ -56,7 +56,6 @@
<project name="platform/external/gtest" path="external/gtest" revision="0e87f7087bead3fbba86ad24fb888b23c25b35d3"/>
<project name="platform/external/harfbuzz" path="external/harfbuzz" revision="77bfb851261572216aeba5a5e1bb1d910d40ecb9"/>
<project name="platform/external/harfbuzz_ng" path="external/harfbuzz_ng" revision="6e3a3edf0a9ae09a7b92637c2a7131df0bde4760"/>
<project name="platform/external/icu4c" path="external/icu4c" remote="aosp" revision="b4c6379528887dc25ca9991a535a8d92a61ad6b6"/>
<project name="platform/external/iproute2" path="external/iproute2" revision="b438b9c63d6f79cb08391f0b0f12b8457ea99395"/>
<project name="platform/external/ipsec-tools" path="external/ipsec-tools" revision="c493b85a54d27cbcb1dcb91bb86545254cf28684"/>
<project name="platform/external/iptables" path="external/iptables" revision="fe8cf0795af508d6bd413d0ab729ed6afabd237e"/>
@ -119,6 +118,9 @@
<project name="platform/system/netd" path="system/netd" revision="36704b0da24debcab8090156568ac236315036bb"/>
<project name="platform/system/security" path="system/security" revision="583374f69f531ba68fc3dcbff1f74893d2a96406"/>
<project name="platform/system/vold" path="system/vold" revision="d4455b8cf361f8353e8aebac15ffd64b4aedd2b9"/>
<project name="platform/external/icu4c" path="external/icu4c" remote="aosp" revision="b4c6379528887dc25ca9991a535a8d92a61ad6b6"/>
<project name="platform_frameworks_av" path="frameworks/av" remote="b2g" revision="6c67114dfa109f31d37e880b9c009f2965a22261"/>
<project name="platform_system_core" path="system/core" remote="b2g" revision="9395eb5aa885cf6d305a202de6e9694a58a89717"/>
<default remote="caf" revision="refs/tags/android-4.4.2_r1" sync-j="4"/>
<!-- Emulator specific things -->
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="72ffdf71c68a96309212eb13d63560d66db14c9e"/>
@ -126,8 +128,6 @@
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="606dd627fad312cb79284fa38e44f0ed4bd42bfa"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="694cecf256122d0cb3b6a1a4efb4b5c7401db223"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="aa430bd055bf7e1003d78e9bf0c0abbe32f33e45"/>
<project name="platform_frameworks_av" path="frameworks/av" remote="b2g" revision="6c67114dfa109f31d37e880b9c009f2965a22261"/>
<project name="platform_system_core" path="system/core" remote="b2g" revision="9395eb5aa885cf6d305a202de6e9694a58a89717"/>
<project name="platform/development" path="development" revision="5968ff4e13e0d696ad8d972281fc27ae5a12829b"/>
<project name="android-sdk" path="sdk" remote="b2g" revision="0951179277915335251c5e11d242e4e1a8c2236f"/>
</manifest>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="a3437e7e204e32f0f93880a43bfc0cef909cb84d"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="8873166797fecfa65c0afa644d2ebcc7d7cb4ed3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="0292e64ef8451df104dcf9ac3b2c6749b81684dd"/>

View File

@ -18,7 +18,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="a3437e7e204e32f0f93880a43bfc0cef909cb84d"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="8873166797fecfa65c0afa644d2ebcc7d7cb4ed3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8d6c36d74ba9aefbc8c3618fc93dd4907a0dbf5e"/>
@ -119,13 +119,14 @@
<!-- Flame specific things -->
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="e8a318f7690092e639ba88891606f4183e846d3f"/>
<project name="device/qcom/common" path="device/qcom/common" revision="234ed34543345f58c0d4dcb1aa012de68802b9dc"/>
<project name="device-flame" path="device/t2m/flame" remote="b2g" revision="9729afa15ae3362db1852eee60422947db614dd6"/>
<project name="device-flame" path="device/t2m/flame" remote="b2g" revision="2173c7c1f90ccd28915eed1d58077311d8296ec4"/>
<project name="kernel/msm" path="kernel" revision="4f49d97a18160be16eb6853c0ee6a5f1830ffbe9"/>
<project name="platform/bootable/recovery" path="bootable/recovery" revision="f2914eacee9120680a41463708bb6ee8291749fc"/>
<project name="platform/external/bluetooth/bluedroid" path="external/bluetooth/bluedroid" revision="fa892235a9bd8983f8b591129fc1a9398f64e514"/>
<project name="platform/external/bluetooth/bluez" path="external/bluetooth/bluez" revision="f0689ac1914cdbc59e53bdc9edd9013dc157c299"/>
<project name="platform/external/bluetooth/glib" path="external/bluetooth/glib" revision="dd925f76e4f149c3d5571b80e12f7e24bbe89c59"/>
<project name="platform/external/dbus" path="external/dbus" revision="ea87119c843116340f5df1d94eaf8275e1055ae8"/>
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="494c177966fdc31183a5f7af82dc9130f523da4b"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="320b05a5761eb2a4816f7529c91ea49422979b55"/>
<project name="platform/frameworks/av" path="frameworks/av" revision="1df6dac11d7370a2fffca8e31d65b80f537faec5"/>
<project name="platform/frameworks/base" path="frameworks/base" revision="807d87d5ff66cb5e0664f6924f612fcdb5e2c453"/>
@ -140,6 +141,7 @@
<project name="platform/hardware/ril" path="hardware/ril" revision="c4e2ac95907a5519a0e09f01a0d8e27fec101af0"/>
<project name="platform/system/bluetooth" path="system/bluetooth" revision="e1eb226fa3ad3874ea7b63c56a9dc7012d7ff3c2"/>
<project name="platform/system/core" path="system/core" revision="e284280277c1312017a9450956a9676584441cdf"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="83e1560bef0988bbdec49d15cb8eef402857d4ef"/>
<project name="platform/system/qcom" path="system/qcom" revision="1cdab258b15258b7f9657da70e6f06ebd5a2fc25"/>
<project name="platform/vendor/qcom/msm8610" path="device/qcom/msm8610" revision="b3001d5f1686f89995b7bf70963cf69c8faebd83"/>
</manifest>

View File

@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
"revision": "ecde92711ca63dd62dd6008686532c0cc52c75dd",
"revision": "85d9192b0062c8c55f5c277a03eb4f768887ded8",
"repo_path": "/integration/gaia-central"
}

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="a3437e7e204e32f0f93880a43bfc0cef909cb84d"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="8873166797fecfa65c0afa644d2ebcc7d7cb4ed3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -15,7 +15,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="a3437e7e204e32f0f93880a43bfc0cef909cb84d"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="8873166797fecfa65c0afa644d2ebcc7d7cb4ed3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="a3437e7e204e32f0f93880a43bfc0cef909cb84d"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="8873166797fecfa65c0afa644d2ebcc7d7cb4ed3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="a3437e7e204e32f0f93880a43bfc0cef909cb84d"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="8873166797fecfa65c0afa644d2ebcc7d7cb4ed3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="a3437e7e204e32f0f93880a43bfc0cef909cb84d"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="8873166797fecfa65c0afa644d2ebcc7d7cb4ed3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8d6c36d74ba9aefbc8c3618fc93dd4907a0dbf5e"/>

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="a3437e7e204e32f0f93880a43bfc0cef909cb84d"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="8873166797fecfa65c0afa644d2ebcc7d7cb4ed3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

25
b2g/dev/app.mozbuild Normal file
View File

@ -0,0 +1,25 @@
# vim: set filetype=python:
# 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/.
if not CONFIG['LIBXUL_SDK']:
app_libxul_dirs = []
app_libxul_static_dirs = []
include('/toolkit/toolkit.mozbuild')
if CONFIG['MOZ_EXTENSIONS']:
add_tier_dir('app', 'extensions')
add_tier_dir('app', [CONFIG['MOZ_BRANDING_DIRECTORY']])
if CONFIG['MOZ_WEBAPP_RUNTIME']:
add_tier_dir('app', 'webapprt')
add_tier_dir('app', 'b2g/chrome')
add_tier_dir('app', 'b2g/components')
# Never add tier dirs after browser because they apparently won't get
# packaged properly on Mac.
add_tier_dir('app', 'browser')

6
b2g/dev/build.mk Normal file
View File

@ -0,0 +1,6 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
include $(topsrcdir)/browser/build.mk

9
b2g/dev/confvars.sh Normal file
View File

@ -0,0 +1,9 @@
#! /bin/sh
# 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/.
MOZ_B2G=1
MOZ_MULET=1
. ${srcdir}/browser/confvars.sh

View File

@ -7,6 +7,9 @@ dist_dest = $(DIST)/$(MOZ_MACBUNDLE_NAME)
PREF_JS_EXPORTS = $(srcdir)/profile/firefox.js \
$(NULL)
ifdef MOZ_MULET
PREF_JS_EXPORTS += $(topsrcdir)/b2g/app/b2g.js
endif
# hardcode en-US for the moment
AB_CD = en-US

View File

@ -0,0 +1,6 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
addMessageListener("AboutHome:SearchTriggered", function (msg) {
sendAsyncMessage("AboutHomeTest:CheckRecordedSearch", msg.data);
});

View File

@ -6,6 +6,7 @@ support-files =
app_bug575561.html
app_subframe_bug575561.html
authenticate.sjs
aboutHome_content_script.js
browser_bug479408_sample.html
browser_bug678392-1.html
browser_bug678392-2.html

View File

@ -9,6 +9,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "Task",
XPCOMUtils.defineLazyModuleGetter(this, "AboutHomeUtils",
"resource:///modules/AboutHome.jsm");
const TEST_CONTENT_HELPER = "chrome://mochitests/content/browser/browser/base/content/test/general/aboutHome_content_script.js";
let gRightsVersion = Services.prefs.getIntPref("browser.rights.version");
registerCleanupFunction(function() {
@ -110,21 +111,19 @@ let gTests = [
let searchEventDeferred = Promise.defer();
let doc = gBrowser.contentDocument;
let engineName = doc.documentElement.getAttribute("searchEngineName");
let mm = gBrowser.selectedTab.linkedBrowser.messageManager;
doc.addEventListener("AboutHomeSearchEvent", function onSearch(e) {
let data = JSON.parse(e.detail);
mm.loadFrameScript(TEST_CONTENT_HELPER, false);
mm.addMessageListener("AboutHomeTest:CheckRecordedSearch", function (msg) {
let data = JSON.parse(msg.data);
is(data.engineName, engineName, "Detail is search engine name");
// We use executeSoon() to ensure that this code runs after the
// count has been updated in browser.js, since it uses the same
// event.
executeSoon(function () {
getNumberOfSearches(engineName).then(num => {
is(num, numSearchesBefore + 1, "One more search recorded.");
searchEventDeferred.resolve();
});
getNumberOfSearches(engineName).then(num => {
is(num, numSearchesBefore + 1, "One more search recorded.");
searchEventDeferred.resolve();
});
}, true, true);
});
// Get the current number of recorded searches.
let searchStr = "a search";

View File

@ -42,4 +42,6 @@ component {eab9012e-5f74-4cbc-b2b5-a590235513cc} nsBrowserGlue.js
contract @mozilla.org/browser/browserglue;1 {eab9012e-5f74-4cbc-b2b5-a590235513cc}
category app-startup nsBrowserGlue service,@mozilla.org/browser/browserglue;1 application={3c2e2abc-06d4-11e1-ac3b-374f68613e61} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384} application={aa3c5121-dab2-40e2-81ca-7ea25febc110} application={a23983c0-fd0e-11dc-95ff-0800200c9a66}
component {d8903bf6-68d5-4e97-bcd1-e4d3012f721a} nsBrowserGlue.js
#ifndef MOZ_MULET
contract @mozilla.org/content-permission/prompt;1 {d8903bf6-68d5-4e97-bcd1-e4d3012f721a}
#endif

View File

@ -2400,86 +2400,6 @@ let SessionStoreInternal = {
this._sendRestoreCompletedNotifications();
},
/**
* Sets the tabs restoring order with the following priority:
* Selected tab, pinned tabs, optimized visible tabs, other visible tabs and
* hidden tabs.
* @param aTabBrowser
* Tab browser object
* @param aTabs
* Array of tab references
* @param aTabData
* Array of tab data
* @param aSelectedTab
* Index of selected tab (1 is first tab, 0 no selected tab)
*/
_setTabsRestoringOrder : function ssi__setTabsRestoringOrder(
aTabBrowser, aTabs, aTabData, aSelectedTab) {
// Store the selected tab. Need to substract one to get the index in aTabs.
let selectedTab;
if (aSelectedTab > 0 && aTabs[aSelectedTab - 1]) {
selectedTab = aTabs[aSelectedTab - 1];
}
// Store the pinned tabs and hidden tabs.
let pinnedTabs = [];
let pinnedTabsData = [];
let hiddenTabs = [];
let hiddenTabsData = [];
if (aTabs.length > 1) {
for (let t = aTabs.length - 1; t >= 0; t--) {
if (aTabData[t].pinned) {
pinnedTabs.unshift(aTabs.splice(t, 1)[0]);
pinnedTabsData.unshift(aTabData.splice(t, 1)[0]);
} else if (aTabData[t].hidden) {
hiddenTabs.unshift(aTabs.splice(t, 1)[0]);
hiddenTabsData.unshift(aTabData.splice(t, 1)[0]);
}
}
}
// Optimize the visible tabs only if there is a selected tab.
if (selectedTab) {
let selectedTabIndex = aTabs.indexOf(selectedTab);
if (selectedTabIndex > 0) {
let scrollSize = aTabBrowser.tabContainer.mTabstrip.scrollClientSize;
let tabWidth = aTabs[0].getBoundingClientRect().width;
let maxVisibleTabs = Math.ceil(scrollSize / tabWidth);
if (maxVisibleTabs < aTabs.length) {
let firstVisibleTab = 0;
let nonVisibleTabsCount = aTabs.length - maxVisibleTabs;
if (nonVisibleTabsCount >= selectedTabIndex) {
// Selected tab is leftmost since we scroll to it when possible.
firstVisibleTab = selectedTabIndex;
} else {
// Selected tab is rightmost or no more room to scroll right.
firstVisibleTab = nonVisibleTabsCount;
}
aTabs = aTabs.splice(firstVisibleTab, maxVisibleTabs).concat(aTabs);
aTabData =
aTabData.splice(firstVisibleTab, maxVisibleTabs).concat(aTabData);
}
}
}
// Merge the stored tabs in order.
aTabs = pinnedTabs.concat(aTabs, hiddenTabs);
aTabData = pinnedTabsData.concat(aTabData, hiddenTabsData);
// Load the selected tab to the first position and select it.
if (selectedTab) {
let selectedTabIndex = aTabs.indexOf(selectedTab);
if (selectedTabIndex > 0) {
aTabs = aTabs.splice(selectedTabIndex, 1).concat(aTabs);
aTabData = aTabData.splice(selectedTabIndex, 1).concat(aTabData);
}
aTabBrowser.selectedTab = selectedTab;
}
return [aTabs, aTabData];
},
/**
* Manage history restoration for a window
* @param aWindow
@ -2489,7 +2409,9 @@ let SessionStoreInternal = {
* @param aTabData
* Array of tab data
* @param aSelectTab
* Index of selected tab
* Index of the tab to select. This is a 1-based index where "1"
* indicates the first tab should be selected, and "0" indicates that
* the currently selected tab will not be changed.
* @param aRestoreImmediately
* Flag to indicate whether the given set of tabs aTabs should be
* restored/loaded immediately even if restore_on_demand = true
@ -2525,9 +2447,10 @@ let SessionStoreInternal = {
return;
}
// Sets the tabs restoring order.
[aTabs, aTabData] =
this._setTabsRestoringOrder(tabbrowser, aTabs, aTabData, aSelectTab);
// If provided, set the selected tab.
if (aSelectTab > 0 && aSelectTab <= aTabs.length) {
tabbrowser.selectedTab = aTabs[aSelectTab - 1];
}
// Prepare the tabs so that they can be properly restored. We'll pin/unpin
// and show/hide tabs as necessary. We'll also set the labels, user typed

View File

@ -111,7 +111,6 @@ skip-if = true
[browser_466937.js]
[browser_467409-backslashplosion.js]
[browser_477657.js]
[browser_480148.js]
[browser_480893.js]
[browser_485482.js]
[browser_485563.js]

View File

@ -1,216 +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/. */
function test() {
/** Test for Bug 484108 **/
waitForExplicitFinish();
requestLongerTimeout(5);
// builds the tests state based on a few parameters
function buildTestState(num, selected, hidden, pinned) {
let state = { windows: [ { "tabs": [], "selected": selected + 1 } ] };
while (num--) {
state.windows[0].tabs.push({
entries: [
{ url: "http://example.com/?t=" + state.windows[0].tabs.length }
]
});
let i = state.windows[0].tabs.length - 1;
if (hidden.length > 0 && i == hidden[0]) {
state.windows[0].tabs[i].hidden = true;
hidden.splice(0, 1);
}
if (pinned.length > 0 && i == pinned[0]) {
state.windows[0].tabs[i].pinned = true;
pinned.splice(0, 1);
}
}
return state;
}
let tests = [
{ testNum: 1,
totalTabs: 13,
selectedTab: 0,
shownTabs: 6,
hiddenTabs: [],
pinnedTabs: [],
order: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
},
{ testNum: 2,
totalTabs: 13,
selectedTab: 12,
shownTabs: 6,
hiddenTabs: [],
pinnedTabs: [],
order: [12, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6]
},
{ testNum: 3,
totalTabs: 13,
selectedTab: 3,
shownTabs: 6,
hiddenTabs: [],
pinnedTabs: [],
order: [3, 4, 5, 6, 7, 8, 0, 1, 2, 9, 10, 11, 12]
},
{ testNum: 4,
totalTabs: 13,
selectedTab: 10,
shownTabs: 6,
hiddenTabs: [],
pinnedTabs: [],
order: [10, 7, 8, 9, 11, 12, 0, 1, 2, 3, 4, 5, 6]
},
{ testNum: 5,
totalTabs: 13,
selectedTab: 12,
shownTabs: 6,
hiddenTabs: [0, 4, 9],
pinnedTabs: [],
order: [12, 6, 7, 8, 10, 11, 1, 2, 3, 5, 0, 4, 9]
},
{ testNum: 6,
totalTabs: 13,
selectedTab: 3,
shownTabs: 6,
hiddenTabs: [1, 7, 12],
pinnedTabs: [],
order: [3, 4, 5, 6, 8, 9, 0, 2, 10, 11, 1, 7, 12]
},
{ testNum: 7,
totalTabs: 13,
selectedTab: 3,
shownTabs: 6,
hiddenTabs: [0, 1, 2],
pinnedTabs: [],
order: [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0, 1, 2]
},
{ testNum: 8,
totalTabs: 13,
selectedTab: 0,
shownTabs: 6,
hiddenTabs: [],
pinnedTabs: [0],
order: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
},
{ testNum: 9,
totalTabs: 13,
selectedTab: 1,
shownTabs: 6,
hiddenTabs: [],
pinnedTabs: [0],
order: [1, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
},
{ testNum: 10,
totalTabs: 13,
selectedTab: 3,
shownTabs: 6,
hiddenTabs: [2],
pinnedTabs: [0,1],
order: [3, 0, 1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 2]
},
{ testNum: 11,
totalTabs: 13,
selectedTab: 12,
shownTabs: 6,
hiddenTabs: [],
pinnedTabs: [0,1,2],
order: [12, 0, 1, 2, 7, 8, 9, 10, 11, 3, 4, 5, 6]
},
{ testNum: 12,
totalTabs: 13,
selectedTab: 6,
shownTabs: 6,
hiddenTabs: [3,4,5],
pinnedTabs: [0,1,2],
order: [6, 0, 1, 2, 7, 8, 9, 10, 11, 12, 3, 4, 5]
},
{ testNum: 13,
totalTabs: 13,
selectedTab: 1,
shownTabs: 6,
hiddenTabs: [3,4,5],
pinnedTabs: [0,1,2],
order: [1, 0, 2, 6, 7, 8, 9, 10, 11, 12, 3, 4, 5]
},
{ testNum: 14,
totalTabs: 13,
selectedTab: 2,
shownTabs: 6,
hiddenTabs: [],
pinnedTabs: [0,1,2],
order: [2, 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
},
{ testNum: 15,
totalTabs: 13,
selectedTab: 3,
shownTabs: 6,
hiddenTabs: [1,4],
pinnedTabs: [0,1,2],
order: [3, 0, 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 4]
}
];
let tabMinWidth =
parseInt(getComputedStyle(gBrowser.selectedTab, null).minWidth);
let testIndex = 0;
function runNextTest() {
if (tests.length == 0) {
finish();
return;
}
let wu = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindowUtils);
wu.garbageCollect();
setTimeout(function() {
info ("Starting test " + (++testIndex));
let test = tests.shift();
let state = buildTestState(test.totalTabs, test.selectedTab,
test.hiddenTabs, test.pinnedTabs);
let tabbarWidth = Math.floor((test.shownTabs - 0.5) * tabMinWidth);
let win = openDialog(location, "_blank", "chrome,all,dialog=no");
let tabsRestored = [];
win.addEventListener("SSTabRestoring", function onSSTabRestoring(aEvent) {
let tab = aEvent.originalTarget;
let tabLink = tab.linkedBrowser.currentURI.spec;
let tabIndex =
tabLink.substring(tabLink.indexOf("?t=") + 3, tabLink.length);
// we need to compare with the tab's restoring index, no with the
// position index, since the pinned tabs change the positions in the
// tabbar.
tabsRestored.push(tabIndex);
if (tabsRestored.length < state.windows[0].tabs.length)
return;
// all of the tabs should be restoring or restored by now
is(tabsRestored.length, state.windows[0].tabs.length,
"Test #" + testIndex + ": Number of restored tabs is as expected");
is(tabsRestored.join(" "), test.order.join(" "),
"Test #" + testIndex + ": 'visible' tabs restored first");
// cleanup
win.removeEventListener("SSTabRestoring", onSSTabRestoring, false);
win.close();
executeSoon(runNextTest);
}, false);
whenWindowLoaded(win, function(aEvent) {
let extent =
win.outerWidth - win.gBrowser.tabContainer.mTabstrip.scrollClientSize;
let windowWidth = tabbarWidth + extent;
win.resizeTo(windowWidth, win.outerHeight);
ss.setWindowState(win, JSON.stringify(state), true);
});
}, 1000);
};
runNextTest();
}

View File

@ -47,16 +47,14 @@ function test() {
}
function testRestoreWithHiddenTabs() {
let checked = false;
let ssReady = false;
let tabsRestored = false;
let check = function () {
if (checked || !ssReady || !tabsRestored)
return;
checked = true;
TabsProgressListener.setCallback(function (needsRestore, isRestoring) {
if (needsRestore <= 4) {
TabsProgressListener.unsetCallback();
is(needsRestore, 4, "4/8 tabs restored");
}
});
waitForBrowserState(state, 4, function () {
is(gBrowser.tabs.length, 8, "there are now eight tabs");
is(gBrowser.visibleTabs.length, 4, "four visible tabs");
@ -64,25 +62,7 @@ function testRestoreWithHiddenTabs() {
is(cw.GroupItems.groupItems.length, 2, "there are now two groupItems");
testSwitchToInactiveGroup();
}
whenSessionStoreReady(function () {
ssReady = true;
check();
});
TabsProgressListener.setCallback(function (needsRestore, isRestoring) {
if (4 < needsRestore)
return;
TabsProgressListener.unsetCallback();
is(needsRestore, 4, "4/8 tabs restored");
tabsRestored = true;
check();
});
ss.setBrowserState(JSON.stringify(state));
}
function testSwitchToInactiveGroup() {
@ -108,11 +88,16 @@ function testSwitchToInactiveGroup() {
gBrowser.selectedTab = gBrowser.tabs[4];
}
function whenSessionStoreReady(callback) {
window.addEventListener("SSWindowStateReady", function onReady() {
window.removeEventListener("SSWindowStateReady", onReady, false);
executeSoon(callback);
}, false);
function waitForBrowserState(state, numTabs, callback) {
let tabContainer = gBrowser.tabContainer;
tabContainer.addEventListener("SSTabRestored", function onRestored() {
if (--numTabs <= 0) {
tabContainer.removeEventListener("SSTabRestored", onRestored, true);
executeSoon(callback);
}
}, true);
ss.setBrowserState(JSON.stringify(state));
}
function countTabs() {

View File

@ -17,6 +17,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "fxAccounts",
"resource://gre/modules/FxAccounts.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Promise",
"resource://gre/modules/Promise.jsm");
// Url to fetch snippets, in the urlFormatter service format.
const SNIPPETS_URL_PREF = "browser.aboutHomeSnippets.updateUrl";
@ -181,13 +183,25 @@ let AboutHome = {
Cu.reportError(ex);
break;
}
let engine = Services.search.currentEngine;
Services.search.init(function(status) {
if (!Components.isSuccessCode(status)) {
return;
}
let engine = Services.search.currentEngine;
#ifdef MOZ_SERVICES_HEALTHREPORT
window.BrowserSearch.recordSearchInHealthReport(engine, "abouthome");
window.BrowserSearch.recordSearchInHealthReport(engine, "abouthome");
#endif
// Trigger a search through nsISearchEngine.getSubmission()
let submission = engine.getSubmission(data.searchTerms, null, "homepage");
window.loadURI(submission.uri.spec, null, submission.postData);
// Trigger a search through nsISearchEngine.getSubmission()
let submission = engine.getSubmission(data.searchTerms, null, "homepage");
window.loadURI(submission.uri.spec, null, submission.postData);
// Used for testing
let mm = aMessage.target.messageManager;
mm.sendAsyncMessage("AboutHome:SearchTriggered", aMessage.data.searchData);
});
break;
}
},
@ -199,13 +213,26 @@ let AboutHome = {
Components.utils.import("resource:///modules/sessionstore/SessionStore.jsm",
wrapper);
let ss = wrapper.SessionStore;
ss.promiseInitialized.then(function() {
let deferred = Promise.defer();
Services.search.init(function (status){
if (!Components.isSuccessCode(status)) {
deferred.reject(status);
} else {
deferred.resolve(Services.search.defaultEngine.name);
}
});
return deferred.promise;
}).then(function(engineName) {
let data = {
showRestoreLastSession: ss.canRestoreLastSession,
snippetsURL: AboutHomeUtils.snippetsURL,
showKnowYourRights: AboutHomeUtils.showKnowYourRights,
snippetsVersion: AboutHomeUtils.snippetsVersion,
defaultEngineName: Services.search.defaultEngine.name
defaultEngineName: engineName
};
if (AboutHomeUtils.showKnowYourRights) {

View File

@ -4202,12 +4202,17 @@ xulrunner)
b2g)
AC_DEFINE(MOZ_B2G)
;;
b2g/dev)
AC_DEFINE(MOZ_B2G)
AC_DEFINE(MOZ_MULET)
;;
esac
AC_SUBST(MOZ_BUILD_APP)
AC_SUBST(MOZ_PHOENIX)
AC_SUBST(MOZ_XULRUNNER)
AC_SUBST(MOZ_B2G)
AC_SUBST(MOZ_MULET)
AC_SUBST(MOZ_B2G_VERSION)
AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)

View File

@ -75,7 +75,9 @@ BluetoothChild::RecvNotify(const BluetoothSignal& aSignal)
{
MOZ_ASSERT(sBluetoothService);
sBluetoothService->DistributeSignal(aSignal);
if (sBluetoothService) {
sBluetoothService->DistributeSignal(aSignal);
}
return true;
}
@ -84,7 +86,9 @@ BluetoothChild::RecvEnabled(const bool& aEnabled)
{
MOZ_ASSERT(sBluetoothService);
sBluetoothService->SetEnabled(aEnabled);
if (sBluetoothService) {
sBluetoothService->SetEnabled(aEnabled);
}
return true;
}

View File

@ -5,14 +5,17 @@ qemu = true
[test_mobile_networks.js]
[test_mobile_voice_state.js]
disabled = Bug 999458
[test_mobile_voice_location.js]
[test_mobile_operator_names.js]
[test_mobile_operator_names_plmnlist.js]
disabled = Bug 999458
[test_mobile_operator_names_roaming.js]
[test_mobile_preferred_network_type.js]
[test_mobile_data_connection.js]
[test_mobile_data_location.js]
[test_mobile_data_state.js]
disabled = Bug 999458
[test_mobile_mmi.js]
[test_mobile_mmi_change_pin.js]
[test_mobile_roaming_preference.js]
@ -26,4 +29,4 @@ qemu = true
[test_mobile_signal_strength.js]
[test_mobile_data_ipv6.js]
disabled = Bug 979137
[test_dsds_mobile_data_connection.js]
[test_dsds_mobile_data_connection.js]

View File

@ -336,10 +336,6 @@ def B2GCommand(func):
help='Emulator resolution of the format \'<width>x<height>\'')
func = emulator_res(func)
emulator = CommandArgument('--emulator', default='arm',
help='Architecture of emulator to use: x86 or arm')
func = emulator(func)
marionette = CommandArgument('--marionette', default=None,
help='host:port to use when connecting to Marionette')
func = marionette(func)
@ -396,7 +392,7 @@ class MachCommands(MachCommandBase):
# they should be modified to work with all devices.
def is_emulator(cls):
"""Emulator needs to be configured."""
return cls.device_name.find('emulator') == 0
return cls.device_name.startswith('emulator')
@CommandProvider
@ -429,6 +425,13 @@ class B2GCommands(MachCommandBase):
return self._run_reftest(test_file, suite='crashtest', **kwargs)
def _run_reftest(self, test_file=None, suite=None, **kwargs):
if self.device_name:
if self.device_name.startswith('emulator'):
emulator = 'arm'
if 'x86' in self.device_name:
emulator = 'x86'
kwargs['emulator'] = emulator
reftest = self._spawn(ReftestRunner)
return reftest.run_b2g_test(self.b2g_home, self.xre_path,
test_file, suite=suite, **kwargs)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 B

After

Width:  |  Height:  |  Size: 473 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 B

After

Width:  |  Height:  |  Size: 679 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 322 B

View File

@ -1,12 +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/. -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#a6aeb4"/>
<size android:width="1dp" />
</shape>

View File

@ -1,12 +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/. -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#222"/>
<size android:width="1dp" />
</shape>

View File

@ -1,15 +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/. -->
<!-- Note that android:color="@color/toolbar_separator" (which uses a selector)
directly in the <shape> does not appear to work, so instead we select
between two shapes with different colors. -->
<selector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gecko="http://schemas.android.com/apk/res-auto">
<item gecko:state_private="true" android:drawable="@drawable/toolbar_separator_pb"/>
<item android:drawable="@drawable/toolbar_separator"/>
</selector>

View File

@ -15,19 +15,18 @@
<!-- Note: any layout parameters setting the right edge of
this View should be matched in the url_bar_translating_edge.
Note 2: On devices where the editing mode cancel items are
wider than the tabs and similar buttons (e.g. hardware menu
button), the url bar will shrink, in which case the LayoutParams
of this View are changed dynamically. -->
Note 2: On devices where the editing mode cancel button is
wider than the tabs counter and nearby buttons, the url bar will
shrink, in which case the LayoutParams of this View are
changed dynamically. -->
<ImageView android:id="@+id/url_bar_entry"
style="@style/UrlBar.Button"
android:layout_marginLeft="4dp"
android:layout_marginRight="-19dp"
android:layout_marginRight="-15dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/tabs"
android:paddingRight="4dp"
android:duplicateParentState="true"
android:clickable="false"
android:focusable="false"
@ -43,8 +42,7 @@
android:layout_toLeftOf="@+id/tabs"
android:layout_alignTop="@id/url_bar_entry"
android:layout_alignBottom="@id/url_bar_entry"
android:layout_marginRight="-19dp"
android:paddingRight="4dp"
android:layout_marginRight="-15dp"
android:duplicateParentState="true"
android:clickable="false"
android:focusable="false"
@ -103,27 +101,22 @@
style="@style/UrlBar.ImageButton.Icon"
android:layout_alignParentRight="true"
android:src="@drawable/close_edit_mode"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:contentDescription="@string/edit_mode_cancel"
android:visibility="invisible"/>
<org.mozilla.gecko.widget.ThemedView android:id="@+id/edit_separator"
android:layout_toLeftOf="@id/edit_cancel"
android:layout_width="1dip"
android:layout_height="match_parent"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="2dp"
android:background="@drawable/toolbar_separator_selector"
android:visibility="invisible"/>
<!-- The left margin of the cancel button is larger than the right because
the url bar drawable contains some whitespace, so we compensate by adding
a negative right margin (value determined through experimentation). -->
<org.mozilla.gecko.toolbar.ToolbarEditLayout android:id="@+id/edit_layout"
style="@style/UrlBar.Button"
android:layout_toLeftOf="@id/edit_separator"
android:layout_toLeftOf="@id/edit_cancel"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginRight="-2dp"
android:paddingLeft="8dp"
android:visibility="gone"/>
android:paddingRight="8dp"
android:visibility="invisible"/>
<org.mozilla.gecko.toolbar.ToolbarDisplayLayout android:id="@+id/display_layout"
style="@style/UrlBar.Button"

View File

@ -27,10 +27,4 @@
android:gravity="center_vertical|left"
gecko:autoUpdateTheme="false"/>
<ImageButton android:id="@+id/go"
style="@style/UrlBar.ImageButton.Icon"
android:src="@drawable/ic_url_bar_go"
android:contentDescription="@string/go"
android:visibility="gone"/>
</merge>

View File

@ -20,6 +20,7 @@ import android.widget.ImageButton;
import android.widget.TextView;
import com.jayway.android.robotium.solo.Condition;
import com.jayway.android.robotium.solo.Solo;
/**
* A class representing any interactions that take place on the Toolbar.
@ -69,13 +70,6 @@ public class ToolbarComponent extends BaseComponent {
return (TextView) getToolbarView().findViewById(R.id.url_bar_title);
}
/**
* Returns the View for the go button in the browser toolbar.
*/
private ImageButton getGoButton() {
return (ImageButton) getToolbarView().findViewById(R.id.go);
}
private ImageButton getBackButton() {
DeviceHelper.assertIsTablet();
return (ImageButton) getToolbarView().findViewById(R.id.back);
@ -141,7 +135,7 @@ public class ToolbarComponent extends BaseComponent {
WaitHelper.waitForPageLoad(new Runnable() {
@Override
public void run() {
mSolo.clickOnView(getGoButton());
mSolo.sendKey(Solo.ENTER);
}
});
waitForNotEditing();

View File

@ -34,10 +34,11 @@ import org.mozilla.gecko.util.MenuUtils;
import org.mozilla.gecko.widget.ThemedImageButton;
import org.mozilla.gecko.widget.ThemedImageView;
import org.mozilla.gecko.widget.ThemedRelativeLayout;
import org.mozilla.gecko.widget.ThemedView;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;
import android.os.Build;
@ -137,8 +138,7 @@ public class BrowserToolbar extends ThemedRelativeLayout
private MenuPopup menuPopup;
private List<View> focusOrder;
private final ThemedView editSeparator;
private final View editCancel;
private final ImageView editCancel;
private boolean shouldShrinkURLBar = false;
@ -220,8 +220,7 @@ public class BrowserToolbar extends ThemedRelativeLayout
actionItemBar = (LinearLayout) findViewById(R.id.menu_items);
hasSoftMenuButton = !HardwareUtils.hasMenuButton();
editSeparator = (ThemedView) findViewById(R.id.edit_separator);
editCancel = findViewById(R.id.edit_cancel);
editCancel = (ImageView) findViewById(R.id.edit_cancel);
// We use different layouts on phones and tablets, so adjust the focus
// order appropriately.
@ -328,6 +327,7 @@ public class BrowserToolbar extends ThemedRelativeLayout
urlEditLayout.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
// This will select the url bar when entering editing mode.
setSelected(hasFocus);
if (focusChangeListener != null) {
focusChangeListener.onFocusChange(v, hasFocus);
@ -600,15 +600,14 @@ public class BrowserToolbar extends ThemedRelativeLayout
}
private int getUrlBarEntryTranslation() {
if (editSeparator == null) {
if (editCancel == null) {
// We are on tablet, and there is no animation so return a translation of 0.
return 0;
}
// We would ideally use the right-most point of the edit layout instead of the
// edit separator and its margin, but it is not inflated when this code initially runs.
final LayoutParams lp = (LayoutParams) editSeparator.getLayoutParams();
return editSeparator.getLeft() - lp.leftMargin - urlBarEntry.getRight();
// Subtract the right margin because it's negative.
final LayoutParams lp = (LayoutParams) urlEditLayout.getLayoutParams();
return urlEditLayout.getRight() - lp.rightMargin - urlBarEntry.getRight();
}
private int getUrlBarCurveTranslation() {
@ -850,12 +849,14 @@ public class BrowserToolbar extends ThemedRelativeLayout
}
private void setUrlEditLayoutVisibility(final boolean showEditLayout, PropertyAnimator animator) {
urlEditLayout.prepareAnimation(showEditLayout, animator);
final View viewToShow = (showEditLayout ? urlEditLayout : urlDisplayLayout);
final View viewToHide = (showEditLayout ? urlDisplayLayout : urlEditLayout);
if (showEditLayout) {
urlEditLayout.prepareShowAnimation(animator);
}
if (animator == null) {
final View viewToShow = (showEditLayout ? urlEditLayout : urlDisplayLayout);
final View viewToHide = (showEditLayout ? urlDisplayLayout : urlEditLayout);
viewToHide.setVisibility(View.GONE);
viewToShow.setVisibility(View.VISIBLE);
@ -864,29 +865,23 @@ public class BrowserToolbar extends ThemedRelativeLayout
return;
}
ViewHelper.setAlpha(viewToShow, 0.0f);
animator.attach(viewToShow,
PropertyAnimator.Property.ALPHA,
1.0f);
animator.attach(viewToHide,
PropertyAnimator.Property.ALPHA,
0.0f);
animator.addPropertyAnimationListener(new PropertyAnimationListener() {
@Override
public void onPropertyAnimationStart() {
viewToShow.setVisibility(View.VISIBLE);
if (!showEditLayout) {
urlEditLayout.setVisibility(View.GONE);
urlDisplayLayout.setVisibility(View.VISIBLE);
setCancelVisibility(View.INVISIBLE);
}
}
@Override
public void onPropertyAnimationEnd() {
viewToHide.setVisibility(View.GONE);
ViewHelper.setAlpha(viewToHide, 1.0f);
if (showEditLayout) {
urlDisplayLayout.setVisibility(View.GONE);
urlEditLayout.setVisibility(View.VISIBLE);
setCancelVisibility(View.VISIBLE);
}
}
@ -894,8 +889,7 @@ public class BrowserToolbar extends ThemedRelativeLayout
}
private void setCancelVisibility(final int visibility) {
if (editSeparator != null && editCancel != null) {
editSeparator.setVisibility(visibility);
if (editCancel != null) {
editCancel.setVisibility(visibility);
}
}
@ -1021,9 +1015,6 @@ public class BrowserToolbar extends ThemedRelativeLayout
if (isAnimatingEntry)
return;
// Highlight the toolbar from the start of the animation.
setSelected(true);
urlDisplayLayout.prepareStartEditingAnimation();
// Slide toolbar elements.
@ -1106,6 +1097,10 @@ public class BrowserToolbar extends ThemedRelativeLayout
updateProgressVisibility();
// The animation looks cleaner if the text in the URL bar is
// not selected so clear the selection by clearing focus.
urlEditLayout.clearFocus();
if (Build.VERSION.SDK_INT < 11) {
stopEditingWithoutAnimation();
} else if (HardwareUtils.isTablet()) {
@ -1338,9 +1333,6 @@ public class BrowserToolbar extends ThemedRelativeLayout
menuButton.setPrivateMode(isPrivate);
menuIcon.setPrivateMode(isPrivate);
urlEditLayout.setPrivateMode(isPrivate);
if (editSeparator != null) {
editSeparator.setPrivateMode(isPrivate);
}
if (backButton instanceof BackButton) {
((BackButton) backButton).setPrivateMode(isPrivate);

View File

@ -8,12 +8,9 @@ package org.mozilla.gecko.toolbar;
import org.mozilla.gecko.R;
import org.mozilla.gecko.animation.PropertyAnimator;
import org.mozilla.gecko.animation.PropertyAnimator.PropertyAnimationListener;
import org.mozilla.gecko.animation.ViewHelper;
import org.mozilla.gecko.toolbar.BrowserToolbar.OnCommitListener;
import org.mozilla.gecko.toolbar.BrowserToolbar.OnDismissListener;
import org.mozilla.gecko.toolbar.BrowserToolbar.OnFilterListener;
import org.mozilla.gecko.toolbar.ToolbarEditText.OnTextTypeChangeListener;
import org.mozilla.gecko.toolbar.ToolbarEditText.TextType;
import org.mozilla.gecko.widget.ThemedLinearLayout;
import android.content.Context;
@ -21,9 +18,7 @@ import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnFocusChangeListener;
import android.view.inputmethod.InputMethodManager;
import android.widget.ImageButton;
/**
* {@code ToolbarEditLayout} is the UI for when the toolbar is in
@ -34,9 +29,7 @@ import android.widget.ImageButton;
public class ToolbarEditLayout extends ThemedLinearLayout {
private final ToolbarEditText mEditText;
private final ImageButton mGo;
private OnCommitListener mCommitListener;
private OnFocusChangeListener mFocusChangeListener;
public ToolbarEditLayout(Context context, AttributeSet attrs) {
@ -45,28 +38,11 @@ public class ToolbarEditLayout extends ThemedLinearLayout {
setOrientation(HORIZONTAL);
LayoutInflater.from(context).inflate(R.layout.toolbar_edit_layout, this);
mGo = (ImageButton) findViewById(R.id.go);
mEditText = (ToolbarEditText) findViewById(R.id.url_edit_text);
}
@Override
public void onAttachedToWindow() {
mGo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mCommitListener != null) {
mCommitListener.onCommit();
}
}
});
mEditText.setOnTextTypeChangeListener(new OnTextTypeChangeListener() {
@Override
public void onTextTypeChange(ToolbarEditText editText, TextType textType) {
updateGoButton(textType);
}
});
mEditText.setOnFocusChangeListener(new OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
@ -85,8 +61,6 @@ public class ToolbarEditLayout extends ThemedLinearLayout {
@Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
mGo.setEnabled(enabled);
mEditText.setEnabled(enabled);
}
@ -96,44 +70,13 @@ public class ToolbarEditLayout extends ThemedLinearLayout {
mEditText.setPrivateMode(isPrivate);
}
private void updateGoButton(TextType textType) {
if (textType == TextType.EMPTY) {
mGo.setVisibility(View.GONE);
return;
}
mGo.setVisibility(View.VISIBLE);
final int imageResource;
final String contentDescription;
if (textType == TextType.SEARCH_QUERY) {
imageResource = R.drawable.ic_url_bar_search;
contentDescription = getContext().getString(R.string.search);
} else {
imageResource = R.drawable.ic_url_bar_go;
contentDescription = getContext().getString(R.string.go);
}
mGo.setImageResource(imageResource);
mGo.setContentDescription(contentDescription);
}
private void showSoftInput() {
InputMethodManager imm =
(InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(mEditText, InputMethodManager.SHOW_IMPLICIT);
}
void prepareAnimation(final boolean showing, final PropertyAnimator animator) {
if (showing) {
prepareShowAnimation(animator);
} else {
prepareHideAnimation(animator);
}
}
private void prepareShowAnimation(final PropertyAnimator animator) {
void prepareShowAnimation(final PropertyAnimator animator) {
if (animator == null) {
mEditText.requestFocus();
showSoftInput();
@ -143,39 +86,17 @@ public class ToolbarEditLayout extends ThemedLinearLayout {
animator.addPropertyAnimationListener(new PropertyAnimationListener() {
@Override
public void onPropertyAnimationStart() {
ViewHelper.setAlpha(mGo, 0.0f);
mEditText.requestFocus();
}
@Override
public void onPropertyAnimationEnd() {
ViewHelper.setAlpha(mGo, 1.0f);
showSoftInput();
}
});
}
private void prepareHideAnimation(final PropertyAnimator animator) {
if (animator == null) {
return;
}
animator.addPropertyAnimationListener(new PropertyAnimationListener() {
@Override
public void onPropertyAnimationStart() {
ViewHelper.setAlpha(mGo, 0.0f);
}
@Override
public void onPropertyAnimationEnd() {
// The enclosing view is invisible, so unhide the go button.
ViewHelper.setAlpha(mGo, 1.0f);
}
});
}
void setOnCommitListener(OnCommitListener listener) {
mCommitListener = listener;
mEditText.setOnCommitListener(listener);
}

View File

@ -711,7 +711,7 @@ Sync11Service.prototype = {
// Go ahead and do remote setup, so that we can determine
// conclusively that our passphrase is correct.
if (this._remoteSetup()) {
if (this._remoteSetup(test)) {
// Username/password verified.
this.status.login = LOGIN_SUCCEEDED;
return true;

View File

@ -69,16 +69,18 @@ class B2GCommands(MachCommandBase):
@Command('marionette-webapi', category='testing',
description='Run a Marionette webapi test',
conditions=[conditions.is_b2g])
@CommandArgument('--emulator', choices=['x86', 'arm'],
help='Run an emulator of the specified architecture.')
@CommandArgument('--type', dest='testtype',
help='Test type, usually one of: browser, b2g, b2g-qemu.',
default='b2g')
@CommandArgument('tests', nargs='*', metavar='TESTS',
help='Path to test(s) to run.')
def run_marionette_webapi(self, tests, emulator=None, testtype=None):
if not emulator and self.device_name.find('emulator') == 0:
emulator='arm'
def run_marionette_webapi(self, tests, testtype=None):
emulator = None
if self.device_name:
if self.device_name.startswith('emulator'):
emulator = 'arm'
if 'x86' in self.device_name:
emulator = 'x86'
if self.substs.get('ENABLE_MARIONETTE') != '1':
print(MARIONETTE_DISABLED_B2G % 'marionette-webapi')

View File

@ -552,10 +552,6 @@ def B2GCommand(func):
help='Define size of sdcard: 1MB, 50MB...etc')
func = sdcard(func)
emulator = CommandArgument('--emulator', default='arm',
help='Architecture of emulator to use: x86 or arm')
func = emulator(func)
marionette = CommandArgument('--marionette', default=None,
help='host:port to use when connecting to Marionette')
func = marionette(func)
@ -659,7 +655,7 @@ class MachCommands(MachCommandBase):
# they should be modified to work with all devices.
def is_emulator(cls):
"""Emulator needs to be configured."""
return cls.device_name.find('emulator') == 0
return cls.device_name.startswith('emulator')
@CommandProvider
@ -681,6 +677,12 @@ class B2GCommands(MachCommandBase):
def run_mochitest_remote(self, test_paths, **kwargs):
from mozbuild.controller.building import BuildDriver
if self.device_name.startswith('emulator'):
emulator = 'arm'
if 'x86' in self.device_name:
emulator = 'x86'
kwargs['emulator'] = emulator
self._ensure_state_subdir_exists('.')
driver = self._spawn(BuildDriver)

View File

@ -34,7 +34,10 @@ If you have a B2G build, this can be found in
'%s/out/host/<platform>/bin'.
'''.lstrip()
BUSYBOX_URL = 'http://www.busybox.net/downloads/binaries/latest/busybox-armv7l'
BUSYBOX_URLS = {
'arm': 'http://www.busybox.net/downloads/binaries/latest/busybox-armv7l',
'x86': 'http://www.busybox.net/downloads/binaries/latest/busybox-i686'
}
if sys.version_info[0] < 3:
@ -303,8 +306,11 @@ class B2GXPCShellRunner(MozbuildObject):
self.xpcshell_dir = os.path.join(self.tests_dir, 'xpcshell')
self.bin_dir = os.path.join(self.distdir, 'bin')
def _download_busybox(self, b2g_home):
system_bin = os.path.join(b2g_home, 'out', 'target', 'product', 'generic', 'system', 'bin')
def _download_busybox(self, b2g_home, emulator):
target_device = 'generic'
if emulator == 'x86':
target_device = 'generic_x86'
system_bin = os.path.join(b2g_home, 'out', 'target', 'product', target_device, 'system', 'bin')
busybox_path = os.path.join(system_bin, 'busybox')
if os.path.isfile(busybox_path):
@ -314,7 +320,7 @@ class B2GXPCShellRunner(MozbuildObject):
os.makedirs(system_bin)
try:
data = urllib2.urlopen(BUSYBOX_URL)
data = urllib2.urlopen(BUSYBOX_URLS[emulator])
except urllib2.URLError:
print('There was a problem downloading busybox. Proceeding without it,' \
'initial setup will be slow.')
@ -324,7 +330,7 @@ class B2GXPCShellRunner(MozbuildObject):
f.write(data.read())
return busybox_path
def run_test(self, test_paths, b2g_home=None, busybox=None,
def run_test(self, test_paths, b2g_home=None, busybox=None, device_name=None,
# ignore parameters from other platforms' options
**kwargs):
try:
@ -348,7 +354,6 @@ class B2GXPCShellRunner(MozbuildObject):
options.b2g_path = b2g_home
options.busybox = busybox or os.environ.get('BUSYBOX')
options.emulator = 'arm'
options.localLib = self.bin_dir
options.localBin = self.bin_dir
options.logcat_dir = self.xpcshell_dir
@ -361,8 +366,13 @@ class B2GXPCShellRunner(MozbuildObject):
options.testPath = test_path
options.use_device_libs = True
options.emulator = 'arm'
if device_name.startswith('emulator'):
if 'x86' in device_name:
options.emulator = 'x86'
if not options.busybox:
options.busybox = self._download_busybox(b2g_home)
options.busybox = self._download_busybox(b2g_home, options.emulator)
return runtestsb2g.run_remote_xpcshell(parser, options, args)
@ -436,6 +446,7 @@ class MachCommands(MachCommandBase):
elif conditions.is_b2g(self):
xpcshell = self._spawn(B2GXPCShellRunner)
params['b2g_home'] = self.b2g_home
params['device_name'] = self.device_name
else:
xpcshell = self._spawn(XPCShellRunner)
xpcshell.cwd = self._mach_context.cwd

View File

@ -284,10 +284,7 @@ this.DownloadIntegration = {
// Now get the path for this storage area.
if (preferredStorageName) {
let volume = volumeService.getVolumeByName(preferredStorageName);
if (volume &&
volume.isMediaPresent &&
!volume.isMountLocked &&
!volume.isSharing) {
if (volume && volume.state === Ci.nsIVolume.STATE_MOUNTED){
directoryPath = OS.Path.join(volume.mountPoint, "downloads");
yield OS.File.makeDir(directoryPath, { ignoreExisting: true });
}

View File

@ -21,6 +21,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "Task",
"resource://gre/modules/Task.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch",
"resource://gre/modules/TelemetryStopwatch.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
"resource://gre/modules/Deprecated.jsm");
// A text encoder to UTF8, used whenever we commit the
// engine metadata to disk.
@ -2877,8 +2879,7 @@ SearchService.prototype = {
"Search service falling back to synchronous initialization. " +
"This is generally the consequence of an add-on using a deprecated " +
"search service API.";
// Bug 785487 - Disable warning until our own callers are fixed.
//Deprecated.warning(warning, "https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIBrowserSearchService#async_warning");
Deprecated.warning(warning, "https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIBrowserSearchService#async_warning");
LOG(warning);
engineMetadataService.syncInit();

View File

@ -6,6 +6,7 @@
"use strict";
const { Ci } = require("chrome");
const Services = require("Services");
const { ActorPool, appendExtraActors, createExtraActors } = require("devtools/server/actors/common");
const { DebuggerServer } = require("devtools/server/main");