Bug 1216271 - Follow-up to add L10N notes and fix style to use an early return. r=me
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Sun, 01 Nov 2015 17:11:23 -0800
changeset 270739 4588cec1d8824b50bc1a5d78beb150437eeef9a1
parent 270738 5e9b4eb51b6242a067f678655621ca74a314b98b
child 270740 e3afc3186d856cec63a8207de506326a9ea24751
push id67436
push usercbook@mozilla.com
push dateMon, 02 Nov 2015 11:04:40 +0000
treeherdermozilla-inbound@f45fb9a0db0e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1216271
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1216271 - Follow-up to add L10N notes and fix style to use an early return. r=me
browser/base/content/test/alerts/head.js
browser/locales/en-US/chrome/browser/browser.properties
--- a/browser/base/content/test/alerts/head.js
+++ b/browser/base/content/test/alerts/head.js
@@ -1,29 +1,32 @@
 function promiseAlertWindow() {
   return new Promise(function(resolve) {
     let listener = {
       onOpenWindow(window) {
         let alertWindow = window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow);
         alertWindow.addEventListener("load", function onLoad() {
           alertWindow.removeEventListener("load", onLoad);
           let windowType = alertWindow.document.documentElement.getAttribute("windowtype");
-          if (windowType == "alert:alert") {
-            Services.wm.removeListener(listener);
-            resolve(alertWindow);
+          if (windowType != "alert:alert") {
+            return;
           }
+          Services.wm.removeListener(listener);
+          resolve(alertWindow);
         });
       },
     };
     Services.wm.addListener(listener);
   });
 }
 
-// `promiseWindowClosed` is similar to `BrowserTestUtils.closeWindow`, but
-// doesn't call `window.close()`.
+/**
+ * Similar to `BrowserTestUtils.closeWindow`, but
+ * doesn't call `window.close()`.
+ */
 function promiseWindowClosed(window) {
   return new Promise(function(resolve) {
     Services.ww.registerNotification(function observer(subject, topic, data) {
       if (topic == "domwindowclosed" && subject == window) {
         Services.ww.unregisterNotification(observer);
         resolve();
       }
     });
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -377,17 +377,19 @@ geolocation.shareWithFile2=Would you lik
 
 webNotifications.receiveForSession=Receive for this session
 webNotifications.receiveForSession.accesskey=s
 webNotifications.alwaysReceive=Always Receive Notifications
 webNotifications.alwaysReceive.accesskey=A
 webNotifications.neverShow=Always Block Notifications
 webNotifications.neverShow.accesskey=N
 webNotifications.receiveFromSite=Would you like to receive notifications from this site?
+# LOCALIZATION NOTE (webNotifications.upgradeTitle): When using native notifications on OS X, the title may be truncated around 32 characters.
 webNotifications.upgradeTitle=Upgraded notifications
+# LOCALIZATION NOTE (webNotifications.upgradeInfo): When using native notifications on OS X, the body may be truncated around 100 characters in some views.
 webNotifications.upgradeInfo=You will receive notifications from sites, even those not open in a tab. Click to learn more.
 
 # Pointer lock UI
 
 pointerLock.allow2=Hide pointer
 pointerLock.allow2.accesskey=H
 pointerLock.alwaysAllow=Always allow hiding
 pointerLock.alwaysAllow.accesskey=A