Merge mozilla-central into electrolysis
@ -925,10 +925,10 @@ refChildCB(AtkObject *aAtkObj, gint aChildIndex)
|
||||
NS_ASSERTION(childAtkObj, "Fail to get AtkObj");
|
||||
if (!childAtkObj)
|
||||
return nsnull;
|
||||
g_object_ref(childAtkObj);
|
||||
|
||||
//this will addref parent
|
||||
atk_object_set_parent(childAtkObj, aAtkObj);
|
||||
g_object_ref(childAtkObj);
|
||||
return childAtkObj;
|
||||
}
|
||||
|
||||
|
@ -947,9 +947,12 @@ nsRootAccessible::Init()
|
||||
nsRefPtr<nsApplicationAccessibleWrap> root = GetApplicationAccessible();
|
||||
NS_ENSURE_STATE(root);
|
||||
|
||||
root->AddRootAccessible(this);
|
||||
nsresult rv = nsDocAccessibleWrap::Init();
|
||||
|
||||
return nsDocAccessibleWrap::Init();
|
||||
if (NS_SUCCEEDED(rv))
|
||||
root->AddRootAccessible(this);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -3102,7 +3102,7 @@ const BrowserSearch = {
|
||||
var ss = Cc["@mozilla.org/browser/search-service;1"].
|
||||
getService(Ci.nsIBrowserSearchService);
|
||||
var searchForm = ss.defaultEngine.searchForm;
|
||||
loadURI(searchForm, null, null, false);
|
||||
openUILinkIn(searchForm, "current");
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -478,12 +478,18 @@ function test() {
|
||||
|
||||
browserWindowsCount([2, 3], "browser windows while running testOpenCloseRestoreFromPopup");
|
||||
|
||||
info([newWin.closed, newWin.__SSi, newWin.__SS_restoreID, newWin.__SS_dyingCache]);
|
||||
|
||||
// Cleanup
|
||||
newWin.close();
|
||||
newWin2.close();
|
||||
|
||||
info([newWin.closed, newWin.__SSi, newWin.__SS_restoreID, newWin.__SS_dyingCache]);
|
||||
|
||||
browserWindowsCount([0, 1], "browser windows while running testOpenCloseRestoreFromPopup");
|
||||
|
||||
info([newWin.closed, newWin.__SSi, newWin.__SS_restoreID, newWin.__SS_dyingCache]);
|
||||
|
||||
// Next please
|
||||
executeSoon(nextFn);
|
||||
});
|
||||
|
@ -556,6 +556,9 @@ toolbar[mode="full"] .toolbarbutton-menubutton-button {
|
||||
#home-button {
|
||||
list-style-image: url("moz-icon://stock/gtk-home?size=toolbar");
|
||||
}
|
||||
#home-button[disabled="true"] {
|
||||
list-style-image: url("moz-icon://stock/gtk-home?size=toolbar&state=disabled");
|
||||
}
|
||||
|
||||
#downloads-button {
|
||||
-moz-image-region: rect(0px 24px 24px 0px);
|
||||
@ -678,6 +681,10 @@ toolbar[iconsize="small"] #home-button ,
|
||||
#home-button.bookmark-item {
|
||||
list-style-image: url("moz-icon://stock/gtk-home?size=menu");
|
||||
}
|
||||
toolbar[iconsize="small"] #home-button[disabled="true"],
|
||||
#home-button.bookmark-item[disabled="true"] {
|
||||
list-style-image: url("moz-icon://stock/gtk-home?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
toolbar[iconsize="small"] #downloads-button {
|
||||
-moz-image-region: rect(0px 16px 16px 0px);
|
||||
|
@ -582,6 +582,9 @@ toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarke
|
||||
#home-button {
|
||||
-moz-image-region: rect(0px, 180px, 23px, 144px);
|
||||
}
|
||||
#home-button[disabled="true"] {
|
||||
-moz-image-region: rect(23px, 180px, 46px, 144px) !important;
|
||||
}
|
||||
#home-button:hover:active {
|
||||
-moz-image-region: rect(46px, 180px, 69px, 144px);
|
||||
}
|
||||
|
BIN
browser/themes/winstripe/browser/Toolbar-aero.png
Normal file → Executable file
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 44 KiB |
BIN
browser/themes/winstripe/browser/Toolbar-small-aero.png
Normal file → Executable file
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 16 KiB |
BIN
browser/themes/winstripe/browser/Toolbar-small.png
Normal file → Executable file
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 22 KiB |
BIN
browser/themes/winstripe/browser/Toolbar.png
Normal file → Executable file
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 43 KiB |
@ -404,6 +404,9 @@ toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker:not([disabled="
|
||||
#home-button:hover {
|
||||
-moz-image-region: rect(24px 120px 48px 96px);
|
||||
}
|
||||
#home-button[disabled="true"] {
|
||||
-moz-image-region: rect(48px 120px 72px 96px);
|
||||
}
|
||||
|
||||
/* download manager button */
|
||||
|
||||
@ -599,6 +602,10 @@ toolbar[iconsize="small"] #home-button:hover,
|
||||
#home-button.bookmark-item:hover {
|
||||
-moz-image-region: rect(16px 80px 32px 64px);
|
||||
}
|
||||
toolbar[iconsize="small"] #home-button[disabled="true"],
|
||||
#home-button.bookmark-item[disabled="true"] {
|
||||
-moz-image-region: rect(32px 80px 48px 64px);
|
||||
}
|
||||
|
||||
/* download manager button */
|
||||
|
||||
|
@ -74,7 +74,7 @@ _LEAKTEST_DIR = $(DEPTH)/_leaktest
|
||||
|
||||
_LEAKTEST_FILES = \
|
||||
automation.py \
|
||||
automationutils.py \
|
||||
$(CURDIR)/automationutils.py \
|
||||
leaktest.py \
|
||||
bloatcycle.html \
|
||||
$(topsrcdir)/build/pgo/server-locations.txt \
|
||||
|
@ -74,6 +74,11 @@ else
|
||||
AUTOMATION_PPARGS += -DCRASHREPORTER=0
|
||||
endif
|
||||
|
||||
automation.py: $(MOZILLA_DIR)/build/automation.py.in $(MOZILLA_DIR)/build/automation-build.mk
|
||||
$(CURDIR)/automationutils.py: $(MOZILLA_DIR)/build/automationutils.py
|
||||
$(INSTALL) $< .
|
||||
|
||||
automation.py: $(MOZILLA_DIR)/build/automation.py.in $(MOZILLA_DIR)/build/automation-build.mk $(CURDIR)/automationutils.py
|
||||
$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py \
|
||||
$(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $< > $@
|
||||
|
||||
GARBAGE += automation.py $(CURDIR)/automationutils.py
|
||||
|
@ -59,7 +59,7 @@ include $(topsrcdir)/build/automation-build.mk
|
||||
|
||||
_PGO_FILES = \
|
||||
automation.py \
|
||||
$(topsrcdir)/build/automationutils.py \
|
||||
$(CURDIR)/automationutils.py \
|
||||
profileserver.py \
|
||||
genpgocert.py \
|
||||
index.html \
|
||||
|
@ -115,7 +115,7 @@ var XPCOMUtils = {
|
||||
* that object, it checks if the given iid is listed in the |interfaces|
|
||||
* param, and if it is, returns |this| (the object it was called on).
|
||||
*/
|
||||
generateQI: function(interfaces) {
|
||||
generateQI: function XPCU_generateQI(interfaces) {
|
||||
/* Note that Ci[Ci.x] == Ci.x for all x */
|
||||
return makeQI([Ci[i].name for each (i in interfaces) if (Ci[i])]);
|
||||
},
|
||||
@ -124,7 +124,9 @@ var XPCOMUtils = {
|
||||
* Generate the NSGetModule function (along with the module definition).
|
||||
* See the parameters to generateModule.
|
||||
*/
|
||||
generateNSGetModule: function(componentsArray, postRegister, preUnregister) {
|
||||
generateNSGetModule: function XPCU_generateNSGetModule(componentsArray,
|
||||
postRegister,
|
||||
preUnregister) {
|
||||
return function NSGetModule(compMgr, fileSpec) {
|
||||
return XPCOMUtils.generateModule(componentsArray,
|
||||
postRegister,
|
||||
@ -144,7 +146,8 @@ var XPCOMUtils = {
|
||||
* signature 'preUnregister(nsIComponentManager,
|
||||
* nsIFile, componentsArray)'
|
||||
*/
|
||||
generateModule: function(componentsArray, postRegister, preUnregister) {
|
||||
generateModule: function XPCU_generateModule(componentsArray, postRegister,
|
||||
preUnregister) {
|
||||
let classes = [];
|
||||
for each (let component in componentsArray) {
|
||||
classes.push({
|
||||
@ -281,7 +284,7 @@ var XPCOMUtils = {
|
||||
/**
|
||||
* Returns an nsIFactory for |component|.
|
||||
*/
|
||||
_getFactory: function(component) {
|
||||
_getFactory: function XPCOMUtils__getFactory(component) {
|
||||
var factory = component.prototype._xpcom_factory;
|
||||
if (!factory) {
|
||||
factory = {
|
||||
|
@ -2,7 +2,8 @@
|
||||
<html><head>
|
||||
<style>
|
||||
html {
|
||||
background-image: -moz-linear-gradient(black, white 20%)
|
||||
background-image: -moz-linear-gradient(black, white 20%);
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
body {
|
||||
font-size: 1em;
|
||||
|
@ -2,7 +2,8 @@
|
||||
<html class="reftest-wait"><head>
|
||||
<style>
|
||||
html {
|
||||
background-image: -moz-linear-gradient(black, white 20%)
|
||||
background-image: -moz-linear-gradient(black, white 20%);
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
body {
|
||||
font-size: 1em;
|
||||
@ -14,14 +15,10 @@ body {
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
setTimeout(function() {
|
||||
document.body.style.width = "14em";
|
||||
setTimeout(function() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
}, 100);
|
||||
}, 100);
|
||||
}
|
||||
window.addEventListener("MozReftestInvalidate", function() {
|
||||
document.body.style.width = "14em";
|
||||
document.documentElement.removeAttribute("class");
|
||||
}, false);
|
||||
</script>
|
||||
</head><body>
|
||||
pad pad pad pad pad pad pad pad
|
||||
|
@ -3,7 +3,8 @@
|
||||
<style>
|
||||
html {
|
||||
background-image: -moz-linear-gradient(black, white 20%);
|
||||
-moz-background-size: 400px 400px;
|
||||
background-repeat: repeat-x;
|
||||
-moz-background-size: 1px 400px;
|
||||
}
|
||||
body {
|
||||
font-size: 1em;
|
||||
|
@ -3,7 +3,8 @@
|
||||
<style>
|
||||
html {
|
||||
background-image: -moz-linear-gradient(black, white 20%);
|
||||
-moz-background-size: 400px 400px;
|
||||
background-repeat: repeat-x;
|
||||
-moz-background-size: 1px 400px;
|
||||
}
|
||||
body {
|
||||
font-size: 1em;
|
||||
@ -15,14 +16,10 @@ body {
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
setTimeout(function() {
|
||||
document.body.style.width = "14em";
|
||||
setTimeout(function() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
}, 100);
|
||||
}, 100);
|
||||
}
|
||||
window.addEventListener("MozReftestInvalidate", function() {
|
||||
document.body.style.width = "14em";
|
||||
document.documentElement.removeAttribute("class");
|
||||
}, false);
|
||||
</script>
|
||||
</head><body>
|
||||
pad pad pad pad pad pad pad pad
|
||||
|
@ -16,14 +16,10 @@ body {
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
setTimeout(function() {
|
||||
document.body.style.width = "14em";
|
||||
setTimeout(function() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
}, 100);
|
||||
}, 100);
|
||||
}
|
||||
window.addEventListener("MozReftestInvalidate", function() {
|
||||
document.body.style.width = "14em";
|
||||
document.documentElement.removeAttribute("class");
|
||||
}, false);
|
||||
</script>
|
||||
</head><body>
|
||||
pad pad pad pad pad pad pad pad
|
||||
|
@ -86,5 +86,5 @@ fails == aja-linear-2d.html aja-linear-2-ref.html # bug 526694
|
||||
fails-if(MOZ_WIDGET_TOOLKIT=="cocoa") == aja-linear-6a.html aja-linear-6-ref.html # bug 526708
|
||||
fails == aja-linear-6b.html aja-linear-6-ref.html # bug 522607
|
||||
== height-dependence-1.html height-dependence-1-ref.html
|
||||
== height-dependence-2.html height-dependence-2-ref.html
|
||||
fails-if(MOZ_WIDGET_TOOLKIT=="cocoa") == height-dependence-2.html height-dependence-2-ref.html # bug 535007
|
||||
== height-dependence-3.html height-dependence-3-ref.html
|
||||
|
@ -421,10 +421,10 @@ struct nsStyleBackground {
|
||||
PRBool DependsOnFrameSize(nsStyleImageType aType) const {
|
||||
if (aType == eStyleImageType_Image) {
|
||||
return mWidthType <= ePercentage || mHeightType <= ePercentage;
|
||||
} else if (aType == eStyleImageType_Gradient) {
|
||||
return mWidthType <= eAuto || mHeightType <= eAuto;
|
||||
} else {
|
||||
NS_NOTREACHED("unrecognized image type");
|
||||
NS_ABORT_IF_FALSE(aType == eStyleImageType_Gradient,
|
||||
"unrecognized image type");
|
||||
return mWidthType <= eAuto || mHeightType <= eAuto;
|
||||
}
|
||||
}
|
||||
|
||||
@ -460,9 +460,7 @@ struct nsStyleBackground {
|
||||
// True if the rendering of this layer might change when the size
|
||||
// of the corresponding frame changes. This is true for any
|
||||
// non-solid-color background whose position or size depends on
|
||||
// the frame size (that is, was specified with percentages) and is
|
||||
// also true for nearly all gradients. We don't currently bother
|
||||
// trying to identify gradients that don't depend on the frame size.
|
||||
// the frame size.
|
||||
PRBool RenderingMightDependOnFrameSize() const {
|
||||
return (!mImage.IsEmpty() &&
|
||||
(mPosition.DependsOnFrameSize() ||
|
||||
|
@ -75,7 +75,7 @@ endif
|
||||
_HARNESS_FILES = \
|
||||
$(srcdir)/runreftest.py \
|
||||
automation.py \
|
||||
$(topsrcdir)/build/automationutils.py \
|
||||
$(CURDIR)/automationutils.py \
|
||||
$(NULL)
|
||||
|
||||
$(_DEST_DIR):
|
||||
|
@ -49,8 +49,8 @@
|
||||
#include "nsISupportsArray.h"
|
||||
|
||||
class nsPluginHost;
|
||||
class PRLibrary;
|
||||
class nsPluginInfo;
|
||||
struct PRLibrary;
|
||||
struct nsPluginInfo;
|
||||
|
||||
// Remember that flags are written out to pluginreg.dat, be careful
|
||||
// changing their meaning.
|
||||
|
@ -128,23 +128,23 @@ const NetUtil = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Asynchronously opens a channel and fetches the response. The provided
|
||||
* callback will get an input stream containing the response, and the result
|
||||
* code.
|
||||
* Asynchronously opens a source and fetches the response. A source can be
|
||||
* an nsIURI, nsIFile, string spec, or nsIChannel. The provided callback
|
||||
* will get an input stream containing the response, and the result code.
|
||||
*
|
||||
* @param aChannel
|
||||
* The nsIChannel to open.
|
||||
* @param aSource
|
||||
* The nsIURI, nsIFile, string spec, or nsIChannel to open.
|
||||
* @param aCallback
|
||||
* The callback function that will be notified upon completion. It
|
||||
* will get two arguments:
|
||||
* 1) An nsIInputStream containing the data from the channel, if any.
|
||||
* 2) The status code from opening the channel.
|
||||
* 2) The status code from opening the source.
|
||||
*/
|
||||
asyncFetch: function NetUtil_asyncOpen(aChannel, aCallback)
|
||||
asyncFetch: function NetUtil_asyncOpen(aSource, aCallback)
|
||||
{
|
||||
if (!aChannel || !aCallback) {
|
||||
if (!aSource || !aCallback) {
|
||||
let exception = new Components.Exception(
|
||||
"Must have a channel and a callback",
|
||||
"Must have a source and a callback",
|
||||
Cr.NS_ERROR_INVALID_ARG,
|
||||
Components.stack.caller
|
||||
);
|
||||
@ -168,33 +168,80 @@ const NetUtil = {
|
||||
}
|
||||
});
|
||||
|
||||
aChannel.asyncOpen(listener, null);
|
||||
let channel = aSource;
|
||||
if (!(channel instanceof Ci.nsIChannel)) {
|
||||
channel = this.newChannel(aSource);
|
||||
}
|
||||
|
||||
channel.asyncOpen(listener, null);
|
||||
},
|
||||
|
||||
/**
|
||||
* Constructs a new URI for the given spec, character set, and base URI.
|
||||
* Constructs a new URI for the given spec, character set, and base URI, or
|
||||
* an nsIFile.
|
||||
*
|
||||
* @param aSpec
|
||||
* The spec for the desired URI.
|
||||
* @param aTarget
|
||||
* The string spec for the desired URI or an nsIFile.
|
||||
* @param aOriginCharset [optional]
|
||||
* The character set for the URI.
|
||||
* The character set for the URI. Only used if aTarget is not an
|
||||
* nsIFile.
|
||||
* @param aBaseURI [optional]
|
||||
* The base URI for the spec.
|
||||
* The base URI for the spec. Only used if aTarget is not an
|
||||
* nsIFile.
|
||||
*
|
||||
* @return an nsIURI object.
|
||||
*/
|
||||
newURI: function NetUtil_newURI(aSpec, aOriginCharset, aBaseURI)
|
||||
newURI: function NetUtil_newURI(aTarget, aOriginCharset, aBaseURI)
|
||||
{
|
||||
if (!aSpec) {
|
||||
if (!aTarget) {
|
||||
let exception = new Components.Exception(
|
||||
"Must have a non-null spec",
|
||||
"Must have a non-null string spec or nsIFile object",
|
||||
Cr.NS_ERROR_INVALID_ARG,
|
||||
Components.stack.caller
|
||||
);
|
||||
throw exception;
|
||||
}
|
||||
|
||||
return this.ioService.newURI(aSpec, aOriginCharset, aBaseURI);
|
||||
if (aTarget instanceof Ci.nsIFile) {
|
||||
return this.ioService.newFileURI(aTarget);
|
||||
}
|
||||
|
||||
return this.ioService.newURI(aTarget, aOriginCharset, aBaseURI);
|
||||
},
|
||||
|
||||
/**
|
||||
* Constructs a new channel for the given spec, character set, and base URI,
|
||||
* or nsIURI, or nsIFile.
|
||||
*
|
||||
* @param aWhatToLoad
|
||||
* The string spec for the desired URI, an nsIURI, or an nsIFile.
|
||||
* @param aOriginCharset [optional]
|
||||
* The character set for the URI. Only used if aWhatToLoad is a
|
||||
* string.
|
||||
* @param aBaseURI [optional]
|
||||
* The base URI for the spec. Only used if aWhatToLoad is a string.
|
||||
*
|
||||
* @return an nsIChannel object.
|
||||
*/
|
||||
newChannel: function NetUtil_newChannel(aWhatToLoad, aOriginCharset,
|
||||
aBaseURI)
|
||||
{
|
||||
if (!aWhatToLoad) {
|
||||
let exception = new Components.Exception(
|
||||
"Must have a non-null string spec, nsIURI, or nsIFile object",
|
||||
Cr.NS_ERROR_INVALID_ARG,
|
||||
Components.stack.caller
|
||||
);
|
||||
throw exception;
|
||||
}
|
||||
|
||||
let uri = aWhatToLoad;
|
||||
if (!(aWhatToLoad instanceof Ci.nsIURI)) {
|
||||
// We either have a string or an nsIFile that we'll need a URI for.
|
||||
uri = this.newURI(aWhatToLoad, aOriginCharset, aBaseURI);
|
||||
}
|
||||
|
||||
return this.ioService.newChannelFromURI(uri);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -163,7 +163,8 @@ function test_newURI()
|
||||
{
|
||||
let ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
|
||||
|
||||
// Check that we get the same URI back from the IO service and the utility method.
|
||||
// Check that we get the same URI back from the IO service and the utility
|
||||
// method.
|
||||
const TEST_URI = "http://mozilla.org";
|
||||
let iosURI = ios.newURI(TEST_URI, null, null);
|
||||
let NetUtilURI = NetUtil.newURI(TEST_URI);
|
||||
@ -172,6 +173,25 @@ function test_newURI()
|
||||
run_next_test();
|
||||
}
|
||||
|
||||
function test_newURI_takes_nsIFile()
|
||||
{
|
||||
let ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
|
||||
|
||||
// Create a test file that we can pass into NetUtil.newURI
|
||||
let file = Cc["@mozilla.org/file/directory_service;1"].
|
||||
getService(Ci.nsIProperties).
|
||||
get("TmpD", Ci.nsIFile);
|
||||
file.append("NetUtil-test-file.tmp");
|
||||
|
||||
// Check that we get the same URI back from the IO service and the utility
|
||||
// method.
|
||||
let iosURI = ios.newFileURI(file);
|
||||
let NetUtilURI = NetUtil.newURI(file);
|
||||
do_check_true(iosURI.equals(NetUtilURI));
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
|
||||
function test_ioService()
|
||||
{
|
||||
do_check_true(NetUtil.ioService instanceof Ci.nsIIOService);
|
||||
@ -204,7 +224,7 @@ function test_asyncFetch_no_callback()
|
||||
run_next_test();
|
||||
}
|
||||
|
||||
function test_asyncFetch()
|
||||
function test_asyncFetch_with_nsIChannel()
|
||||
{
|
||||
const TEST_DATA = "this is a test string";
|
||||
|
||||
@ -238,6 +258,110 @@ function test_asyncFetch()
|
||||
});
|
||||
}
|
||||
|
||||
function test_asyncFetch_with_nsIURI()
|
||||
{
|
||||
const TEST_DATA = "this is a test string";
|
||||
|
||||
// Start the http server, and register our handler.
|
||||
let server = new nsHttpServer();
|
||||
server.registerPathHandler("/test", function(aRequest, aResponse) {
|
||||
aResponse.setStatusLine(aRequest.httpVersion, 200, "OK");
|
||||
aResponse.setHeader("Content-Type", "text/plain", false);
|
||||
aResponse.write(TEST_DATA);
|
||||
});
|
||||
server.start(4444);
|
||||
|
||||
// Create our URI.
|
||||
let uri = NetUtil.newURI("http://localhost:4444/test");
|
||||
|
||||
// Open our URI asynchronously.
|
||||
NetUtil.asyncFetch(uri, function(aInputStream, aResult) {
|
||||
// Check that we had success.
|
||||
do_check_true(Components.isSuccessCode(aResult));
|
||||
|
||||
// Check that we got the right data.
|
||||
do_check_eq(aInputStream.available(), TEST_DATA.length);
|
||||
let is = Cc["@mozilla.org/scriptableinputstream;1"].
|
||||
createInstance(Ci.nsIScriptableInputStream);
|
||||
is.init(aInputStream);
|
||||
let result = is.read(TEST_DATA.length);
|
||||
do_check_eq(TEST_DATA, result);
|
||||
|
||||
server.stop(run_next_test);
|
||||
});
|
||||
}
|
||||
|
||||
function test_asyncFetch_with_string()
|
||||
{
|
||||
const TEST_DATA = "this is a test string";
|
||||
|
||||
// Start the http server, and register our handler.
|
||||
let server = new nsHttpServer();
|
||||
server.registerPathHandler("/test", function(aRequest, aResponse) {
|
||||
aResponse.setStatusLine(aRequest.httpVersion, 200, "OK");
|
||||
aResponse.setHeader("Content-Type", "text/plain", false);
|
||||
aResponse.write(TEST_DATA);
|
||||
});
|
||||
server.start(4444);
|
||||
|
||||
// Open our location asynchronously.
|
||||
NetUtil.asyncFetch("http://localhost:4444/test", function(aInputStream,
|
||||
aResult) {
|
||||
// Check that we had success.
|
||||
do_check_true(Components.isSuccessCode(aResult));
|
||||
|
||||
// Check that we got the right data.
|
||||
do_check_eq(aInputStream.available(), TEST_DATA.length);
|
||||
let is = Cc["@mozilla.org/scriptableinputstream;1"].
|
||||
createInstance(Ci.nsIScriptableInputStream);
|
||||
is.init(aInputStream);
|
||||
let result = is.read(TEST_DATA.length);
|
||||
do_check_eq(TEST_DATA, result);
|
||||
|
||||
server.stop(run_next_test);
|
||||
});
|
||||
}
|
||||
|
||||
function test_asyncFetch_with_nsIFile()
|
||||
{
|
||||
const TEST_DATA = "this is a test string";
|
||||
|
||||
// First we need a file to read from.
|
||||
let file = Cc["@mozilla.org/file/directory_service;1"].
|
||||
getService(Ci.nsIProperties).
|
||||
get("TmpD", Ci.nsIFile);
|
||||
file.append("NetUtil-asyncFetch-test-file.tmp");
|
||||
file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666);
|
||||
|
||||
// Write the test data to the file.
|
||||
let ostream = Cc["@mozilla.org/network/file-output-stream;1"].
|
||||
createInstance(Ci.nsIFileOutputStream);
|
||||
ostream.init(file, -1, -1, 0);
|
||||
ostream.write(TEST_DATA, TEST_DATA.length);
|
||||
|
||||
// Sanity check to make sure the data was written.
|
||||
do_check_eq(TEST_DATA, getFileContents(file));
|
||||
|
||||
// Open our file asynchronously.
|
||||
NetUtil.asyncFetch(file, function(aInputStream, aResult) {
|
||||
// Check that we had success.
|
||||
do_check_true(Components.isSuccessCode(aResult));
|
||||
|
||||
// Check that we got the right data.
|
||||
do_check_eq(aInputStream.available(), TEST_DATA.length);
|
||||
let is = Cc["@mozilla.org/scriptableinputstream;1"].
|
||||
createInstance(Ci.nsIScriptableInputStream);
|
||||
is.init(aInputStream);
|
||||
let result = is.read(TEST_DATA.length);
|
||||
do_check_eq(TEST_DATA, result);
|
||||
|
||||
// Remove our test file.
|
||||
file.remove(false);
|
||||
|
||||
run_next_test();
|
||||
});
|
||||
}
|
||||
|
||||
function test_asyncFetch_does_not_block()
|
||||
{
|
||||
// Create our channel that has no data.
|
||||
@ -266,6 +390,64 @@ function test_asyncFetch_does_not_block()
|
||||
});
|
||||
}
|
||||
|
||||
function test_newChannel_no_specifier()
|
||||
{
|
||||
try {
|
||||
NetUtil.newChannel();
|
||||
do_throw("should throw!");
|
||||
}
|
||||
catch (e) {
|
||||
do_check_eq(e.result, Cr.NS_ERROR_INVALID_ARG);
|
||||
}
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
|
||||
function test_newChannel_with_string()
|
||||
{
|
||||
const TEST_SPEC = "http://mozilla.org";
|
||||
|
||||
// Check that we get the same URI back from channel the IO service creates and
|
||||
// the channel the utility method creates.
|
||||
let ios = NetUtil.ioService;
|
||||
let iosChannel = ios.newChannel(TEST_SPEC, null, null);
|
||||
let NetUtilChannel = NetUtil.newChannel(TEST_SPEC);
|
||||
do_check_true(iosChannel.URI.equals(NetUtilChannel.URI));
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
|
||||
function test_newChannel_with_nsIURI()
|
||||
{
|
||||
const TEST_SPEC = "http://mozilla.org";
|
||||
|
||||
// Check that we get the same URI back from channel the IO service creates and
|
||||
// the channel the utility method creates.
|
||||
let uri = NetUtil.newURI(TEST_SPEC);
|
||||
let iosChannel = NetUtil.ioService.newChannelFromURI(uri);
|
||||
let NetUtilChannel = NetUtil.newChannel(uri);
|
||||
do_check_true(iosChannel.URI.equals(NetUtilChannel.URI));
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
|
||||
function test_newChannel_with_nsIFile()
|
||||
{
|
||||
let file = Cc["@mozilla.org/file/directory_service;1"].
|
||||
getService(Ci.nsIProperties).
|
||||
get("TmpD", Ci.nsIFile);
|
||||
file.append("NetUtil-test-file.tmp");
|
||||
|
||||
// Check that we get the same URI back from channel the IO service creates and
|
||||
// the channel the utility method creates.
|
||||
let uri = NetUtil.newURI(file);
|
||||
let iosChannel = NetUtil.ioService.newChannelFromURI(uri);
|
||||
let NetUtilChannel = NetUtil.newChannel(uri);
|
||||
do_check_true(iosChannel.URI.equals(NetUtilChannel.URI));
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//// Test Runner
|
||||
|
||||
@ -274,11 +456,19 @@ let tests = [
|
||||
test_async_write_file_nsISafeOutputStream,
|
||||
test_newURI_no_spec_throws,
|
||||
test_newURI,
|
||||
test_newURI_takes_nsIFile,
|
||||
test_ioService,
|
||||
test_asyncFetch_no_channel,
|
||||
test_asyncFetch_no_callback,
|
||||
test_asyncFetch,
|
||||
test_asyncFetch_with_nsIChannel,
|
||||
test_asyncFetch_with_nsIURI,
|
||||
test_asyncFetch_with_string,
|
||||
test_asyncFetch_with_nsIFile,
|
||||
test_asyncFetch_does_not_block,
|
||||
test_newChannel_no_specifier,
|
||||
test_newChannel_with_string,
|
||||
test_newChannel_with_nsIURI,
|
||||
test_newChannel_with_nsIFile,
|
||||
];
|
||||
let index = 0;
|
||||
|
||||
@ -287,7 +477,14 @@ function run_next_test()
|
||||
if (index < tests.length) {
|
||||
do_test_pending();
|
||||
print("Running the next test: " + tests[index].name);
|
||||
tests[index++]();
|
||||
|
||||
// Asynchronous test exceptions do not kill the test...
|
||||
try {
|
||||
tests[index++]();
|
||||
}
|
||||
catch (e) {
|
||||
do_throw(e);
|
||||
}
|
||||
}
|
||||
|
||||
do_test_finished();
|
||||
|
@ -60,7 +60,7 @@ include $(topsrcdir)/build/automation-build.mk
|
||||
_SERV_FILES = \
|
||||
runtests.py \
|
||||
automation.py \
|
||||
$(topsrcdir)/build/automationutils.py \
|
||||
$(CURDIR)/automationutils.py \
|
||||
gen_template.pl \
|
||||
server.js \
|
||||
harness-a11y.xul \
|
||||
|
@ -3607,20 +3607,13 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
||||
}
|
||||
#endif
|
||||
|
||||
// XXXkt s/MOZ_TOOLKIT_GTK2/MOZ_WIDGET_GTK2/?
|
||||
// but the hidden window has been destroyed so toolkit is NULL anyway.
|
||||
#if defined(HAVE_DESKTOP_STARTUP_ID) && defined(MOZ_TOOLKIT_GTK2)
|
||||
nsGTKToolkit* toolkit = GetGTKToolkit();
|
||||
if (toolkit) {
|
||||
nsCAutoString currentDesktopStartupID;
|
||||
toolkit->GetDesktopStartupID(¤tDesktopStartupID);
|
||||
if (!currentDesktopStartupID.IsEmpty()) {
|
||||
nsCAutoString desktopStartupEnv;
|
||||
desktopStartupEnv.AssignLiteral("DESKTOP_STARTUP_ID=");
|
||||
desktopStartupEnv.Append(currentDesktopStartupID);
|
||||
// Leak it with extreme prejudice!
|
||||
PR_SetEnv(ToNewCString(desktopStartupEnv));
|
||||
}
|
||||
#if defined(HAVE_DESKTOP_STARTUP_ID) && defined(MOZ_WIDGET_GTK2)
|
||||
if (!desktopStartupID.IsEmpty()) {
|
||||
nsCAutoString desktopStartupEnv;
|
||||
desktopStartupEnv.AssignLiteral("DESKTOP_STARTUP_ID=");
|
||||
desktopStartupEnv.Append(desktopStartupID);
|
||||
// Leak it with extreme prejudice!
|
||||
PR_SetEnv(ToNewCString(desktopStartupEnv));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -67,8 +67,8 @@ else
|
||||
PACKAGE_DIR = $(PACKAGE_BASE_DIR)/$(MOZ_PKG_DIR)
|
||||
endif
|
||||
|
||||
MAR_BIN = $(DIST)/host/bin/mar$(HOST_BIN_SUFFIX)
|
||||
MBSDIFF_BIN = $(DIST)/host/bin/mbsdiff$(HOST_BIN_SUFFIX)
|
||||
MAR_BIN = $(LIBXUL_DIST)/host/bin/mar$(HOST_BIN_SUFFIX)
|
||||
MBSDIFF_BIN = $(LIBXUL_DIST)/host/bin/mbsdiff$(HOST_BIN_SUFFIX)
|
||||
|
||||
full-update:: complete-patch
|
||||
|
||||
|
@ -52,7 +52,7 @@
|
||||
* get to jemalloc_stats(). So just do this on Windows until
|
||||
* that's fixed.
|
||||
*/
|
||||
#if defined(MOZ_MEMORY) && defined(XP_WIN)
|
||||
#if defined(MOZ_MEMORY) && (defined(XP_WIN) || defined(SOLARIS))
|
||||
#define HAVE_JEMALLOC_STATS 1
|
||||
#else
|
||||
#undef HAVE_JEMALLOC_STATS
|
||||
|
@ -644,7 +644,7 @@ static PRBool InitLog(const char* envVar, const char* msg, FILE* *result)
|
||||
fname.AppendLiteral("_");
|
||||
fname.Append((char*)XRE_ChildProcessTypeToString(XRE_GetProcessType()));
|
||||
fname.AppendLiteral("_pid");
|
||||
fname.AppendInt(getpid());
|
||||
fname.AppendInt((PRUint32)getpid());
|
||||
if (hasLogExtension)
|
||||
fname.AppendLiteral(".log");
|
||||
}
|
||||
|