Skip to content

Commit

Permalink
Merge inbound to m-c. a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
rvandermeulen committed May 29, 2015
2 parents 7e7f8b1 + 39e312b commit 2e35b12
Show file tree
Hide file tree
Showing 739 changed files with 99,666 additions and 11,758 deletions.
2 changes: 1 addition & 1 deletion Makefile.in
Expand Up @@ -254,7 +254,7 @@ endif # MOZ_CRASHREPORTER
uploadsymbols:
ifdef MOZ_CRASHREPORTER
ifdef SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE
$(PYTHON) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.py '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip'
$(PYTHON) -u $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.py '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip'
else
$(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh $(SYMBOL_INDEX_NAME) '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip'
endif
Expand Down
25 changes: 15 additions & 10 deletions browser/base/content/browser-fullScreen.js
Expand Up @@ -15,6 +15,9 @@ var FullScreen = {
init: function() {
// called when we go into full screen, even if initiated by a web page script
window.addEventListener("fullscreen", this, true);
window.addEventListener("MozDOMFullscreen:Exited", this,
/* useCapture */ true,
/* wantsUntrusted */ false);
for (let type of this._MESSAGES) {
window.messageManager.addMessageListener(type, this);
}
Expand Down Expand Up @@ -97,6 +100,9 @@ var FullScreen = {
if (event.propertyName == "opacity")
this.cancelWarning();
break;
case "MozDOMFullscreen:Exited":
this.cleanupDomFullscreen();
break;
}
},

Expand Down Expand Up @@ -125,15 +131,7 @@ var FullScreen = {
if (this._isRemoteBrowser(browser)) {
this._windowUtils.remoteFrameFullscreenReverted();
}
document.documentElement.removeAttribute("inDOMFullscreen");
this.cleanupDomFullscreen();
this.showNavToolbox();
// If we are still in fullscreen mode, re-hide
// the toolbox with animation.
if (window.fullScreen) {
this._shouldAnimate = true;
this.hideNavToolbox();
}
break;
}
}
Expand Down Expand Up @@ -189,8 +187,6 @@ var FullScreen = {
document.removeEventListener("keypress", this._keyToggleCallback, false);
document.removeEventListener("popupshown", this._setPopupOpen, false);
document.removeEventListener("popuphidden", this._setPopupOpen, false);

this.cleanupDomFullscreen();
}
},

Expand All @@ -202,6 +198,15 @@ var FullScreen = {
if (!this.useLionFullScreen)
window.removeEventListener("activate", this);

document.documentElement.removeAttribute("inDOMFullscreen");
this.showNavToolbox();
// If we are still in fullscreen mode, re-hide
// the toolbox with animation.
if (window.fullScreen) {
this._shouldAnimate = true;
this.hideNavToolbox();
}

window.messageManager
.broadcastAsyncMessage("DOMFullscreen:CleanUp");
},
Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/test/general/browser.ini
Expand Up @@ -344,7 +344,7 @@ skip-if = asan # Disabled because it takes a long time (see test for more inform
[browser_popupUI.js]
skip-if = buildapp == 'mulet'
[browser_popup_blocker.js]
skip-if = e10s && debug # Frequent bug 1125520 failures
skip-if = (os == 'linux') || (e10s && debug) # Frequent bug 1081925 and bug 1125520 failures
[browser_printpreview.js]
skip-if = buildapp == 'mulet' || e10s # Bug 1101973 - breaks the next test in e10s, and may be responsible for later timeout after logging "Error: Channel closing: too late to send/recv, messages will be lost"
[browser_private_browsing_window.js]
Expand Down
158 changes: 65 additions & 93 deletions browser/components/places/tests/unit/test_clearHistory_shutdown.js
Expand Up @@ -36,56 +36,14 @@ var formHistoryStartup = Cc["@mozilla.org/satchel/form-history-startup;1"].
getService(Ci.nsIObserver);
formHistoryStartup.observe(null, "profile-after-change", null);

let notificationIndex = 0;

let notificationsObserver = {
observe: function observe(aSubject, aTopic, aData) {
print("Received notification: " + aTopic);

// Note that some of these notifications could arrive multiple times, for
// example in case of sync, we allow that.
if (EXPECTED_NOTIFICATIONS[notificationIndex] != aTopic)
notificationIndex++;
do_check_eq(EXPECTED_NOTIFICATIONS[notificationIndex], aTopic);

if (aTopic != TOPIC_CONNECTION_CLOSED)
return;

getDistinctNotifications().forEach(
function (topic) Services.obs.removeObserver(notificationsObserver, topic)
);

print("Looking for uncleared stuff.");

let stmt = DBConn().createStatement(
"SELECT id FROM moz_places WHERE url = :page_url "
);

try {
URIS.forEach(function(aUrl) {
stmt.params.page_url = aUrl;
do_check_false(stmt.executeStep());
stmt.reset();
});
} finally {
stmt.finalize();
}

// Check cache.
checkCache(FTP_URL);
}
}

