mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-05 00:02:37 +00:00
Merge m-c to m-i
This commit is contained in:
commit
d01cf10a7b
@ -12,7 +12,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="2a698b3ee70d1811822d940c1b740b5adebea1ff"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="fd157cf37c851fdbd97075f414ea07e8e8f28b52"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="eda08beb3ba9a159843c70ffde0f9660ec351eb9"/>
|
||||
@ -98,4 +98,4 @@
|
||||
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="a3daa50e9b5db558696951ae724f913e4e5c7489"/>
|
||||
<project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="83dbccadb19d0d3c07828c2bb0e5c2be12c0f980"/>
|
||||
<project name="android-sdk" path="sdk" remote="b2g" revision="5701d3cb45c2e848cc57003cda2e1141288ecae4"/>
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
@ -11,7 +11,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="2a698b3ee70d1811822d940c1b740b5adebea1ff"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="fd157cf37c851fdbd97075f414ea07e8e8f28b52"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="96d2d00165f4561fbde62d1062706eab74b3a01f"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="221bcaecbbbc9d185f691471b64aed9e75b0c11d"/>
|
||||
@ -131,4 +131,4 @@
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="2838a77ce4b8c09fa6a46fe25410bb3a4474cbd4"/>
|
||||
<project name="platform/development" path="development" revision="1f18cfe031ce23b7fb838fe3d4379dd802b49e71"/>
|
||||
<project name="android-sdk" path="sdk" remote="b2g" revision="8b1365af38c9a653df97349ee53a3f5d64fd590a"/>
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
@ -12,7 +12,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="2a698b3ee70d1811822d940c1b740b5adebea1ff"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="fd157cf37c851fdbd97075f414ea07e8e8f28b52"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="eda08beb3ba9a159843c70ffde0f9660ec351eb9"/>
|
||||
@ -98,4 +98,4 @@
|
||||
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="a3daa50e9b5db558696951ae724f913e4e5c7489"/>
|
||||
<project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="83dbccadb19d0d3c07828c2bb0e5c2be12c0f980"/>
|
||||
<project name="android-sdk" path="sdk" remote="b2g" revision="5701d3cb45c2e848cc57003cda2e1141288ecae4"/>
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"revision": "997156ae4adde76831ba2fccce33ae340f897f75",
|
||||
"revision": "d7643b0dfd7a670658780952587f95e20b251fc3",
|
||||
"repo_path": "/integration/gaia-central"
|
||||
}
|
||||
|
@ -11,7 +11,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="2a698b3ee70d1811822d940c1b740b5adebea1ff"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="fd157cf37c851fdbd97075f414ea07e8e8f28b52"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
|
||||
@ -90,7 +90,7 @@
|
||||
<project name="platform/system/netd" path="system/netd" revision="2e226e6e636ca0a8cc4c51093e46f4baba1ffcce"/>
|
||||
<project name="platform/system/vold" path="system/vold" revision="8ac5eef8ea3a456b96d52ce2091bf6d814782d8c"/>
|
||||
<!-- hamachi specific things -->
|
||||
<project name="quic/lf/b2g/build" path="device/qcom/b2g_common" revision="2e484664c353fd739200b908dce85500be870d43"/>
|
||||
<project name="quic/lf/b2g/build" path="device/qcom/b2g_common" revision="4970f51b2c66f842dfcbc8315c8e501d0b2ac791"/>
|
||||
<project name="quic/lf/b2g/external/jsmin" path="external/jsmin" revision="cec896f0affaa0226c02605ad28d42df1bc0e393"/>
|
||||
<project name="device/qcom/common" path="device/qcom/common" revision="d13aaf080177b7c48f243d51827db5c7a7873cd0"/>
|
||||
<project name="platform/vendor/qcom/msm7627a" path="device/qcom/msm7627a" revision="f06bcacc6f13cec895dc5d4c2385c076396194ec"/>
|
||||
@ -103,4 +103,4 @@
|
||||
<project name="platform/hardware/msm7k" path="hardware/msm7k" revision="693e65da9905d88c23653b45800e6509143f6a78"/>
|
||||
<project name="platform/vendor/qcom-opensource/omx/mm-core" path="vendor/qcom/opensource/omx/mm-core" revision="0365db6af2d4df11184a421f97c5043db47a0c0d"/>
|
||||
<project name="platform/hardware/ril" path="hardware/ril" revision="ec40c0aee736052fc4fe01c1b8dc16929da5dc45"/>
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
@ -10,7 +10,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="2a698b3ee70d1811822d940c1b740b5adebea1ff"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="fd157cf37c851fdbd97075f414ea07e8e8f28b52"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
|
||||
@ -100,4 +100,4 @@
|
||||
<project name="platform/hardware/qcom/gps" path="hardware/qcom/gps" revision="1698e6e9ed7cf1d543508845fa05ed86c7e5e241"/>
|
||||
<project name="platform/hardware/msm7k" path="hardware/msm7k" revision="669815aaca47afee95b4a95908dc87bff267a815"/>
|
||||
<project name="platform/vendor/qcom-opensource/omx/mm-core" path="vendor/qcom/opensource/omx/mm-core" revision="0365db6af2d4df11184a421f97c5043db47a0c0d"/>
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
@ -12,7 +12,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="2a698b3ee70d1811822d940c1b740b5adebea1ff"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="fd157cf37c851fdbd97075f414ea07e8e8f28b52"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
|
||||
@ -105,4 +105,4 @@
|
||||
<project name="platform/hardware/msm7k" path="hardware/msm7k" revision="8892d46805c5639b55dd07547745c5180da861e7"/>
|
||||
<project name="platform/vendor/qcom-opensource/omx/mm-core" path="vendor/qcom/opensource/omx/mm-core" revision="ab17ac9a074b4bb69986a8436336bdfbbaf9cd39"/>
|
||||
<project name="platform/hardware/ril" path="hardware/ril" remote="caf" revision="fe9a3f63922143b57e79ed570bab2328df8c83a5"/>
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
@ -11,7 +11,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="2a698b3ee70d1811822d940c1b740b5adebea1ff"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="fd157cf37c851fdbd97075f414ea07e8e8f28b52"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
|
||||
@ -101,4 +101,4 @@
|
||||
<project name="platform/hardware/qcom/gps" path="hardware/qcom/gps" revision="1698e6e9ed7cf1d543508845fa05ed86c7e5e241"/>
|
||||
<project name="platform/hardware/msm7k" path="hardware/msm7k" revision="669815aaca47afee95b4a95908dc87bff267a815"/>
|
||||
<project name="platform/vendor/qcom-opensource/omx/mm-core" path="vendor/qcom/opensource/omx/mm-core" revision="0365db6af2d4df11184a421f97c5043db47a0c0d"/>
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
@ -11,7 +11,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="2a698b3ee70d1811822d940c1b740b5adebea1ff"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="fd157cf37c851fdbd97075f414ea07e8e8f28b52"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="96d2d00165f4561fbde62d1062706eab74b3a01f"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="221bcaecbbbc9d185f691471b64aed9e75b0c11d"/>
|
||||
@ -141,4 +141,4 @@
|
||||
<project name="platform/hardware/qcom/sensors" path="hardware/qcom/sensors" revision="15488e251d83ad881a61f7045c64c711f5eaf082"/>
|
||||
<project name="platform/hardware/qcom/wlan" path="hardware/qcom/wlan" revision="7bc1339234f8b8387df491c0ced88fffd7d505f0"/>
|
||||
<project name="platform/hardware/ril" path="hardware/ril" revision="d9f3acd2ac2db63697a24f29dbf04083aedbccf8"/>
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
@ -11,7 +11,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="2a698b3ee70d1811822d940c1b740b5adebea1ff"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="fd157cf37c851fdbd97075f414ea07e8e8f28b52"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
|
||||
@ -102,4 +102,4 @@
|
||||
<project name="platform/hardware/qcom/media" path="hardware/qcom/media" revision="552c3ddb7174a01f3508782d40c4d8c845ab441a"/>
|
||||
<project name="platform/hardware/qcom/gps" path="hardware/qcom/gps" revision="23d5707b320d7fc69f8ba3b7d84d78a1c5681708"/>
|
||||
<project name="platform/vendor/qcom-opensource/omx/mm-core" path="vendor/qcom/opensource/omx/mm-core" revision="ab17ac9a074b4bb69986a8436336bdfbbaf9cd39"/>
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
@ -510,14 +510,14 @@ var FullZoom = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Asynchronously broadcasts "FullZoom:TESTS:location-change" so that tests
|
||||
* can select tabs, load pages, etc. and be notified when the zoom levels on
|
||||
* those pages change. The notification is always asynchronous so that
|
||||
* observers are guaranteed a consistent behavior.
|
||||
* Asynchronously broadcasts "browser-fullZoom:location-change" so that
|
||||
* listeners can be notified when the zoom levels on those pages change.
|
||||
* The notification is always asynchronous so that observers are guaranteed a
|
||||
* consistent behavior.
|
||||
*/
|
||||
_notifyOnLocationChange: function FullZoom__notifyOnLocationChange() {
|
||||
this._executeSoon(function () {
|
||||
Services.obs.notifyObservers(null, "FullZoom:TESTS:location-change", "");
|
||||
Services.obs.notifyObservers(null, "browser-fullZoom:location-change", "");
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -317,7 +317,7 @@ let FullZoomHelper = {
|
||||
Services.obs.addObserver(function obs(subj, topic, data) {
|
||||
Services.obs.removeObserver(obs, topic);
|
||||
deferred.resolve();
|
||||
}, "FullZoom:TESTS:location-change", false);
|
||||
}, "browser-fullZoom:location-change", false);
|
||||
return deferred.promise;
|
||||
},
|
||||
|
||||
|
@ -376,6 +376,7 @@ const CustomizableWidgets = [{
|
||||
// Register ourselves with the service so we know when the zoom prefs change.
|
||||
Services.obs.addObserver(updateZoomResetButton, "browser-fullZoom:zoomChange", false);
|
||||
Services.obs.addObserver(updateZoomResetButton, "browser-fullZoom:zoomReset", false);
|
||||
Services.obs.addObserver(updateZoomResetButton, "browser-fullZoom:location-change", false);
|
||||
|
||||
if (inPanel) {
|
||||
let panel = aDocument.getElementById(kPanelId);
|
||||
@ -446,6 +447,7 @@ const CustomizableWidgets = [{
|
||||
CustomizableUI.removeListener(listener);
|
||||
Services.obs.removeObserver(updateZoomResetButton, "browser-fullZoom:zoomChange");
|
||||
Services.obs.removeObserver(updateZoomResetButton, "browser-fullZoom:zoomReset");
|
||||
Services.obs.removeObserver(updateZoomResetButton, "browser-fullZoom:location-change");
|
||||
let panel = aDoc.getElementById(kPanelId);
|
||||
panel.removeEventListener("popupshowing", updateZoomResetButton);
|
||||
let container = aDoc.defaultView.gBrowser.tabContainer;
|
||||
|
@ -14,6 +14,13 @@ add_task(function() {
|
||||
gBrowser.selectedTab = tab1;
|
||||
let zoomResetButton = document.getElementById("zoom-reset-button");
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
info("Cleaning up.");
|
||||
CustomizableUI.reset();
|
||||
gBrowser.removeTab(tab2);
|
||||
gBrowser.removeTab(tab1);
|
||||
});
|
||||
|
||||
is(parseInt(zoomResetButton.label, 10), 100, "Default zoom is 100% for about:mozilla");
|
||||
let zoomChangePromise = promiseObserverNotification("browser-fullZoom:zoomChange");
|
||||
FullZoom.enlarge();
|
||||
@ -31,9 +38,16 @@ add_task(function() {
|
||||
yield zoomResetPromise;
|
||||
is(parseInt(zoomResetButton.label, 10), 100, "Default zoom is 100% for about:mozilla");
|
||||
|
||||
CustomizableUI.reset();
|
||||
gBrowser.removeTab(tab2);
|
||||
gBrowser.removeTab(tab1);
|
||||
// Test zoom label updates while navigating pages in the same tab.
|
||||
FullZoom.enlarge();
|
||||
yield zoomChangePromise;
|
||||
is(parseInt(zoomResetButton.label, 10), 110, "Zoom is changed to 110% for about:mozilla");
|
||||
yield promiseTabLoadEvent(tab1, "about:home");
|
||||
is(parseInt(zoomResetButton.label, 10), 100, "Default zoom is 100% for about:home");
|
||||
yield promiseTabHistoryNavigation(-1, function() {
|
||||
return parseInt(zoomResetButton.label, 10) == 110;
|
||||
});
|
||||
is(parseInt(zoomResetButton.label, 10), 110, "Zoom is still 110% for about:mozilla");
|
||||
});
|
||||
|
||||
function promiseObserverNotification(aObserver) {
|
||||
|
@ -20,6 +20,7 @@ registerCleanupFunction(() => Services.prefs.clearUserPref("browser.uiCustomizat
|
||||
let {synthesizeDragStart, synthesizeDrop} = ChromeUtils;
|
||||
|
||||
const kNSXUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
const kTabEventFailureTimeoutInMs = 20000;
|
||||
|
||||
function createDummyXULButton(id, label) {
|
||||
let btn = document.createElementNS(kNSXUL, "toolbarbutton");
|
||||
@ -304,3 +305,70 @@ function waitFor(aTimeout=100) {
|
||||
setTimeout(function() deferred.resolve(), aTimeout);
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts a load in an existing tab and waits for it to finish (via some event).
|
||||
*
|
||||
* @param aTab The tab to load into.
|
||||
* @param aUrl The url to load.
|
||||
* @param aEventType The load event type to wait for. Defaults to "load".
|
||||
* @return {Promise} resolved when the event is handled.
|
||||
*/
|
||||
function promiseTabLoadEvent(aTab, aURL, aEventType="load") {
|
||||
let deferred = Promise.defer();
|
||||
info("Wait for tab event: " + aEventType);
|
||||
|
||||
let timeoutId = setTimeout(() => {
|
||||
aTab.linkedBrowser.removeEventListener(aEventType, onTabLoad, true);
|
||||
deferred.reject("TabSelect did not happen within " + kTabEventFailureTimeoutInMs + "ms");
|
||||
}, kTabEventFailureTimeoutInMs);
|
||||
|
||||
function onTabLoad(event) {
|
||||
if (event.originalTarget != aTab.linkedBrowser.contentDocument ||
|
||||
event.target.location.href == "about:blank") {
|
||||
info("skipping spurious load event");
|
||||
return;
|
||||
}
|
||||
clearTimeout(timeoutId);
|
||||
aTab.linkedBrowser.removeEventListener(aEventType, onTabLoad, true);
|
||||
info("Tab event received: " + aEventType);
|
||||
deferred.resolve();
|
||||
}
|
||||
aTab.linkedBrowser.addEventListener(aEventType, onTabLoad, true, true);
|
||||
aTab.linkedBrowser.loadURI(aURL);
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
/**
|
||||
* Navigate back or forward in tab history and wait for it to finish.
|
||||
*
|
||||
* @param aDirection Number to indicate to move backward or forward in history.
|
||||
* @param aConditionFn Function that returns the result of an evaluated condition
|
||||
* that needs to be `true` to resolve the promise.
|
||||
* @return {Promise} resolved when navigation has finished.
|
||||
*/
|
||||
function promiseTabHistoryNavigation(aDirection = -1, aConditionFn) {
|
||||
let deferred = Promise.defer();
|
||||
|
||||
let timeoutId = setTimeout(() => {
|
||||
gBrowser.removeEventListener("pageshow", listener, true);
|
||||
deferred.reject("Pageshow did not happen within " + kTabEventFailureTimeoutInMs + "ms");
|
||||
}, kTabEventFailureTimeoutInMs);
|
||||
|
||||
function listener(event) {
|
||||
gBrowser.removeEventListener("pageshow", listener, true);
|
||||
clearTimeout(timeoutId);
|
||||
|
||||
if (aConditionFn) {
|
||||
waitForCondition(aConditionFn).then(() => deferred.resolve(),
|
||||
aReason => deferred.reject(aReason));
|
||||
} else {
|
||||
deferred.resolve();
|
||||
}
|
||||
}
|
||||
gBrowser.addEventListener("pageshow", listener, true);
|
||||
|
||||
content.history.go(aDirection);
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ function test() {
|
||||
function doTestWhenReady(aIsZoomedWindow, aWindow, aCallback) {
|
||||
// Need to wait on two things, the ordering of which is not guaranteed:
|
||||
// (1) the page load, and (2) FullZoom's update to the new page's zoom
|
||||
// level. FullZoom broadcasts "FullZoom:TESTS:location-change" when its
|
||||
// level. FullZoom broadcasts "browser-fullZoom:location-change" when its
|
||||
// update is done. (See bug 856366 for details.)
|
||||
|
||||
let n = 0;
|
||||
@ -30,7 +30,7 @@ function test() {
|
||||
Services.obs.removeObserver(onLocationChange, topic);
|
||||
if (++n == 2)
|
||||
doTest(aIsZoomedWindow, aWindow, aCallback);
|
||||
}, "FullZoom:TESTS:location-change", false);
|
||||
}, "browser-fullZoom:location-change", false);
|
||||
|
||||
browser.loadURI("about:blank");
|
||||
}
|
||||
|
@ -5,6 +5,9 @@
|
||||
package org.mozilla.gecko.favicons.decoders;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.util.Base64;
|
||||
import android.util.Log;
|
||||
|
||||
import org.mozilla.gecko.gfx.BitmapUtils;
|
||||
|
||||
import java.util.Iterator;
|
||||
@ -14,6 +17,8 @@ import java.util.NoSuchElementException;
|
||||
* Class providing static utility methods for decoding favicons.
|
||||
*/
|
||||
public class FaviconDecoder {
|
||||
private static final String LOG_TAG = "GeckoFaviconDecoder";
|
||||
|
||||
static enum ImageMagicNumbers {
|
||||
// It is irritating that Java bytes are signed...
|
||||
PNG(new byte[] {(byte) (0x89 & 0xFF), 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a}),
|
||||
@ -108,6 +113,34 @@ public class FaviconDecoder {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static LoadFaviconResult decodeDataURI(String uri) {
|
||||
if (uri == null) {
|
||||
Log.w(LOG_TAG, "Can't decode null data: URI.");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!uri.startsWith("data:image/")) {
|
||||
Log.w(LOG_TAG, "Can't decode non-image data: URI.");
|
||||
return null;
|
||||
}
|
||||
|
||||
// Otherwise, let's attack this blindly. Strictly we should be parsing.
|
||||
int offset = uri.indexOf(',') + 1;
|
||||
if (offset == 0) {
|
||||
Log.w(LOG_TAG, "No ',' in data: URI; malformed?");
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
String base64 = uri.substring(offset);
|
||||
byte[] raw = Base64.decode(base64, Base64.DEFAULT);
|
||||
return decodeFavicon(raw);
|
||||
} catch (Exception e) {
|
||||
Log.w(LOG_TAG, "Couldn't decode data: URI.", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static LoadFaviconResult decodeFavicon(byte[] buffer) {
|
||||
return decodeFavicon(buffer, 0, buffer.length);
|
||||
}
|
||||
|
@ -17,11 +17,15 @@ import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import org.mozilla.gecko.favicons.decoders.FaviconDecoder;
|
||||
import org.mozilla.gecko.favicons.decoders.LoadFaviconResult;
|
||||
import org.mozilla.gecko.favicons.Favicons;
|
||||
import org.mozilla.gecko.R;
|
||||
import org.mozilla.gecko.gfx.BitmapUtils;
|
||||
import org.mozilla.gecko.util.ThreadUtils;
|
||||
import org.mozilla.gecko.widget.FaviconView;
|
||||
|
||||
@ -125,7 +129,55 @@ public class SearchEnginePreference extends Preference implements View.OnLongCli
|
||||
final String iconURI = geckoEngineJSON.getString("iconURI");
|
||||
// Keep a reference to the bitmap - we'll need it later in onBindView.
|
||||
try {
|
||||
mIconBitmap = BitmapUtils.getBitmapFromDataURI(iconURI);
|
||||
|
||||
// Bug 961600: we shouldn't be doing all of this work. The favicon cache
|
||||
// should be used, and will give us the right size icon.
|
||||
|
||||
LoadFaviconResult result = FaviconDecoder.decodeDataURI(iconURI);
|
||||
if (result == null) {
|
||||
// Nothing we can do.
|
||||
Log.w(LOGTAG, "Unable to decode icon URI.");
|
||||
return;
|
||||
}
|
||||
|
||||
Iterator<Bitmap> bitmaps = result.getBitmaps();
|
||||
if (!bitmaps.hasNext()) {
|
||||
Log.w(LOGTAG, "No bitmaps in decoded icon.");
|
||||
return;
|
||||
}
|
||||
|
||||
mIconBitmap = bitmaps.next();
|
||||
|
||||
if (!bitmaps.hasNext()) {
|
||||
// We're done! There was only one, so this is as big as it gets.
|
||||
return;
|
||||
}
|
||||
|
||||
// Find a bitmap of a more suitable size.
|
||||
final int desiredWidth;
|
||||
if (mFaviconView != null) {
|
||||
desiredWidth = mFaviconView.getWidth();
|
||||
} else {
|
||||
// sLargestFaviconSize is initialized when Favicons is attached to a
|
||||
// context, which occurs during GeckoApp.onCreate. That might not
|
||||
// ever happen (leaving it at 0), so we fall back.
|
||||
if (Favicons.sLargestFaviconSize == 0) {
|
||||
desiredWidth = 128;
|
||||
} else {
|
||||
desiredWidth = Favicons.sLargestFaviconSize;
|
||||
}
|
||||
}
|
||||
|
||||
int currentWidth = mIconBitmap.getWidth();
|
||||
while ((currentWidth < desiredWidth) &&
|
||||
bitmaps.hasNext()) {
|
||||
Bitmap b = bitmaps.next();
|
||||
if (b.getWidth() > currentWidth) {
|
||||
currentWidth = b.getWidth();
|
||||
mIconBitmap = b;
|
||||
}
|
||||
}
|
||||
|
||||
} catch (IllegalArgumentException e) {
|
||||
Log.e(LOGTAG, "IllegalArgumentException creating Bitmap. Most likely a zero-length bitmap.", e);
|
||||
} catch (NullPointerException e) {
|
||||
|
@ -7013,7 +7013,9 @@ var SearchEngines = {
|
||||
mDBConn.executeAsync(stmts, stmts.length, {
|
||||
handleResult: function (results) {
|
||||
let bytes = results.getNextRow().getResultByName("favicon");
|
||||
favicon = "data:image/png;base64," + btoa(String.fromCharCode.apply(null, bytes));
|
||||
if (bytes && bytes.length) {
|
||||
favicon = "data:image/x-icon;base64," + btoa(String.fromCharCode.apply(null, bytes));
|
||||
}
|
||||
},
|
||||
handleCompletion: function (reason) {
|
||||
// if there's already an engine with this name, add a number to
|
||||
|
Loading…
x
Reference in New Issue
Block a user