Bug 904256 - Rename the browser-fullZoom:locationChange notification to make it clear it should only be used by tests. r=gavin

This commit is contained in:
Drew Willcoxon 2013-08-12 16:41:43 -07:00
Родитель 24933e1c69
Коммит a0a4d6f410
3 изменённых файлов: 11 добавлений и 12 удалений

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

@ -546,14 +546,14 @@ var FullZoom = {
},
/**
* Asynchronously broadcasts a "browser-fullZoom:locationChange" notification
* 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 "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.
*/
_notifyOnLocationChange: function FullZoom__notifyOnLocationChange() {
this._executeSoon(function () {
Services.obs.notifyObservers(null, "browser-fullZoom:locationChange", "");
Services.obs.notifyObservers(null, "FullZoom:TESTS:location-change", "");
});
},

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

@ -300,10 +300,10 @@ let FullZoomHelper = {
}
if (tab)
gBrowser.selectedTab = tab;
Services.obs.addObserver(function obs() {
Services.obs.removeObserver(obs, "browser-fullZoom:locationChange");
Services.obs.addObserver(function obs(subj, topic, data) {
Services.obs.removeObserver(obs, topic);
deferred.resolve();
}, "browser-fullZoom:locationChange", false);
}, "FullZoom:TESTS:location-change", false);
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 "browser-fullZoom:locationChange" when its
// level. FullZoom broadcasts "FullZoom:TESTS:location-change" when its
// update is done. (See bug 856366 for details.)
let n = 0;
@ -26,12 +26,11 @@ function test() {
doTest(aIsZoomedWindow, aWindow, aCallback);
}, true);
let topic = "browser-fullZoom:locationChange";
Services.obs.addObserver(function onLocationChange() {
Services.obs.addObserver(function onLocationChange(subj, topic, data) {
Services.obs.removeObserver(onLocationChange, topic);
if (++n == 2)
doTest(aIsZoomedWindow, aWindow, aCallback);
}, topic, false);
}, "FullZoom:TESTS:location-change", false);
browser.loadURI("about:blank");
}