let timeInMicroseconds = Date.now() * 1000;

function run_test() {
run_next_test();
}

add_task(function test_execute() {
do_test_pending();

print("Initialize browserglue before Places");
add_task(function* test_execute() {
do_print("Initialize browserglue before Places");

// Avoid default bookmarks import.
let glue = Cc["@mozilla.org/browser/browserglue;1"].
Expand All @@ -105,81 +63,95 @@ add_task(function test_execute() {

Services.prefs.setBoolPref("privacy.sanitize.sanitizeOnShutdown", true);

print("Add visits.");
do_print("Add visits.");
for (let aUrl of URIS) {
yield PlacesTestUtils.addVisits({
uri: uri(aUrl), visitDate: timeInMicroseconds++,
transition: PlacesUtils.history.TRANSITION_TYPED
});
}
print("Add cache.");
storeCache(FTP_URL, "testData");
do_print("Add cache.");
yield storeCache(FTP_URL, "testData");
});

function run_test_continue()
{
print("Simulate and wait shutdown.");
getDistinctNotifications().forEach(
function (topic)
Services.obs.addObserver(notificationsObserver, topic, false)
add_task(function* run_test_continue() {
do_print("Simulate and wait shutdown.");
yield shutdownPlaces();

let stmt = DBConn().createStatement(
"SELECT id FROM moz_places WHERE url = :page_url "
);

shutdownPlaces();
try {
URIS.forEach(function(aUrl) {
stmt.params.page_url = aUrl;
do_check_false(stmt.executeStep());
stmt.reset();
});
} finally {
stmt.finalize();
}

do_print("Check cache");
// Check cache.
let promiseCacheChecked = checkCache(FTP_URL);

do_print("Shutdown the download manager");
// Shutdown the download manager.
Services.obs.notifyObservers(null, "quit-application", null);
}

function getDistinctNotifications() {
let ar = EXPECTED_NOTIFICATIONS.concat(UNEXPECTED_NOTIFICATIONS);
return [ar[i] for (i in ar) if (ar.slice(0, i).indexOf(ar[i]) == -1)];
}
yield promiseCacheChecked;
});

function storeCache(aURL, aContent) {
let cache = Services.cache2;
let storage = cache.diskCacheStorage(LoadContextInfo.default, false);

var storeCacheListener = {
onCacheEntryCheck: function (entry, appcache) {
return Ci.nsICacheEntryOpenCallback.ENTRY_WANTED;
},

onCacheEntryAvailable: function (entry, isnew, appcache, status) {
do_check_eq(status, Cr.NS_OK);

entry.setMetaDataElement("servertype", "0");
var os = entry.openOutputStream(0);

var written = os.write(aContent, aContent.length);
if (written != aContent.length) {
do_throw("os.write has not written all data!\n" +
" Expected: " + written + "\n" +
" Actual: " + aContent.length + "\n");
return new Promise(resolve => {
let storeCacheListener = {
onCacheEntryCheck: function (entry, appcache) {
return Ci.nsICacheEntryOpenCallback.ENTRY_WANTED;
},

onCacheEntryAvailable: function (entry, isnew, appcache, status) {
do_check_eq(status, Cr.NS_OK);

entry.setMetaDataElement("servertype", "0");
var os = entry.openOutputStream(0);

var written = os.write(aContent, aContent.length);
if (written != aContent.length) {
do_throw("os.write has not written all data!\n" +
" Expected: " + written + "\n" +
" Actual: " + aContent.length + "\n");
}
os.close();
entry.close();
resolve();
}
os.close();
entry.close();
do_execute_soon(run_test_continue);
}
};

storage.asyncOpenURI(Services.io.newURI(aURL, null, null), "",
Ci.nsICacheStorage.OPEN_NORMALLY,
storeCacheListener);
};

storage.asyncOpenURI(Services.io.newURI(aURL, null, null), "",
Ci.nsICacheStorage.OPEN_NORMALLY,
storeCacheListener);
});
}


function checkCache(aURL) {
let cache = Services.cache2;
let storage = cache.diskCacheStorage(LoadContextInfo.default, false);

var checkCacheListener = {
onCacheEntryAvailable: function (entry, isnew, appcache, status) {
do_check_eq(status, Cr.NS_ERROR_CACHE_KEY_NOT_FOUND);
do_test_finished();
}
};
return new Promise(resolve => {
let checkCacheListener = {
onCacheEntryAvailable: function (entry, isnew, appcache, status) {
do_check_eq(status, Cr.NS_ERROR_CACHE_KEY_NOT_FOUND);
resolve();
}
};

storage.asyncOpenURI(Services.io.newURI(aURL, null, null), "",
Ci.nsICacheStorage.OPEN_READONLY,
checkCacheListener);
storage.asyncOpenURI(Services.io.newURI(aURL, null, null), "",
Ci.nsICacheStorage.OPEN_READONLY,
checkCacheListener);
});
}
3 changes: 1 addition & 2 deletions build/mobile/sutagent/android/SUTAgentAndroid.java
Expand Up @@ -264,8 +264,7 @@ public void onCreate(Bundle savedInstanceState)
{
if (ba != null)
{
sUniqueID = ba.getAddress();
sUniqueID.toLowerCase();
sUniqueID = ba.getAddress().toLowerCase();
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions build/virtualenv_packages.txt
Expand Up @@ -25,6 +25,8 @@ packages.txt:testing/mozbase/packages.txt
objdir:build
gyp.pth:media/webrtc/trunk/tools/gyp/pylib
pyasn1.pth:python/pyasn1
pyasn1_modules.pth:python/pyasn1-modules
bitstring.pth:python/bitstring
redo.pth:python/redo
requests.pth:python/requests
rsa.pth:python/rsa
3 changes: 2 additions & 1 deletion configure.in
Expand Up @@ -3034,6 +3034,7 @@ then
esac
LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
AC_SUBST(MOZ_USE_PTHREADS)
MOZ_CHECK_HEADERS(pthread.h)
fi


Expand Down Expand Up @@ -3603,7 +3604,7 @@ MOZ_ARG_WITH_BOOL(system-nss,
_USE_SYSTEM_NSS=1 )

if test -n "$_USE_SYSTEM_NSS"; then
AM_PATH_NSS(3.19, [MOZ_NATIVE_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
AM_PATH_NSS(3.19.1, [MOZ_NATIVE_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
fi

if test -n "$MOZ_NATIVE_NSS"; then
Expand Down
27 changes: 20 additions & 7 deletions docshell/test/navigation/test_bug386782.html
Expand Up @@ -17,11 +17,15 @@
// designMode document is in a frame inside the window, as this means
// the editable region is not in the root docshell (a less complicated case).

var pageShowChecker = '<scr' + 'ipt>' +
'window.addEventListener("pageshow", function(event) {' +
'window.opener.postMessage({persisted:event.persisted}, "*");' +
'});</scr' + 'ipt>';

var gTests = [
{
// <html><body><p>designModeDocument</p></body></html>
url: "data:text/html;charset=utf-8,<html><body><p>designModeDocument</p></body></html>",
url: "data:text/html;charset=utf-8,<html><head>" + pageShowChecker + "</head><body><p>designModeDocument</p></body></html>",
name: 'designModeNavigate',
onload(doc) { doc.designMode = "on"; },
expectedBodyBeforeEdit: '<p>designModeDocument</p>',
Expand All @@ -30,7 +34,7 @@
},
{
// <html><body contentEditable="true"><p>contentEditable</p></body></html>
url: 'data:text/html;charset=utf-8,<html><body contentEditable="true"><p>contentEditable</p></body></html>',
url: "data:text/html;charset=utf-8,<html><head>" + pageShowChecker + "</head><body contentEditable=\"true\"><p>contentEditable</p></body></html>",
name: 'contentEditableNavigate',
expectedBodyBeforeEdit: '<p>contentEditable</p>',
expectedBodyAfterEdit: 'EDITED <br><p>contentEditable</p>',
Expand All @@ -51,12 +55,14 @@
}
gTest = gTests[gTestNum];
gTest.window = window.open(gTest.url, gTest.name, "width=500,height=500");
gTest.window.addEventListener("load", function() {
window.onmessage = function(e) {
is(e.data.persisted, false, "Initial load cannot be persisted");
window.onmessage = null;
if ("onload" in gTest) {
gTest.onload(gTest.window.document);
}
SimpleTest.waitForFocus(beginTest, gTest.window);
}, false);
};
}

function beginTest() {
Expand All @@ -73,10 +79,17 @@
}

function goBack() {
window.onmessage = function(e) {
window.onmessage = null;
// Skip the test if the page is not loaded from the bf-cache when going back.
if (e.data.persisted) {
checkStillEditable();
} else {
gTest.window.close();
goNext();
}
};
gTest.window.history.back();
setTimeout(function() {
SimpleTest.waitForFocus(checkStillEditable, gTest.window);
}, 0);
}

function checkStillEditable() {
Expand Down
1 change: 1 addition & 0 deletions docshell/test/test_bug669671.html
Expand Up @@ -43,6 +43,7 @@
* *should* load from the cache.
*
**/
SimpleTest.requestLongerTimeout(2);
SimpleTest.waitForExplicitFinish();

function onChildLoad()
Expand Down

0 comments on commit 2e35b12

Please sign in to comment.