Skip to content

Commit

Permalink
Merge f-t to m-c, a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
philor committed Feb 22, 2015
2 parents e53fa58 + 0ee0c8c commit 6dcfd64
Show file tree
Hide file tree
Showing 16 changed files with 660 additions and 18 deletions.
25 changes: 25 additions & 0 deletions accessible/tests/mochitest/events/test_docload.html
Expand Up @@ -15,6 +15,25 @@
src="../role.js"></script>
<script type="application/javascript"
src="../states.js"></script>

<script type="application/javascript">
// Front end stuff sometimes likes to stuff things in the hidden window(s)
// in which case there's accessibles for that content.
Components.utils.import("resource://gre/modules/Services.jsm");

// Force the creation of an accessible for the hidden window's document.
var doc = Services.appShell.hiddenDOMWindow.document;
gAccRetrieval.getAccessibleFor(doc);

// The private hidden window will be lazily created that's why we need to do
// it here *before* loading '../events.js' or else we'll have a duplicate
// reorder event.
var privateDoc = Services.appShell.hiddenPrivateDOMWindow.document;

// Force the creation of an accessible for the private hidden window's doc.
gAccRetrieval.getAccessibleFor(privateDoc);
</script>

<script type="application/javascript"
src="../events.js"></script>

Expand Down Expand Up @@ -174,6 +193,12 @@
var accTree = {
role: ROLE_APP_ROOT,
children: [
{
role: ROLE_CHROME_WINDOW
},
{
role: ROLE_CHROME_WINDOW
},
{
role: ROLE_CHROME_WINDOW
},
Expand Down
6 changes: 2 additions & 4 deletions browser/app/profile/firefox.js
Expand Up @@ -860,11 +860,7 @@ pref("browser.preferences.instantApply", true);
#endif

// Toggles between the two Preferences implementations, pop-up window and in-content
#ifdef EARLY_BETA_OR_EARLIER
pref("browser.preferences.inContent", true);
#else
pref("browser.preferences.inContent", false);
#endif

pref("browser.download.show_plugins_in_list", true);
pref("browser.download.hide_plugins_without_extensions", true);
Expand Down Expand Up @@ -1032,6 +1028,8 @@ pref("browser.rights.3.shown", false);
pref("browser.rights.override", true);
#endif

pref("browser.selfsupport.url", "http://self-repair.mozilla.org/%LOCALE%/repair");

pref("browser.sessionstore.resume_from_crash", true);
pref("browser.sessionstore.resume_session_once", false);

Expand Down
14 changes: 2 additions & 12 deletions browser/base/content/browser-eme.js
Expand Up @@ -25,15 +25,6 @@ let gEMEHandler = {
return "<label class='text-link' href='" + baseURL + "drm-content'>" +
text + "</label>";
},
getDRMLabel: function(keySystem) {
if (keySystem.startsWith("com.adobe")) {
return "Adobe Primetime";
}
if (keySystem == "org.w3.clearkey") {
return "ClearKey";
}
return gNavigatorBundle.getString("emeNotifications.unknownDRMSoftware");
},
onDontAskAgain: function(menuPopupItem) {
let button = menuPopupItem.parentNode.anchorNode;
let bar = button.parentNode;
Expand Down Expand Up @@ -158,12 +149,11 @@ let gEMEHandler = {
}

let msgPrefix = "emeNotifications.drmContentPlaying.";
let msgId = msgPrefix + "message";
let msgId = msgPrefix + "message2";
let btnLabelId = msgPrefix + "button.label";
let btnAccessKeyId = msgPrefix + "button.accesskey";

let drmProvider = this.getDRMLabel(keySystem);
let message = gNavigatorBundle.getFormattedString(msgId, [drmProvider, this._brandShortName]);
let message = gNavigatorBundle.getFormattedString(msgId, [this._brandShortName]);
let anchorId = "eme-notification-icon";

let mainAction = {
Expand Down
7 changes: 7 additions & 0 deletions browser/components/nsBrowserGlue.js
Expand Up @@ -91,6 +91,9 @@ XPCOMUtils.defineLazyModuleGetter(this, "RemotePrompt",
XPCOMUtils.defineLazyModuleGetter(this, "ContentPrefServiceParent",
"resource://gre/modules/ContentPrefServiceParent.jsm");

XPCOMUtils.defineLazyModuleGetter(this, "SelfSupportBackend",
"resource:///modules/SelfSupportBackend.jsm");

XPCOMUtils.defineLazyModuleGetter(this, "SessionStore",
"resource:///modules/sessionstore/SessionStore.jsm");

Expand Down Expand Up @@ -627,6 +630,8 @@ BrowserGlue.prototype = {
LoginManagerParent.init();
ReaderParent.init();

SelfSupportBackend.init();

#ifdef NIGHTLY_BUILD
Services.prefs.addObserver(POLARIS_ENABLED, this, false);
#endif
Expand Down Expand Up @@ -888,6 +893,8 @@ BrowserGlue.prototype = {
Cu.reportError("Could not end startup crash tracking in quit-application-granted: " + e);
}

SelfSupportBackend.uninit();

CustomizationTabPreloader.uninit();
WebappManager.uninit();
#ifdef NIGHTLY_BUILD
Expand Down
9 changes: 9 additions & 0 deletions browser/components/uitour/UITour.jsm
Expand Up @@ -344,6 +344,15 @@ this.UITour = {
onPageEvent: function(aMessage, aEvent) {
let browser = aMessage.target;
let window = browser.ownerDocument.defaultView;

// Does the window have tabs? We need to make sure since windowless browsers do
// not have tabs.
if (!window.gBrowser) {
// When using windowless browsers we don't have a valid |window|. If that's the case,
// use the most recent window as a target for UITour functions (see Bug 1111022).
window = Services.wm.getMostRecentWindow("navigator:browser");
}

let tab = window.gBrowser.getTabForBrowser(browser);
let messageManager = browser.messageManager;

Expand Down
1 change: 1 addition & 0 deletions browser/components/uitour/test/browser.ini
Expand Up @@ -5,6 +5,7 @@ support-files =
uitour.html
../UITour-lib.js

[browser_no_tabs.js]
[browser_UITour.js]
skip-if = os == "linux" || e10s # Intermittent failures, bug 951965
[browser_UITour2.js]
Expand Down
110 changes: 110 additions & 0 deletions browser/components/uitour/test/browser_no_tabs.js
@@ -0,0 +1,110 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

const HTML_NS = "http://www.w3.org/1999/xhtml";
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";

/**
* Create a frame in the |hiddenDOMWindow| to host a |browser|, then load the URL in the
* latter.
*
* @param aURL
* The URL to open in the browser.
**/
function createHiddenBrowser(aURL) {
let deferred = Promise.defer();
let hiddenDoc = Services.appShell.hiddenDOMWindow.document;

// Create a HTML iframe with a chrome URL, then this can host the browser.
let iframe = hiddenDoc.createElementNS(HTML_NS, "iframe");
iframe.setAttribute("src", "chrome://global/content/mozilla.xhtml");
iframe.addEventListener("load", function onLoad() {
iframe.removeEventListener("load", onLoad, true);

let browser = iframe.contentDocument.createElementNS(XUL_NS, "browser");
browser.setAttribute("type", "content");
browser.setAttribute("disableglobalhistory", "true");
browser.setAttribute("src", aURL);

iframe.contentDocument.documentElement.appendChild(browser);
deferred.resolve({frame: iframe, browser: browser});
}, true);

hiddenDoc.documentElement.appendChild(iframe);
return deferred.promise;
};

/**
* Remove the browser and the iframe.
*
* @param aFrame
* The iframe to dismiss.
* @param aBrowser
* The browser to dismiss.
*/
function destroyHiddenBrowser(aFrame, aBrowser) {
// Dispose of the hidden browser.
aBrowser.remove();

// Take care of the frame holding our invisible browser.
if (!Cu.isDeadWrapper(aFrame)) {
aFrame.remove();
}
};

/**
* Test that UITour works when called when no tabs are available (e.g., when using windowless
* browsers).
*/
add_task(function* test_windowless_UITour(){
// Get the URL for the test page.
let pageURL = getRootDirectory(gTestPath) + "uitour.html";

// Allow the URL to use the UITour.
info("Adding UITour permission to the test page.");
let pageURI = Services.io.newURI(pageURL, null, null);
Services.perms.add(pageURI, "uitour", Services.perms.ALLOW_ACTION);

// UITour's ping will resolve this promise.
let deferredPing = Promise.defer();

// Create a windowless browser and test that UITour works in it.
let browserPromise = createHiddenBrowser(pageURL);
browserPromise.then(frameInfo => {
isnot(frameInfo.browser, null, "The browser must exist and not be null.");

// Load UITour frame script.
frameInfo.browser.messageManager.loadFrameScript(
"chrome://browser/content/content-UITour.js", false);

// When the page loads, try to use UITour API.
frameInfo.browser.addEventListener("load", function loadListener() {
info("The test page was correctly loaded.");

frameInfo.browser.removeEventListener("load", loadListener, true);

// Get a reference to the UITour API.
info("Testing access to the UITour API.");
let contentWindow = Cu.waiveXrays(frameInfo.browser.contentDocument.defaultView);
isnot(contentWindow, null, "The content window must exist and not be null.");

let uitourAPI = contentWindow.Mozilla.UITour;

// Test the UITour API with a ping.
uitourAPI.ping(function() {
info("Ping response received from the UITour API.");

// Make sure to clean up.
destroyHiddenBrowser(frameInfo.frame, frameInfo.browser);

// Resolve our promise.
deferredPing.resolve();
});
}, true);
});

// Wait for the UITour ping to complete.
yield deferredPing.promise;
});
9 changes: 7 additions & 2 deletions browser/locales/en-US/chrome/browser/browser.properties
Expand Up @@ -591,8 +591,8 @@ getUserMedia.sharingMenuMicrophoneWindow = %S (microphone and window)
# origin for the sharing menu if no readable origin could be deduced from the URL.
getUserMedia.sharingMenuUnknownHost = Unknown origin

# LOCALIZATION NOTE(emeNotifications.drmContentPlaying.message): %1$S is the vendor name of the DRM that's in use, %2$S is brandShortName.
emeNotifications.drmContentPlaying.message = Some audio or video on this site uses %1$S DRM software, which may limit what %2$S can let you do with it.
# LOCALIZATION NOTE(emeNotifications.drmContentPlaying.message2): %S is brandShortName.
emeNotifications.drmContentPlaying.message2 = Some audio or video on this site uses DRM software, which may limit what %S can let you do with it.
emeNotifications.drmContentPlaying.button.label = Configure…
emeNotifications.drmContentPlaying.button.accesskey = C

Expand All @@ -614,6 +614,11 @@ emeNotifications.drmContentCDMInsufficientVersion.message = %S is installing upd
# LOCALIZATION NOTE(emeNotifications.drmContentCDMInstalling.message): NB: inserted via innerHTML, so please don't use <, > or & in this string. %S is brandShortName
emeNotifications.drmContentCDMInstalling.message = %S is installing components needed to play the audio or video on this page. Please try again later.

# LOCALIZATION NOTE(emeNotifications.drmContentCDMNotSupported.64bit.message): NB: inserted via innerHTML, so please don't use <, > or & in this string. %1$S is brandShortName, %2$S will be the 'learn more' link
emeNotifications.drmContentCDMNotSupported.64bit.message = The audio or video on this page requires DRM software that this 64-bit build of %1$S does not support. %2$S
# LOCALIZATION NOTE(emeNotifications.drmContentCDMNotSupported.unsupportedOS.message): NB: inserted via innerHTML, so please don't use <, > or & in this string. %1$S is brandShortName, %2$S is the name of the user's OS (Windows, Linux, Mac OS X), %3$S will be the 'learn more' link
emeNotifications.drmContentCDMNotSupported.unsupportedOS.message = The audio or video on this page requires DRM software that %1$S does not support on %2$S. %3$S

emeNotifications.optionsButton.label = Options
emeNotifications.optionsButton.accesskey = O

Expand Down

0 comments on commit 6dcfd64

Please sign in to comment.