merge mozilla-inbound to mozilla-central. r=merge a=merge

MozReview-Commit-ID: 4Lk5P5UYmTe
This commit is contained in:
Sebastian Hengst 2017-10-24 11:52:35 +02:00
Родитель 55703dd1f1 a97971e948
Коммит 31bf3a1a42
98 изменённых файлов: 685 добавлений и 658 удалений

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

@ -117,12 +117,22 @@ InSendMessageExHook(LPVOID lpReserved)
// We want to take a strong reference to the dll so that it is never
// unloaded/reloaded from this point forward, hence we use LoadLibrary
// and not GetModuleHandle.
static HMODULE comModule = LoadLibrary(L"combase.dll");
static const HMODULE comModule = []() -> HMODULE {
HMODULE module = LoadLibraryW(L"combase.dll");
if (!module) {
// combase is not present on Windows 7, so we fall back to ole32 there
module = LoadLibraryW(L"ole32.dll");
}
return module;
}();
MOZ_ASSERT(comModule);
if (!comModule) {
return result;
}
// Check if InSendMessageEx is being called from code within combase.dll
// Check if InSendMessageEx is being called from code within comModule
HMODULE callingModule;
if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
@ -217,9 +227,9 @@ Compatibility::Init()
Preferences::SetBool("browser.ctrlTab.disallowForScreenReaders", true);
}
// If we have a known consumer who is not NVDA, we enable detection for the
// If we have a consumer who is not NVDA, we enable detection for the
// InSendMessageEx compatibility hack. NVDA does not require this.
if ((sConsumers & ~(Compatibility::UNKNOWN | NVDA)) &&
if ((sConsumers & (~NVDA)) &&
BrowserTabsRemoteAutostart()) {
sUser32Interceptor.Init("user32.dll");
if (!sInSendMessageExStub) {

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

@ -311,8 +311,6 @@ pref("browser.urlbar.delay", 50);
// The maximum number of historical search results to show.
pref("browser.urlbar.maxHistoricalSearchSuggestions", 0);
// The awesomebar result composition.
pref("browser.urlbar.matchBuckets", "suggestion:4,general:5");
// The default behavior for the urlbar can be configured to use any combination
// of the match filters with each additional filter adding more results (union).

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

@ -96,12 +96,6 @@
accesskey="&moveToNewWindow.accesskey;"
tbattr="tabbrowser-multiple"
oncommand="gBrowser.replaceTabWithWindow(TabContextMenu.contextTab);"/>
#ifdef E10S_TESTING_ONLY
<menuitem id="context_openNonRemoteWindow" label="Open in new non-e10s window"
tbattr="tabbrowser-remote"
hidden="true"
oncommand="gBrowser.openNonRemoteWindow(TabContextMenu.contextTab);"/>
#endif
<menuseparator id="context_sendTabToDevice_separator"/>
<menu id="context_sendTabToDevice" label="&sendTabToDevice.label;"
accesskey="&sendTabToDevice.accesskey;">

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

@ -851,7 +851,7 @@ function makePreview(row) {
let serial = Components.classes["@mozilla.org/network/serialization-helper;1"]
.getService(Components.interfaces.nsISerializationHelper);
let loadingPrincipalStr = serial.serializeToString(gDocInfo.principal);
let triggeringPrinStr = serial.serializeToString(gDocInfo.principal);
if ((item.HTMLLinkElement || item.HTMLInputElement ||
item.HTMLImageElement || item.SVGImageElement ||
(item.HTMLObjectElement && mimeType && mimeType.startsWith("image/")) ||
@ -910,14 +910,14 @@ function makePreview(row) {
setItemValue("imagedimensiontext", imageSize);
}, {once: true});
newImage.setAttribute("loadingprincipal", loadingPrincipalStr);
newImage.setAttribute("triggeringprincipal", triggeringPrinStr);
newImage.setAttribute("src", url);
} else {
// Handle the case where newImage is not used for width & height
if (item.HTMLVideoElement && isProtocolAllowed) {
newImage = document.createElementNS("http://www.w3.org/1999/xhtml", "video");
newImage.id = "thepreviewimage";
newImage.setAttribute("loadingprincipal", loadingPrincipalStr);
newImage.setAttribute("triggeringprincipal", triggeringPrinStr);
newImage.src = url;
newImage.controls = true;
width = physWidth = item.videoWidth;
@ -928,7 +928,7 @@ function makePreview(row) {
} else if (item.HTMLAudioElement && isProtocolAllowed) {
newImage = new Audio;
newImage.id = "thepreviewimage";
newImage.setAttribute("loadingprincipal", loadingPrincipalStr);
newImage.setAttribute("triggeringprincipal", triggeringPrinStr);
newImage.src = url;
newImage.controls = true;
isAudio = true;

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

@ -3958,20 +3958,6 @@
</body>
</method>
<!-- Opens a given tab to a non-remote window. -->
<method name="openNonRemoteWindow">
<parameter name="aTab"/>
<body>
<![CDATA[
if (!AppConstants.E10S_TESTING_ONLY) {
throw "This method is intended only for e10s testing!";
}
let url = aTab.linkedBrowser.currentURI.spec;
return window.openDialog("chrome://browser/content/", "_blank", "chrome,all,dialog=no,non-remote", url);
]]>
</body>
</method>
<method name="moveTabTo">
<parameter name="aTab"/>
<parameter name="aIndex"/>
@ -5548,14 +5534,11 @@
}
} else {
label = tab._fullLabel || tab.getAttribute("label");
if (AppConstants.E10S_TESTING_ONLY &&
if (AppConstants.NIGHTLY_BUILD &&
tab.linkedBrowser &&
tab.linkedBrowser.isRemoteBrowser) {
label += " - e10s";
if (tab.linkedBrowser.frameLoader &&
Services.appinfo.maxWebProcessCount > 1) {
label += " (" + tab.linkedBrowser.frameLoader.tabParent.osPid + ")";
}
tab.linkedBrowser.isRemoteBrowser &&
tab.linkedBrowser.frameLoader) {
label += " (pid " + tab.linkedBrowser.frameLoader.tabParent.osPid + ")";
}
if (tab.userContextId) {
label = gTabBrowserBundle.formatStringFromName("tabs.containers.tooltip", [label, ContextualIdentityService.getUserContextLabel(tab.userContextId)], 2);
@ -7769,7 +7752,7 @@
anonid="tab-throbber"
class="tab-throbber"
layer="true"/>
<xul:image xbl:inherits="src=image,loadingprincipal=iconloadingprincipal,requestcontextid,fadein,pinned,selected=visuallyselected,busy,crashed,sharing"
<xul:image xbl:inherits="src=image,triggeringprincipal=iconloadingprincipal,requestcontextid,fadein,pinned,selected=visuallyselected,busy,crashed,sharing"
anonid="tab-icon-image"
class="tab-icon-image"
validate="never"

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

@ -6,6 +6,7 @@ support-files =
[browser_notification_close.js]
skip-if = os == 'win' # Bug 1227785
[browser_notification_do_not_disturb.js]
skip-if = os == 'win' # Bug 1352791
[browser_notification_open_settings.js]
[browser_notification_remove_permission.js]
[browser_notification_replace.js]

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

@ -29,7 +29,7 @@ function testFirstPartyDomain(pageInfo) {
// For <img>, we will query imgIRequest.imagePrincipal later, so we wait
// for loadend event. For <audio> and <video>, so far we only can get
// the loadingprincipal attribute on the node, so we simply wait for
// the triggeringprincipal attribute on the node, so we simply wait for
// loadstart.
if (i == 0) {
await waitForEvent(preview, "loadend");
@ -48,10 +48,10 @@ function testFirstPartyDomain(pageInfo) {
"imagePrincipal should have firstPartyDomain set to " + EXPECTED_DOMAIN);
}
// Check the node has the attribute 'loadingprincipal'.
// Check the node has the attribute 'triggeringprincipal'.
let serial = Components.classes["@mozilla.org/network/serialization-helper;1"]
.getService(Components.interfaces.nsISerializationHelper);
let loadingPrincipalStr = preview.getAttribute("loadingprincipal");
let loadingPrincipalStr = preview.getAttribute("triggeringprincipal");
let loadingPrincipal = serial.deserializeObject(loadingPrincipalStr);
Assert.equal(loadingPrincipal.originAttributes.firstPartyDomain, EXPECTED_DOMAIN,
"loadingPrincipal should have firstPartyDomain set to " + EXPECTED_DOMAIN);

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

@ -18,18 +18,6 @@
<preferences id="mainPreferences" hidden="true" data-category="paneGeneral">
#ifdef E10S_TESTING_ONLY
<preference id="browser.tabs.remote.autostart"
name="browser.tabs.remote.autostart"
type="bool"/>
<preference id="e10sTempPref"
name="browser.tabs.remote.autostart.2"
type="bool"/>
<preference id="e10sForceEnable"
name="browser.tabs.remote.force-enable"
type="bool"/>
#endif
<!-- Startup -->
<preference id="browser.startup.page"
name="browser.startup.page"
@ -294,11 +282,6 @@
</vbox>
#endif
#ifdef E10S_TESTING_ONLY
<checkbox id="e10sAutoStart"
label="&e10sEnabled.label;"/>
#endif
#ifdef HAVE_SHELL_SERVICE
<vbox id="defaultBrowserBox">
<checkbox id="alwaysCheckDefault" preference="browser.shell.checkDefaultBrowser"

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

@ -100,15 +100,41 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1378010
(async function() {
SimpleTest.waitForExplicitFinish();
// On Windows, nsICommandLine doesn't support double-dash arguments,
// nor single-dash arguments whose value is specified via an equals sign,
// so we only test those variations on non-Windows platforms.
// Test all four basic variations of the "screenshot" argument
// when a file path is specified.
await testFileCreationPositive(["-url", "http://mochi.test:8888/headless.html", "-screenshot", screenshotPath], screenshotPath);
await testFileCreationPositive(["-url", "http://mochi.test:8888/headless.html", `-screenshot=${screenshotPath}`], screenshotPath);
await testFileCreationPositive(["-url", "http://mochi.test:8888/headless.html", "--screenshot", screenshotPath], screenshotPath);
await testFileCreationPositive(["-url", "http://mochi.test:8888/headless.html", `--screenshot=${screenshotPath}`], screenshotPath);
// Test variations of the "screenshot" argument when a file path
// isn't specified.
await testFileCreationPositive(["-screenshot", "http://mochi.test:8888/headless.html"], "screenshot.png");
await testFileCreationPositive(["http://mochi.test:8888/headless.html", "-screenshot"], "screenshot.png");
await testFileCreationPositive(["--screenshot", "http://mochi.test:8888/headless.html"], "screenshot.png");
await testFileCreationPositive(["http://mochi.test:8888/headless.html", "--screenshot"], "screenshot.png");
// Test invalid URL arguments (either no argument or too many arguments).
await testFileCreationNegative(["-screenshot"], "screenshot.png");
await testFileCreationNegative(["http://mochi.test:8888/headless.html", "http://mochi.test:8888/headless.html", "-screenshot"], "screenshot.png");
// Test all four basic variations of the "window-size" argument.
await testFileCreationPositive(["-url", "http://mochi.test:8888/headless.html", "-screenshot", "-window-size", "800"], "screenshot.png");
await testFileCreationPositive(["-url", "http://mochi.test:8888/headless.html", "-screenshot", "-window-size=800"], "screenshot.png");
await testFileCreationPositive(["-url", "http://mochi.test:8888/headless.html", "-screenshot", "--window-size", "800"], "screenshot.png");
await testFileCreationPositive(["-url", "http://mochi.test:8888/headless.html", "-screenshot", "--window-size=800"], "screenshot.png");
// Test other variations of the "window-size" argument.
await testWindowSizePositive(800, 600);
await testWindowSizePositive(1234);
await testFileCreationNegative(["-url", "http://mochi.test:8888/headless.html", "-screenshot", screenshotPath, "-window-size", "hello"], screenshotPath);
await testFileCreationNegative(["-url", "http://mochi.test:8888/headless.html", "-screenshot", screenshotPath, "-window-size", "800,"], screenshotPath);
await testFileCreationNegative(["-url", "http://mochi.test:8888/headless.html", "-screenshot", "-window-size", "hello"], "screenshot.png");
await testFileCreationNegative(["-url", "http://mochi.test:8888/headless.html", "-screenshot", "-window-size", "800,"], "screenshot.png");
SimpleTest.finish();
})();
</script>

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

@ -10480,59 +10480,59 @@ nsContentUtils::AppendNativeAnonymousChildren(
}
/* static */ bool
nsContentUtils::GetLoadingPrincipalForXULNode(nsIContent* aLoadingNode,
nsIPrincipal* aDefaultPrincipal,
nsIPrincipal** aLoadingPrincipal)
nsContentUtils::QueryTriggeringPrincipal(nsIContent* aLoadingNode,
nsIPrincipal* aDefaultPrincipal,
nsIPrincipal** aTriggeringPrincipal)
{
MOZ_ASSERT(aLoadingNode);
MOZ_ASSERT(aLoadingPrincipal);
MOZ_ASSERT(aTriggeringPrincipal);
bool result = false;
nsCOMPtr<nsIPrincipal> loadingPrincipal = aDefaultPrincipal;
if (!loadingPrincipal) {
loadingPrincipal = aLoadingNode->NodePrincipal();
}
// If aLoadingNode is content, bail out early.
if (!aLoadingNode->NodePrincipal()->GetIsSystemPrincipal()) {
loadingPrincipal.forget(aTriggeringPrincipal);
return result;
}
nsAutoString loadingStr;
aLoadingNode->GetAttr(kNameSpaceID_None, nsGkAtoms::loadingprincipal,
aLoadingNode->GetAttr(kNameSpaceID_None, nsGkAtoms::triggeringprincipal,
loadingStr);
// Fall back to mContent's principal if 'loadingprincipal' isn't specified,
// or if the doc isn't loaded by System Principal.
if (loadingStr.IsEmpty() ||
!aLoadingNode->OwnerDoc()->NodePrincipal()->GetIsSystemPrincipal()) {
loadingPrincipal.forget(aLoadingPrincipal);
// Fall back if 'triggeringprincipal' isn't specified,
if (loadingStr.IsEmpty()) {
loadingPrincipal.forget(aTriggeringPrincipal);
return result;
}
nsCOMPtr<nsISupports> serializedPrincipal;
NS_DeserializeObject(NS_ConvertUTF16toUTF8(loadingStr),
getter_AddRefs(serializedPrincipal));
loadingPrincipal = do_QueryInterface(serializedPrincipal);
if (loadingPrincipal) {
// We only allow specifying loadingprincipal attribute on a node loaded by
// SystemPrincipal.
MOZ_ASSERT(nsContentUtils::IsSystemPrincipal(aLoadingNode->NodePrincipal()),
"aLoadingNode Should be loaded with SystemPrincipal");
nsCOMPtr<nsIPrincipal> serializedPrin = do_QueryInterface(serializedPrincipal);
if (serializedPrin) {
result = true;
serializedPrin.forget(aTriggeringPrincipal);
} else {
// Fallback if the deserialization is failed.
loadingPrincipal = aLoadingNode->NodePrincipal();
loadingPrincipal.forget(aTriggeringPrincipal);
}
loadingPrincipal.forget(aLoadingPrincipal);
return result;
}
/* static */ void
nsContentUtils::GetContentPolicyTypeForUIImageLoading(nsIContent* aLoadingNode,
nsIPrincipal** aLoadingPrincipal,
nsIPrincipal** aTriggeringPrincipal,
nsContentPolicyType& aContentPolicyType,
uint64_t* aRequestContextID)
{
MOZ_ASSERT(aRequestContextID);
bool result = GetLoadingPrincipalForXULNode(aLoadingNode, aLoadingPrincipal);
bool result = QueryTriggeringPrincipal(aLoadingNode, aTriggeringPrincipal);
if (result) {
// Set the content policy type to TYPE_INTERNAL_IMAGE_FAVICON for
// indicating it's a favicon loading.

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

@ -3083,24 +3083,25 @@ public:
uint32_t aFlags);
/**
* Query loadingPrincipal if it is specified as 'loadingprincipal' attribute on
* aLoadingNode, otherwise the NodePrincipal of aLoadingNode is returned
* (which is System Principal).
* Query triggeringPrincipal if there's a 'triggeringprincipal' attribute on
* aLoadingNode, if no such attribute is specified, aDefaultPrincipal is
* returned if it is provided, otherwise the NodePrincipal of aLoadingNode is
* returned.
*
* Return true if aLoadingPrincipal has 'loadingprincipal' attributes, and
* the value 'loadingprincipal' is also successfully deserialized, otherwise
* Return true if aLoadingNode has a 'triggeringprincipal' attribute, and
* the value 'triggeringprincipal' is also successfully deserialized, otherwise
* return false.
*/
static bool
GetLoadingPrincipalForXULNode(nsIContent* aLoadingNode,
nsIPrincipal* aDefaultPrincipal,
nsIPrincipal** aTriggeringPrincipal);
QueryTriggeringPrincipal(nsIContent* aLoadingNode,
nsIPrincipal* aDefaultPrincipal,
nsIPrincipal** aTriggeringPrincipal);
static bool
GetLoadingPrincipalForXULNode(nsIContent* aLoadingNode,
nsIPrincipal** aTriggeringPrincipal)
QueryTriggeringPrincipal(nsIContent* aLoadingNode,
nsIPrincipal** aTriggeringPrincipal)
{
return GetLoadingPrincipalForXULNode(aLoadingNode, nullptr, aTriggeringPrincipal);
return QueryTriggeringPrincipal(aLoadingNode, nullptr, aTriggeringPrincipal);
}
/**
@ -3110,7 +3111,7 @@ public:
*/
static void
GetContentPolicyTypeForUIImageLoading(nsIContent* aLoadingNode,
nsIPrincipal** aLoadingPrincipal,
nsIPrincipal** aTriggeringPrincipal,
nsContentPolicyType& aContentPolicyType,
uint64_t* aRequestContextID);

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

@ -644,7 +644,7 @@ GK_ATOM(listing, "listing")
GK_ATOM(listitem, "listitem")
GK_ATOM(listrows, "listrows")
GK_ATOM(load, "load")
GK_ATOM(loadingprincipal, "loadingprincipal")
GK_ATOM(triggeringprincipal, "triggeringprincipal")
GK_ATOM(localedir, "localedir")
GK_ATOM(localName, "local-name")
GK_ATOM(longdesc, "longdesc")

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

@ -1044,10 +1044,10 @@ nsImageLoadingContent::LoadImage(nsIURI* aNewURI,
nsCOMPtr<nsIPrincipal> triggeringPrincipal;
bool result =
nsContentUtils::GetLoadingPrincipalForXULNode(content, aTriggeringPrincipal,
getter_AddRefs(triggeringPrincipal));
nsContentUtils::QueryTriggeringPrincipal(content, aTriggeringPrincipal,
getter_AddRefs(triggeringPrincipal));
// If result is true, which means this node has specified 'loadingprincipal'
// If result is true, which means this node has specified 'triggeringprincipal'
// attribute on it, so we use favicon as the policy type.
nsContentPolicyType policyType = result ?
nsIContentPolicy::TYPE_INTERNAL_IMAGE_FAVICON:

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

@ -2419,6 +2419,7 @@ nsRange::CutContents(DocumentFragment** aFragment)
{
nsCOMPtr<nsINode> n = do_QueryInterface(commonCloneAncestor);
n->AppendChild(*farthestAncestor, res);
res.WouldReportJSException();
if (NS_WARN_IF(res.Failed())) {
return res.StealNSResult();
}
@ -2431,6 +2432,7 @@ nsRange::CutContents(DocumentFragment** aFragment)
} else {
commonCloneAncestor->AppendChild(*nodeToResult, res);
}
res.WouldReportJSException();
if (NS_WARN_IF(res.Failed())) {
return res.StealNSResult();
}

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

@ -163,10 +163,13 @@ function updateDescriptionSecondStepTouchActionElement(target, scrollReturnInter
document.getElementById('desc').innerHTML = "Test Description: Try to scroll element RIGHT moving your outside of the red border";
}
function updateDescriptionThirdStepTouchActionElement(target, scrollReturnInterval) {
function updateDescriptionThirdStepTouchActionElement(target, scrollReturnInterval, callback = null) {
window.setTimeout(function() {
objectScroller(target, 'left', 0);}
, scrollReturnInterval);
objectScroller(target, 'left', 0);
if (callback) {
callback();
}
}, scrollReturnInterval);
document.getElementById('desc').innerHTML = "Test Description: Try to scroll element DOWN then RIGHT starting your touch inside of the element. Then tap complete button";
}

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

@ -88,10 +88,11 @@
if(xScrollIsReceived && yScrollIsReceived) {
test_touchaction_div.done();
updateDescriptionThirdStepTouchActionElement(target0, scrollReturnInterval);
setTimeout(function() {
isFirstPart = false;
}, 2 * scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
updateDescriptionThirdStepTouchActionElement(target0, scrollReturnInterval, function () {
setTimeout(function() {
isFirstPart = false;
}, scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
});
}
}
else {

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

@ -91,14 +91,15 @@
if(xScrollIsReceived && yScrollIsReceived) {
test_touchaction_div.done();
updateDescriptionThirdStepTouchActionElement(target0, scrollReturnInterval);
setTimeout(function() {
isFirstPart = false;
xScr0 = target0.scrollLeft;
xScr0 = target0.scrollLeft;
xScrollIsReceived = false;
yScrollIsReceived = false;
}, 2 * scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
updateDescriptionThirdStepTouchActionElement(target0, scrollReturnInterval, function () {
setTimeout(function() {
isFirstPart = false;
xScr0 = target0.scrollLeft;
xScr0 = target0.scrollLeft;
xScrollIsReceived = false;
yScrollIsReceived = false;
}, scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
});
}
}
});

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

@ -103,10 +103,11 @@
if(xScrollIsReceived && yScrollIsReceived) {
test_touchaction_row.done();
updateDescriptionThirdStepTable(target0, scrollReturnInterval);
setTimeout(function() {
isFirstPart = false;
}, 2 * scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
updateDescriptionThirdStepTable(target0, scrollReturnInterval, function() {
setTimeout(function() {
isFirstPart = false;
}, scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
});
}
}
else {
@ -123,9 +124,12 @@
document.getElementById('desc').innerHTML = "Test Description: Try to scroll element RIGHT staring your touch over the Row 1";
}
function updateDescriptionThirdStepTable(target, scrollReturnInterval) {
function updateDescriptionThirdStepTable(target, scrollReturnInterval, callback = null) {
window.setTimeout(function() {
objectScroller(target, 'left', 0);
if (callback) {
callback();
}
}
, scrollReturnInterval);
document.getElementById('desc').innerHTML = "Test Description: Try to scroll element DOWN then RIGHT starting your touch inside of the Cell 3";

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

@ -1193,16 +1193,17 @@ public:
? nsIContentPolicy::TYPE_INTERNAL_AUDIO :
nsIContentPolicy::TYPE_INTERNAL_VIDEO;
// If aElement has 'loadingprincipal' attribute, we will use the value as
// If aElement has 'triggeringprincipal' attribute, we will use the value as
// triggeringPrincipal for the channel, otherwise it will default to use
// aElement->NodePrincipal().
// This function returns true when aElement has 'loadingprincipal', so if
// This function returns true when aElement has 'triggeringprincipal', so if
// setAttrs is true we will override the origin attributes on the channel
// later.
nsCOMPtr<nsIPrincipal> triggeringPrincipal;
bool setAttrs = nsContentUtils::GetLoadingPrincipalForXULNode(aElement,
aElement->mLoadingSrcTriggeringPrincipal,
getter_AddRefs(triggeringPrincipal));
bool setAttrs =
nsContentUtils::QueryTriggeringPrincipal(aElement,
aElement->mLoadingSrcTriggeringPrincipal,
getter_AddRefs(triggeringPrincipal));
nsCOMPtr<nsILoadGroup> loadGroup = aElement->GetDocumentLoadGroup();
nsCOMPtr<nsIChannel> channel;

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

@ -502,7 +502,7 @@ skip-if = toolkit == 'android' # bug 939642
[test_nested_invalid_fieldsets.html]
[test_object_attributes_reflection.html]
[test_object_plugin_nav.html]
skip-if = (toolkit == 'android') || (os == 'win' && debug) # plugins not supported on android, bug 1388764 for debug
skip-if = (toolkit == 'android') || ((os == 'win' || os == 'linux') && debug) # plugins not supported on android, bug 1388764 for debug
[test_ol_attributes_reflection.html]
[test_option_defaultSelected.html]
[test_option_selected_state.html]

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

@ -4925,12 +4925,9 @@ GetFileForPath(const nsAString& aPath)
{
MOZ_ASSERT(!aPath.IsEmpty());
nsCOMPtr<nsIFile> file = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID);
if (NS_WARN_IF(!file)) {
return nullptr;
}
if (NS_WARN_IF(NS_FAILED(file->InitWithPath(aPath)))) {
nsCOMPtr<nsIFile> file;
if (NS_WARN_IF(NS_FAILED(NS_NewLocalFile(aPath, false,
getter_AddRefs(file))))) {
return nullptr;
}
@ -11255,13 +11252,8 @@ DatabaseConnection::GetFileSize(const nsAString& aPath, int64_t* aResult)
MOZ_ASSERT(!aPath.IsEmpty());
MOZ_ASSERT(aResult);
nsresult rv;
nsCOMPtr<nsIFile> file = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = file->InitWithPath(aPath);
nsCOMPtr<nsIFile> file;
nsresult rv = NS_NewLocalFile(aPath, false, getter_AddRefs(file));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}

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

@ -763,21 +763,21 @@ ChannelMediaResource::RecreateChannel()
nsContentPolicyType contentPolicyType = element->IsHTMLElement(nsGkAtoms::audio) ?
nsIContentPolicy::TYPE_INTERNAL_AUDIO : nsIContentPolicy::TYPE_INTERNAL_VIDEO;
// If element has 'loadingprincipal' attribute, we will use the value as
// loadingPrincipal for the channel, otherwise it will default to use
// If element has 'triggeringprincipal' attribute, we will use the value as
// triggeringPrincipal for the channel, otherwise it will default to use
// aElement->NodePrincipal().
// This function returns true when element has 'loadingprincipal', so if
// This function returns true when element has 'triggeringprincipal', so if
// setAttrs is true we will override the origin attributes on the channel
// later.
nsCOMPtr<nsIPrincipal> loadingPrincipal;
nsCOMPtr<nsIPrincipal> triggeringPrincipal;
bool setAttrs =
nsContentUtils::GetLoadingPrincipalForXULNode(element,
getter_AddRefs(loadingPrincipal));
nsContentUtils::QueryTriggeringPrincipal(element,
getter_AddRefs(triggeringPrincipal));
nsresult rv = NS_NewChannelWithTriggeringPrincipal(getter_AddRefs(mChannel),
mURI,
element,
loadingPrincipal,
triggeringPrincipal,
securityFlags,
contentPolicyType,
loadGroup,
@ -789,7 +789,7 @@ ChannelMediaResource::RecreateChannel()
nsCOMPtr<nsILoadInfo> loadInfo = mChannel->GetLoadInfo();
if (loadInfo) {
// The function simply returns NS_OK, so we ignore the return value.
Unused << loadInfo->SetOriginAttributes(loadingPrincipal->OriginAttributesRef());
Unused << loadInfo->SetOriginAttributes(triggeringPrincipal->OriginAttributesRef());
}
}

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

@ -3584,16 +3584,11 @@ QuotaManager::CollectOriginsForEviction(
nsresult
QuotaManager::Init(const nsAString& aBasePath)
{
nsresult rv;
mBasePath = aBasePath;
nsCOMPtr<nsIFile> baseDir = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = baseDir->InitWithPath(aBasePath);
nsCOMPtr<nsIFile> baseDir;
nsresult rv = NS_NewLocalFile(aBasePath, false, getter_AddRefs(baseDir));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
@ -3947,11 +3942,8 @@ QuotaManager::GetQuotaObject(PersistenceType aPersistenceType,
*aFileSizeOut = 0;
}
nsresult rv;
nsCOMPtr<nsIFile> file = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, nullptr);
rv = file->InitWithPath(aPath);
nsCOMPtr<nsIFile> file;
nsresult rv = NS_NewLocalFile(aPath, false, getter_AddRefs(file));
NS_ENSURE_SUCCESS(rv, nullptr);
return GetQuotaObject(aPersistenceType, aGroup, aOrigin, file, aFileSizeOut);
@ -4006,12 +3998,9 @@ QuotaManager::GetDirectoryForOrigin(PersistenceType aPersistenceType,
const nsACString& aASCIIOrigin,
nsIFile** aDirectory) const
{
nsresult rv;
nsCOMPtr<nsIFile> directory =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
rv = directory->InitWithPath(GetStoragePath(aPersistenceType));
nsCOMPtr<nsIFile> directory;
nsresult rv = NS_NewLocalFile(GetStoragePath(aPersistenceType), false,
getter_AddRefs(directory));
NS_ENSURE_SUCCESS(rv, rv);
nsAutoCString originSanitized(aASCIIOrigin);
@ -4217,15 +4206,9 @@ QuotaManager::InitializeRepository(PersistenceType aPersistenceType)
MOZ_ASSERT(aPersistenceType == PERSISTENCE_TYPE_TEMPORARY ||
aPersistenceType == PERSISTENCE_TYPE_DEFAULT);
nsresult rv;
nsCOMPtr<nsIFile> directory =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = directory->InitWithPath(GetStoragePath(aPersistenceType));
nsCOMPtr<nsIFile> directory;
nsresult rv = NS_NewLocalFile(GetStoragePath(aPersistenceType), false,
getter_AddRefs(directory));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
@ -4396,13 +4379,10 @@ QuotaManager::MaybeUpgradeIndexedDBDirectory()
{
AssertIsOnIOThread();
nsresult rv;
nsCOMPtr<nsIFile> indexedDBDir =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
rv = indexedDBDir->InitWithPath(mIndexedDBPath);
nsCOMPtr<nsIFile> indexedDBDir;
nsresult rv = NS_NewLocalFile(mIndexedDBPath, false,
getter_AddRefs(indexedDBDir));
NS_ENSURE_SUCCESS(rv, rv);
bool exists;
@ -4423,11 +4403,9 @@ QuotaManager::MaybeUpgradeIndexedDBDirectory()
return NS_OK;
}
nsCOMPtr<nsIFile> persistentStorageDir =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
rv = persistentStorageDir->InitWithPath(mStoragePath);
nsCOMPtr<nsIFile> persistentStorageDir;
rv = NS_NewLocalFile(mStoragePath, false,
getter_AddRefs(persistentStorageDir));
NS_ENSURE_SUCCESS(rv, rv);
rv = persistentStorageDir->Append(NS_LITERAL_STRING(PERSISTENT_DIRECTORY_NAME));
@ -4462,15 +4440,10 @@ QuotaManager::MaybeUpgradePersistentStorageDirectory()
{
AssertIsOnIOThread();
nsresult rv;
nsCOMPtr<nsIFile> persistentStorageDir =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = persistentStorageDir->InitWithPath(mStoragePath);
nsCOMPtr<nsIFile> persistentStorageDir;
nsresult rv = NS_NewLocalFile(mStoragePath, false,
getter_AddRefs(persistentStorageDir));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
@ -4502,13 +4475,9 @@ QuotaManager::MaybeUpgradePersistentStorageDirectory()
return NS_OK;
}
nsCOMPtr<nsIFile> defaultStorageDir =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = defaultStorageDir->InitWithPath(mDefaultStoragePath);
nsCOMPtr<nsIFile> defaultStorageDir;
rv = NS_NewLocalFile(mDefaultStoragePath, false,
getter_AddRefs(defaultStorageDir));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
@ -4534,13 +4503,9 @@ QuotaManager::MaybeUpgradePersistentStorageDirectory()
}
// Upgrade metadata files for origin directories in temporary storage.
nsCOMPtr<nsIFile> temporaryStorageDir =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = temporaryStorageDir->InitWithPath(mTemporaryStoragePath);
nsCOMPtr<nsIFile> temporaryStorageDir;
rv = NS_NewLocalFile(mTemporaryStoragePath, false,
getter_AddRefs(temporaryStorageDir));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
@ -4585,15 +4550,9 @@ QuotaManager::MaybeRemoveOldDirectories()
{
AssertIsOnIOThread();
nsresult rv;
nsCOMPtr<nsIFile> indexedDBDir =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = indexedDBDir->InitWithPath(mIndexedDBPath);
nsCOMPtr<nsIFile> indexedDBDir;
nsresult rv = NS_NewLocalFile(mIndexedDBPath, false,
getter_AddRefs(indexedDBDir));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
@ -4613,13 +4572,9 @@ QuotaManager::MaybeRemoveOldDirectories()
}
}
nsCOMPtr<nsIFile> persistentStorageDir =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = persistentStorageDir->InitWithPath(mStoragePath);
nsCOMPtr<nsIFile> persistentStorageDir;
rv = NS_NewLocalFile(mStoragePath, false,
getter_AddRefs(persistentStorageDir));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
@ -4668,13 +4623,9 @@ QuotaManager::UpgradeStorageFrom0_0To1_0(mozIStorageConnection* aConnection)
}
for (const PersistenceType persistenceType : kAllPersistenceTypes) {
nsCOMPtr<nsIFile> directory =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = directory->InitWithPath(GetStoragePath(persistenceType));
nsCOMPtr<nsIFile> directory;
rv = NS_NewLocalFile(GetStoragePath(persistenceType), false,
getter_AddRefs(directory));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
@ -4785,13 +4736,9 @@ QuotaManager::UpgradeStorageFrom1_0To2_0(mozIStorageConnection* aConnection)
nsresult rv;
for (const PersistenceType persistenceType : kAllPersistenceTypes) {
nsCOMPtr<nsIFile> directory =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = directory->InitWithPath(GetStoragePath(persistenceType));
nsCOMPtr<nsIFile> directory;
rv = NS_NewLocalFile(GetStoragePath(persistenceType), false,
getter_AddRefs(directory));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
@ -4848,13 +4795,9 @@ QuotaManager::UpgradeStorageFrom2_0To2_1(mozIStorageConnection* aConnection)
nsresult rv;
for (const PersistenceType persistenceType : kAllPersistenceTypes) {
nsCOMPtr<nsIFile> directory =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = directory->InitWithPath(GetStoragePath(persistenceType));
nsCOMPtr<nsIFile> directory;
rv = NS_NewLocalFile(GetStoragePath(persistenceType), false,
getter_AddRefs(directory));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
@ -4919,15 +4862,9 @@ QuotaManager::EnsureStorageIsInitialized()
return NS_OK;
}
nsresult rv;
nsCOMPtr<nsIFile> storageFile =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = storageFile->InitWithPath(mBasePath);
nsCOMPtr<nsIFile> storageFile;
nsresult rv = NS_NewLocalFile(mBasePath, false, getter_AddRefs(storageFile));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
@ -4993,13 +4930,8 @@ QuotaManager::EnsureStorageIsInitialized()
if (storageVersion < kStorageVersion) {
const bool newDatabase = !storageVersion;
nsCOMPtr<nsIFile> storageDir =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = storageDir->InitWithPath(mStoragePath);
nsCOMPtr<nsIFile> storageDir;
rv = NS_NewLocalFile(mStoragePath, false, getter_AddRefs(storageDir));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
@ -5011,13 +4943,9 @@ QuotaManager::EnsureStorageIsInitialized()
}
if (!exists) {
nsCOMPtr<nsIFile> indexedDBDir =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = indexedDBDir->InitWithPath(mIndexedDBPath);
nsCOMPtr<nsIFile> indexedDBDir;
rv = NS_NewLocalFile(mIndexedDBPath, false,
getter_AddRefs(indexedDBDir));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
@ -5241,6 +5169,10 @@ QuotaManager::EnsureOriginIsInitializedInternal(
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
mTemporaryStorageInitialized = true;
CheckTemporaryStorageLimits();
}
bool created;
@ -6945,15 +6877,10 @@ GetUsageOp::TraverseRepository(QuotaManager* aQuotaManager,
AssertIsOnIOThread();
MOZ_ASSERT(aQuotaManager);
nsresult rv;
nsCOMPtr<nsIFile> directory =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = directory->InitWithPath(aQuotaManager->GetStoragePath(aPersistenceType));
nsCOMPtr<nsIFile> directory;
nsresult rv = NS_NewLocalFile(aQuotaManager->GetStoragePath(aPersistenceType),
false, getter_AddRefs(directory));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
@ -7387,15 +7314,10 @@ ResetOrClearOp::DeleteFiles(QuotaManager* aQuotaManager)
AssertIsOnIOThread();
MOZ_ASSERT(aQuotaManager);
nsresult rv;
nsCOMPtr<nsIFile> directory =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return;
}
rv = directory->InitWithPath(aQuotaManager->GetStoragePath());
nsCOMPtr<nsIFile> directory;
nsresult rv = NS_NewLocalFile(aQuotaManager->GetStoragePath(), false,
getter_AddRefs(directory));
if (NS_WARN_IF(NS_FAILED(rv))) {
return;
}
@ -7408,13 +7330,9 @@ ResetOrClearOp::DeleteFiles(QuotaManager* aQuotaManager)
MOZ_ASSERT(false, "Failed to remove storage directory!");
}
nsCOMPtr<nsIFile> storageFile =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return;
}
rv = storageFile->InitWithPath(aQuotaManager->GetBasePath());
nsCOMPtr<nsIFile> storageFile;
rv = NS_NewLocalFile(aQuotaManager->GetBasePath(), false,
getter_AddRefs(storageFile));
if (NS_WARN_IF(NS_FAILED(rv))) {
return;
}
@ -7469,15 +7387,10 @@ ClearRequestBase::DeleteFiles(QuotaManager* aQuotaManager,
AssertIsOnIOThread();
MOZ_ASSERT(aQuotaManager);
nsresult rv;
nsCOMPtr<nsIFile> directory =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return;
}
rv = directory->InitWithPath(aQuotaManager->GetStoragePath(aPersistenceType));
nsCOMPtr<nsIFile> directory;
nsresult rv = NS_NewLocalFile(aQuotaManager->GetStoragePath(aPersistenceType),
false, getter_AddRefs(directory));
if (NS_WARN_IF(NS_FAILED(rv))) {
return;
}
@ -8881,19 +8794,14 @@ CreateOrUpgradeDirectoryMetadataHelper::ProcessOriginDirectory(
// Move internal origins to new persistent storage.
if (QuotaManager::IsOriginInternal(aOriginProps.mSpec)) {
if (!mPermanentStorageDir) {
mPermanentStorageDir =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
QuotaManager* quotaManager = QuotaManager::Get();
MOZ_ASSERT(quotaManager);
const nsString& permanentStoragePath =
quotaManager->GetStoragePath(PERSISTENCE_TYPE_PERSISTENT);
rv = mPermanentStorageDir->InitWithPath(permanentStoragePath);
rv = NS_NewLocalFile(permanentStoragePath, false,
getter_AddRefs(mPermanentStorageDir));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}

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

@ -75,7 +75,11 @@
window);
document.addEventListener("mousemove", mouseMoveHandler);
synthesizeMouseAtCenter(div, {type: "mousemove"}, window);
requestAnimationFrame(() => {
setTimeout(() => {
synthesizeMouseAtCenter(div, {type: "mousemove"}, window);
}, 0);
});
} else {
info("Got pointerlockchange for exiting");
pointerUnlocked = true;

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

@ -46,8 +46,8 @@ NS_IMPL_CYCLE_COLLECTION(ServiceWorkerPrivate, mSupportsArray)
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(ServiceWorkerPrivate, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(ServiceWorkerPrivate, Release)
// Tracks the "dom.disable_open_click_delay" preference. Modified on main
// thread, read on worker threads.
// Tracks the "dom.serviceWorkers.disable_open_click_delay" preference. Modified
// on main thread, read on worker threads.
// It is updated every time a "notificationclick" event is dispatched. While
// this is done without synchronization, at the worst, the thread will just get
// an older value within which a popup is allowed to be displayed, which will
@ -1282,7 +1282,8 @@ ServiceWorkerPrivate::SendNotificationEvent(const nsAString& aEventName,
WakeUpReason why;
if (aEventName.EqualsLiteral(NOTIFICATION_CLICK_EVENT_NAME)) {
why = NotificationClickEvent;
gDOMDisableOpenClickDelay = Preferences::GetInt("dom.disable_open_click_delay");
gDOMDisableOpenClickDelay =
Preferences::GetInt("dom.serviceWorkers.disable_open_click_delay");
} else if (aEventName.EqualsLiteral(NOTIFICATION_CLOSE_EVENT_NAME)) {
why = NotificationCloseEvent;
} else {

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

@ -54,7 +54,7 @@ add_task(async function setup() {
["dom.webnotifications.workers.enabled", true],
["dom.webnotifications.serviceworker.enabled", true],
["notification.prompt.testing", true],
["dom.disable_open_click_delay", 1000],
["dom.serviceWorkers.disable_open_click_delay", 1000],
["dom.serviceWorkers.idle_timeout", 299999],
["dom.serviceWorkers.idle_extended_timeout", 299999],
["browser.link.open_newwindow", 3],

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

@ -59,7 +59,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=916893
["dom.webnotifications.workers.enabled", true],
["dom.webnotifications.serviceworker.enabled", true],
["notification.prompt.testing", true],
["dom.disable_open_click_delay", 1000],
["dom.serviceWorkers.disable_open_click_delay", 1000],
]}, runTest);
</script>
</body>

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

@ -100,7 +100,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1172870
["dom.webnotifications.workers.enabled", true],
["dom.webnotifications.serviceworker.enabled", true],
["notification.prompt.testing", true],
["dom.disable_open_click_delay", 1000],
["dom.serviceWorkers.disable_open_click_delay", 1000],
["dom.serviceWorkers.idle_timeout", 299999],
["dom.serviceWorkers.idle_extended_timeout", 299999]
]}, runTest);

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

@ -190,25 +190,18 @@ GPUProcessHost::Shutdown()
void
GPUProcessHost::OnChannelClosed()
{
if (!mShutdownRequested) {
mChannelClosed = true;
if (!mShutdownRequested && mListener) {
// This is an unclean shutdown. Notify our listener that we're going away.
mChannelClosed = true;
if (mListener) {
mListener->OnProcessUnexpectedShutdown(this);
}
mListener->OnProcessUnexpectedShutdown(this);
} else {
DestroyProcess();
}
// Release the actor.
GPUChild::Destroy(Move(mGPUChild));
MOZ_ASSERT(!mGPUChild);
// If the owner of GPUProcessHost already requested shutdown, we can now
// schedule destruction. Otherwise we must wait for someone to call
// Shutdown. Note that GPUProcessManager calls Shutdown within
// OnProcessUnexpectedShutdown.
if (mShutdownRequested) {
DestroyProcess();
}
}
void

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

@ -28,7 +28,7 @@ VsyncBridgeParent::VsyncBridgeParent()
: mOpen(false)
{
MOZ_COUNT_CTOR(VsyncBridgeParent);
mCompositorThreadRef = CompositorThreadHolder::GetSingleton();
mCompositorThreadRef = new CompositorThreadHolderDebug("VsyncBridge");
}
VsyncBridgeParent::~VsyncBridgeParent()

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

@ -38,7 +38,7 @@ private:
private:
bool mOpen;
RefPtr<layers::CompositorThreadHolder> mCompositorThreadRef;
RefPtr<layers::CompositorThreadHolderDebug> mCompositorThreadRef;
};
} // namespace gfx

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

@ -526,10 +526,14 @@ CompositorBridgeChild::RecvHideAllPlugins(const uintptr_t& aParentWidget)
}
mozilla::ipc::IPCResult
CompositorBridgeChild::RecvDidComposite(const uint64_t& aId, const uint64_t& aTransactionId,
CompositorBridgeChild::RecvDidComposite(const uint64_t& aId,
const uint64_t& aTransactionId,
const TimeStamp& aCompositeStart,
const TimeStamp& aCompositeEnd)
{
// Hold a reference to keep texture pools alive. See bug 1387799
AutoTArray<RefPtr<TextureClientPool>,2> texturePools = mTexturePools;
if (mLayerManager) {
MOZ_ASSERT(aId == 0);
MOZ_ASSERT(mLayerManager->GetBackendType() == LayersBackend::LAYERS_CLIENT ||
@ -544,13 +548,14 @@ CompositorBridgeChild::RecvDidComposite(const uint64_t& aId, const uint64_t& aTr
}
}
for (size_t i = 0; i < mTexturePools.Length(); i++) {
mTexturePools[i]->ReturnDeferredClients();
for (size_t i = 0; i < texturePools.Length(); i++) {
texturePools[i]->ReturnDeferredClients();
}
return IPC_OK();
}
void
CompositorBridgeChild::ActorDestroy(ActorDestroyReason aWhy)
{

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

@ -41,6 +41,8 @@ CompositorManagerParent::CreateSameProcess()
// process case because if we open from the child perspective, we can do it
// on the main thread and complete before we return the manager handles.
RefPtr<CompositorManagerParent> parent = new CompositorManagerParent();
parent->mCompositorThreadHolder =
new CompositorThreadHolderDebug("CompositorManagerSame");
parent->SetOtherProcessId(base::GetCurrentProcId());
return parent.forget();
}
@ -55,6 +57,8 @@ CompositorManagerParent::Create(Endpoint<PCompositorManagerParent>&& aEndpoint)
MOZ_ASSERT(aEndpoint.OtherPid() != base::GetCurrentProcId());
RefPtr<CompositorManagerParent> bridge = new CompositorManagerParent();
bridge->mCompositorThreadHolder =
new CompositorThreadHolderDebug("CompositorManagerContent");
RefPtr<Runnable> runnable = NewRunnableMethod<Endpoint<PCompositorManagerParent>&&>(
"CompositorManagerParent::Bind",
@ -105,7 +109,6 @@ CompositorManagerParent::CreateSameProcessWidgetCompositorBridge(CSSToLayoutDevi
}
CompositorManagerParent::CompositorManagerParent()
: mCompositorThreadHolder(CompositorThreadHolder::GetSingleton())
{
}

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

@ -18,7 +18,7 @@ namespace mozilla {
namespace layers {
class CompositorBridgeParent;
class CompositorThreadHolder;
class CompositorThreadHolderDebug;
#ifndef DEBUG
#define COMPOSITOR_MANAGER_PARENT_EXPLICIT_SHUTDOWN
@ -63,7 +63,7 @@ private:
void DeferredDestroy();
RefPtr<CompositorThreadHolder> mCompositorThreadHolder;
RefPtr<CompositorThreadHolderDebug> mCompositorThreadHolder;
AutoTArray<RefPtr<CompositorBridgeParent>, 1> mPendingCompositorBridges;
};

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

@ -9,6 +9,9 @@
#include "CompositorBridgeParent.h"
#include "mozilla/layers/ImageBridgeParent.h"
#include "mozilla/media/MediaSystemResourceService.h"
#ifdef MOZ_CRASHREPORTER
#include "nsExceptionHandler.h" // for CrashReporter
#endif
namespace mozilla {
@ -19,6 +22,33 @@ void ReleaseVRManagerParentSingleton();
namespace layers {
#ifdef MOZ_CRASHREPORTER
static Atomic<int32_t> sHoldersNextId(0);
#endif
CompositorThreadHolderDebug::CompositorThreadHolderDebug(const char* aName)
: mHolder(CompositorThreadHolder::GetSingleton())
{
#ifdef MOZ_CRASHREPORTER
if (XRE_IsParentProcess()) {
mId.AppendLiteral("gfxCTH:");
mId.Append(aName);
mId.AppendLiteral(":");
mId.AppendInt(++sHoldersNextId);
CrashReporter::AnnotateCrashReport(mId, NS_LITERAL_CSTRING("1"));
}
#endif
}
CompositorThreadHolderDebug::~CompositorThreadHolderDebug()
{
#ifdef MOZ_CRASHREPORTER
if (XRE_IsParentProcess()) {
CrashReporter::AnnotateCrashReport(mId, NS_LITERAL_CSTRING("0"));
}
#endif
}
static StaticRefPtr<CompositorThreadHolder> sCompositorThreadHolder;
static bool sFinishedCompositorShutDown = false;

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

@ -60,6 +60,22 @@ private:
friend class CompositorBridgeParent;
};
class CompositorThreadHolderDebug final
{
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CompositorThreadHolderDebug)
public:
explicit CompositorThreadHolderDebug(const char* aName);
private:
~CompositorThreadHolderDebug();
RefPtr<CompositorThreadHolder> mHolder;
#ifdef MOZ_CRASHREPORTER
nsAutoCString mId;
#endif
};
base::Thread* CompositorThread();
} // namespace layers

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

@ -66,10 +66,13 @@ ImageBridgeParent::ImageBridgeParent(MessageLoop* aLoop,
: mMessageLoop(aLoop)
, mSetChildThreadPriority(false)
, mClosed(false)
, mCompositorThreadHolder(CompositorThreadHolder::GetSingleton())
{
MOZ_ASSERT(NS_IsMainThread());
mCompositorThreadHolder =
new CompositorThreadHolderDebug(IsSameProcess() ? "ImageBridgeSame"
: "ImageBridge");
// creates the map only if it has not been created already, so it is safe
// with several bridges
{

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

@ -142,7 +142,7 @@ private:
*/
static std::map<base::ProcessId, ImageBridgeParent*> sImageBridges;
RefPtr<CompositorThreadHolder> mCompositorThreadHolder;
RefPtr<CompositorThreadHolderDebug> mCompositorThreadHolder;
};
} // namespace layers

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

@ -21,7 +21,7 @@ VideoBridgeParent::VideoBridgeParent()
{
mSelfRef = this;
sVideoBridgeSingleton = this;
mCompositorThreadRef = CompositorThreadHolder::GetSingleton();
mCompositorThreadRef = new CompositorThreadHolderDebug("VideoBridge");
}
VideoBridgeParent::~VideoBridgeParent()

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

@ -12,7 +12,7 @@
namespace mozilla {
namespace layers {
class CompositorThreadHolder;
class CompositorThreadHolderDebug;
class VideoBridgeParent final : public PVideoBridgeParent,
public HostIPCAllocator,
@ -63,7 +63,7 @@ private:
// This keeps us alive until ActorDestroy(), at which point we do a
// deferred destruction of ourselves.
RefPtr<VideoBridgeParent> mSelfRef;
RefPtr<CompositorThreadHolder> mCompositorThreadRef;
RefPtr<CompositorThreadHolderDebug> mCompositorThreadRef;
std::map<uint64_t, PTextureParent*> mTextureMap;

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

@ -12,7 +12,7 @@ function f1() {
B(true),
B(undefined, null, "", "x"),
B({}, 0, 1, -0.0),
B(NaN, -NaN, Symbol(), objectEmulatingUndefined()),
B(NaN, -NaN, Symbol(), createIsHTMLDDA()),
S(false),
S(true),
@ -29,7 +29,7 @@ function f1() {
S(NaN),
S(Symbol()),
S(objectEmulatingUndefined())
S(createIsHTMLDDA())
];
}

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

@ -1,2 +1,2 @@
for (var i=0; i<40; i++)
assertEq(typeof objectEmulatingUndefined(), "undefined");
assertEq(typeof createIsHTMLDDA(), "undefined");

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

@ -1,5 +1,5 @@
x = [
objectEmulatingUndefined(),
createIsHTMLDDA(),
function() {}
];
x.forEach(function() {});

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

@ -1,5 +1,5 @@
function test() {
var values = [undefined, null, Math, objectEmulatingUndefined()];
var values = [undefined, null, Math, createIsHTMLDDA()];
var expected = [true, true, false, true];
for (var i=0; i<100; i++) {

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

@ -1,7 +1,7 @@
function test() {
var funs = [function() {}, new Proxy(function() {}, {}), wrapWithProto(function() {}, null)];
var objects = [{}, new Proxy({}, {}), wrapWithProto({}, null), new Proxy(objectEmulatingUndefined(), {})];
var undefs = [objectEmulatingUndefined(), wrapWithProto(objectEmulatingUndefined(), null)];
var funs = [function() {}, new Proxy(function() {}, {}), wrapWithProto(function() {}, null), new Proxy(createIsHTMLDDA(), {})];
var objects = [{}, new Proxy({}, {}), wrapWithProto({}, null)];
var undefs = [createIsHTMLDDA(), wrapWithProto(createIsHTMLDDA(), null)];
for (var fun of funs) {
assertEq(typeof fun, "function")

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

@ -1,6 +1,6 @@
function f(x) {
Math.exp(x ? 0 : 1)
}
f(objectEmulatingUndefined())
f(objectEmulatingUndefined())
f(createIsHTMLDDA())
f(createIsHTMLDDA())

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

@ -9,5 +9,5 @@ function g() {
function h(y) {
return (y === 0);
}
f(g, [objectEmulatingUndefined()]);
f(g, [createIsHTMLDDA()]);
f(h, [false]);

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

@ -399,10 +399,10 @@ function rnot_number(i) {
var uceFault_not_object = eval(uneval(uceFault).replace('uceFault', 'uceFault_not_object'));
function rnot_object(i) {
var o = objectEmulatingUndefined();
var o = createIsHTMLDDA();
var x = !o;
if(uceFault_not_object(i) || uceFault_not_object(i))
assertEq(x, true /* = !undefined = !document.all = !objectEmulatingUndefined() */);
assertEq(x, true /* = !undefined = !document.all = !createIsHTMLDDA() */);
assertRecoveredOnBailout(x, true);
return i;
}

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

@ -28,5 +28,5 @@ assertEq(foo(false), true);
assertEq(foo(false), true);
assertEq(foo(-0.0), true);
assertEq(foo(-0.0), true);
assertEq(foo(objectEmulatingUndefined()), true);
assertEq(foo(objectEmulatingUndefined()), true);
assertEq(foo(createIsHTMLDDA()), true);
assertEq(foo(createIsHTMLDDA()), true);

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

@ -11,8 +11,8 @@ f(null, true);
f(null, true);
f(undefined, true);
f(undefined, true);
f(objectEmulatingUndefined(), true);
f(objectEmulatingUndefined(), true);
f(createIsHTMLDDA(), true);
f(createIsHTMLDDA(), true);
f(Object.prototype, false);
f(Object.prototype, false);
@ -33,5 +33,5 @@ function h(v, value)
"failed: " + v + " " + value);
}
h(objectEmulatingUndefined(), true);
h(objectEmulatingUndefined(), true);
h(createIsHTMLDDA(), true);
h(createIsHTMLDDA(), true);

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

@ -11,8 +11,8 @@ f(null, true);
f(null, true);
f(undefined, true);
f(undefined, true);
f(objectEmulatingUndefined(), true);
f(objectEmulatingUndefined(), true);
f(createIsHTMLDDA(), true);
f(createIsHTMLDDA(), true);
f(Object.prototype, false);
f(Object.prototype, false);
@ -33,5 +33,5 @@ function h(v, value)
"failed: " + v + " " + value);
}
h(objectEmulatingUndefined(), true);
h(objectEmulatingUndefined(), true);
h(createIsHTMLDDA(), true);
h(createIsHTMLDDA(), true);

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

@ -14,8 +14,8 @@ f(null, 1);
f(null, 2);
f(undefined, 3);
f(undefined, 4);
f(objectEmulatingUndefined(), 5);
f(objectEmulatingUndefined(), 6);
f(createIsHTMLDDA(), 5);
f(createIsHTMLDDA(), 6);
f(Object.prototype, 6);
f(Object.prototype, 6);
@ -42,5 +42,5 @@ function h(v, value)
"failed: " + v + " " + value);
}
h(objectEmulatingUndefined(), 1);
h(objectEmulatingUndefined(), 2);
h(createIsHTMLDDA(), 1);
h(createIsHTMLDDA(), 2);

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

@ -14,8 +14,8 @@ f(null, 1);
f(null, 2);
f(undefined, 3);
f(undefined, 4);
f(objectEmulatingUndefined(), 5);
f(objectEmulatingUndefined(), 6);
f(createIsHTMLDDA(), 5);
f(createIsHTMLDDA(), 6);
f(Object.prototype, 6);
f(Object.prototype, 6);
@ -42,5 +42,5 @@ function h(v, value)
"failed: " + v + " " + value);
}
h(objectEmulatingUndefined(), 1);
h(objectEmulatingUndefined(), 2);
h(createIsHTMLDDA(), 1);
h(createIsHTMLDDA(), 2);

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

@ -14,8 +14,8 @@ f(null, 2);
f(null, 2);
f(undefined, 2);
f(undefined, 2);
f(objectEmulatingUndefined(), 2);
f(objectEmulatingUndefined(), 2);
f(createIsHTMLDDA(), 2);
f(createIsHTMLDDA(), 2);
f(Object.prototype, 3);
f(Object.prototype, 4);
@ -42,5 +42,5 @@ function h(v, value)
"failed: " + v + " " + value);
}
h(objectEmulatingUndefined(), 0);
h(objectEmulatingUndefined(), 0);
h(createIsHTMLDDA(), 0);
h(createIsHTMLDDA(), 0);

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

@ -14,8 +14,8 @@ f(null, 2);
f(null, 2);
f(undefined, 2);
f(undefined, 2);
f(objectEmulatingUndefined(), 2);
f(objectEmulatingUndefined(), 2);
f(createIsHTMLDDA(), 2);
f(createIsHTMLDDA(), 2);
f(Object.prototype, 3);
f(Object.prototype, 4);
@ -42,5 +42,5 @@ function h(v, value)
"failed: " + v + " " + value);
}
h(objectEmulatingUndefined(), 0);
h(objectEmulatingUndefined(), 0);
h(createIsHTMLDDA(), 0);
h(createIsHTMLDDA(), 0);

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

@ -14,8 +14,8 @@ f(null, 1);
f(null, 2);
f(undefined, 2);
f(undefined, 2);
f(objectEmulatingUndefined(), 2);
f(objectEmulatingUndefined(), 2);
f(createIsHTMLDDA(), 2);
f(createIsHTMLDDA(), 2);
f(Object.prototype, 2);
f(Object.prototype, 2);
@ -42,5 +42,5 @@ function h(v, value)
"failed: " + v + " " + value);
}
h(objectEmulatingUndefined(), 0);
h(objectEmulatingUndefined(), 0);
h(createIsHTMLDDA(), 0);
h(createIsHTMLDDA(), 0);

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

@ -14,8 +14,8 @@ f(null, 0);
f(null, 0);
f(undefined, 1);
f(undefined, 2);
f(objectEmulatingUndefined(), 2);
f(objectEmulatingUndefined(), 2);
f(createIsHTMLDDA(), 2);
f(createIsHTMLDDA(), 2);
f(Object.prototype, 2);
f(Object.prototype, 2);
@ -42,5 +42,5 @@ function h(v, value)
"failed: " + v + " " + value);
}
h(objectEmulatingUndefined(), 0);
h(objectEmulatingUndefined(), 0);
h(createIsHTMLDDA(), 0);
h(createIsHTMLDDA(), 0);

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

@ -14,8 +14,8 @@ f(null, 2);
f(null, 2);
f(undefined, 3);
f(undefined, 4);
f(objectEmulatingUndefined(), 5);
f(objectEmulatingUndefined(), 6);
f(createIsHTMLDDA(), 5);
f(createIsHTMLDDA(), 6);
f(Object.prototype, 7);
f(Object.prototype, 8);
@ -42,5 +42,5 @@ function h(v, value)
"failed: " + v + " " + value);
}
h(objectEmulatingUndefined(), 1);
h(objectEmulatingUndefined(), 2);
h(createIsHTMLDDA(), 1);
h(createIsHTMLDDA(), 2);

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

@ -14,8 +14,8 @@ f(null, 3);
f(null, 4);
f(undefined, 4);
f(undefined, 4);
f(objectEmulatingUndefined(), 5);
f(objectEmulatingUndefined(), 6);
f(createIsHTMLDDA(), 5);
f(createIsHTMLDDA(), 6);
f(Object.prototype, 7);
f(Object.prototype, 8);
@ -42,5 +42,5 @@ function h(v, value)
"failed: " + v + " " + value);
}
h(objectEmulatingUndefined(), 1);
h(objectEmulatingUndefined(), 2);
h(createIsHTMLDDA(), 1);
h(createIsHTMLDDA(), 2);

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

@ -5,9 +5,9 @@ function t1(v)
return 0;
}
assertEq(t1(objectEmulatingUndefined()), 0);
assertEq(t1(objectEmulatingUndefined()), 0);
assertEq(t1(objectEmulatingUndefined()), 0);
assertEq(t1(createIsHTMLDDA()), 0);
assertEq(t1(createIsHTMLDDA()), 0);
assertEq(t1(createIsHTMLDDA()), 0);
function t2(v)
{
@ -19,6 +19,6 @@ function t2(v)
assertEq(t2(17), 1);
assertEq(t2(0), 0);
assertEq(t2(-0), 0);
assertEq(t2(objectEmulatingUndefined()), 0);
assertEq(t2(objectEmulatingUndefined()), 0);
assertEq(t2(objectEmulatingUndefined()), 0);
assertEq(t2(createIsHTMLDDA()), 0);
assertEq(t2(createIsHTMLDDA()), 0);
assertEq(t2(createIsHTMLDDA()), 0);

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

@ -11,8 +11,8 @@ f(null, false);
f(null, false);
f(undefined, false);
f(undefined, false);
f(objectEmulatingUndefined(), false);
f(objectEmulatingUndefined(), false);
f(createIsHTMLDDA(), false);
f(createIsHTMLDDA(), false);
f(Object.prototype, true);
f(Object.prototype, true);
@ -33,5 +33,5 @@ function h(v, value)
"failed: " + v + " " + value);
}
h(objectEmulatingUndefined(), false);
h(objectEmulatingUndefined(), false);
h(createIsHTMLDDA(), false);
h(createIsHTMLDDA(), false);

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

@ -11,8 +11,8 @@ f(null, false);
f(null, false);
f(undefined, false);
f(undefined, false);
f(objectEmulatingUndefined(), false);
f(objectEmulatingUndefined(), false);
f(createIsHTMLDDA(), false);
f(createIsHTMLDDA(), false);
f(Object.prototype, true);
f(Object.prototype, true);
@ -33,5 +33,5 @@ function h(v, value)
"failed: " + v + " " + value);
}
h(objectEmulatingUndefined(), false);
h(objectEmulatingUndefined(), false);
h(createIsHTMLDDA(), false);
h(createIsHTMLDDA(), false);

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

@ -5,9 +5,9 @@ function t1(v)
return 0;
}
assertEq(t1(objectEmulatingUndefined()), 1);
assertEq(t1(objectEmulatingUndefined()), 1);
assertEq(t1(objectEmulatingUndefined()), 1);
assertEq(t1(createIsHTMLDDA()), 1);
assertEq(t1(createIsHTMLDDA()), 1);
assertEq(t1(createIsHTMLDDA()), 1);
function t2(v)
{
@ -19,6 +19,6 @@ function t2(v)
assertEq(t2(17), 0);
assertEq(t2(0), 1);
assertEq(t2(-0), 1);
assertEq(t2(objectEmulatingUndefined()), 1);
assertEq(t2(objectEmulatingUndefined()), 1);
assertEq(t2(objectEmulatingUndefined()), 1);
assertEq(t2(createIsHTMLDDA()), 1);
assertEq(t2(createIsHTMLDDA()), 1);
assertEq(t2(createIsHTMLDDA()), 1);

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

@ -6,7 +6,7 @@ function f(v1, v2, value)
}
var obj = {};
var emul = objectEmulatingUndefined();
var emul = createIsHTMLDDA();
f(obj, obj, true);
f(obj, obj, true);
@ -17,7 +17,7 @@ f(obj, emul, false);
f(Object.prototype, obj, false);
f(Object.prototype, obj, false);
f(emul, emul, true);
f(objectEmulatingUndefined(), emul, false);
f(objectEmulatingUndefined(), emul, false);
f(emul, objectEmulatingUndefined(), false);
f(emul, objectEmulatingUndefined(), false);
f(createIsHTMLDDA(), emul, false);
f(createIsHTMLDDA(), emul, false);
f(emul, createIsHTMLDDA(), false);
f(emul, createIsHTMLDDA(), false);

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

@ -6,7 +6,7 @@ function f(v1, v2, value)
}
var obj = {};
var emul = objectEmulatingUndefined();
var emul = createIsHTMLDDA();
f(obj, obj, false);
f(obj, obj, false);
@ -17,7 +17,7 @@ f(obj, emul, true);
f(Object.prototype, obj, true);
f(Object.prototype, obj, true);
f(emul, emul, false);
f(objectEmulatingUndefined(), emul, true);
f(objectEmulatingUndefined(), emul, true);
f(emul, objectEmulatingUndefined(), true);
f(emul, objectEmulatingUndefined(), true);
f(createIsHTMLDDA(), emul, true);
f(createIsHTMLDDA(), emul, true);
f(emul, createIsHTMLDDA(), true);
f(emul, createIsHTMLDDA(), true);

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

@ -11,8 +11,8 @@ f(null, true);
f(null, true);
f(undefined, false);
f(undefined, false);
f(objectEmulatingUndefined(), false);
f(objectEmulatingUndefined(), false);
f(createIsHTMLDDA(), false);
f(createIsHTMLDDA(), false);
f(Object.prototype, false);
f(Object.prototype, false);
@ -33,5 +33,5 @@ function h(v, value)
"failed: " + v + " " + value);
}
h(objectEmulatingUndefined(), false);
h(objectEmulatingUndefined(), false);
h(createIsHTMLDDA(), false);
h(createIsHTMLDDA(), false);

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

@ -11,8 +11,8 @@ f(null, false);
f(null, false);
f(undefined, true);
f(undefined, true);
f(objectEmulatingUndefined(), false);
f(objectEmulatingUndefined(), false);
f(createIsHTMLDDA(), false);
f(createIsHTMLDDA(), false);
f(Object.prototype, false);
f(Object.prototype, false);
@ -33,5 +33,5 @@ function h(v, value)
"failed: " + v + " " + value);
}
h(objectEmulatingUndefined(), false);
h(objectEmulatingUndefined(), false);
h(createIsHTMLDDA(), false);
h(createIsHTMLDDA(), false);

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

@ -11,8 +11,8 @@ f(null, false);
f(null, false);
f(undefined, true);
f(undefined, true);
f(objectEmulatingUndefined(), true);
f(objectEmulatingUndefined(), true);
f(createIsHTMLDDA(), true);
f(createIsHTMLDDA(), true);
f(Object.prototype, true);
f(Object.prototype, true);
@ -33,5 +33,5 @@ function h(v, value)
"failed: " + v + " " + value);
}
h(objectEmulatingUndefined(), true);
h(objectEmulatingUndefined(), true);
h(createIsHTMLDDA(), true);
h(createIsHTMLDDA(), true);

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

@ -11,8 +11,8 @@ f(null, true);
f(null, true);
f(undefined, false);
f(undefined, false);
f(objectEmulatingUndefined(), true);
f(objectEmulatingUndefined(), true);
f(createIsHTMLDDA(), true);
f(createIsHTMLDDA(), true);
f(Object.prototype, true);
f(Object.prototype, true);
@ -33,5 +33,5 @@ function h(v, value)
"failed: " + v + " " + value);
}
h(objectEmulatingUndefined(), true);
h(objectEmulatingUndefined(), true);
h(createIsHTMLDDA(), true);
h(createIsHTMLDDA(), true);

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

@ -3,9 +3,9 @@ function t1(v)
return typeof v;
}
assertEq(t1(objectEmulatingUndefined()), "undefined");
assertEq(t1(objectEmulatingUndefined()), "undefined");
assertEq(t1(objectEmulatingUndefined()), "undefined");
assertEq(t1(createIsHTMLDDA()), "undefined");
assertEq(t1(createIsHTMLDDA()), "undefined");
assertEq(t1(createIsHTMLDDA()), "undefined");
function t2(v)
{
@ -18,6 +18,6 @@ assertEq(t2(-0), "number");
assertEq(t2(function(){}), "function");
assertEq(t2({}), "object");
assertEq(t2(null), "object");
assertEq(t2(objectEmulatingUndefined()), "undefined");
assertEq(t2(objectEmulatingUndefined()), "undefined");
assertEq(t2(objectEmulatingUndefined()), "undefined");
assertEq(t2(createIsHTMLDDA()), "undefined");
assertEq(t2(createIsHTMLDDA()), "undefined");
assertEq(t2(createIsHTMLDDA()), "undefined");

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

@ -5148,16 +5148,46 @@ GetMaxArgs(JSContext* cx, unsigned argc, Value* vp)
}
static bool
ObjectEmulatingUndefined(JSContext* cx, unsigned argc, Value* vp)
IsHTMLDDA_Call(JSContext* cx, unsigned argc, Value* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
static const JSClass cls = {
"ObjectEmulatingUndefined",
JSCLASS_EMULATES_UNDEFINED
// These are the required conditions under which this object may be called
// by test262 tests, and the required behavior under those conditions.
if (args.length() == 0 ||
(args.length() == 1 && args[0].isString() && args[0].toString()->length() == 0))
{
args.rval().setNull();
return true;
}
JS_ReportErrorASCII(cx, "IsHTMLDDA object is being called in an impermissible manner");
return false;
}
static bool
CreateIsHTMLDDA(JSContext* cx, unsigned argc, Value* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
static const JSClassOps classOps = {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
IsHTMLDDA_Call,
};
RootedObject obj(cx, JS_NewObject(cx, &cls));
static const JSClass cls = {
"IsHTMLDDA",
JSCLASS_EMULATES_UNDEFINED,
&classOps,
};
JSObject* obj = JS_NewObject(cx, &cls);
if (!obj)
return false;
args.rval().setObject(*obj);
@ -6803,10 +6833,15 @@ static const JSFunctionSpecWithHelp shell_functions[] = {
"getMaxArgs()",
" Return the maximum number of supported args for a call."),
JS_FN_HELP("objectEmulatingUndefined", ObjectEmulatingUndefined, 0, 0,
"objectEmulatingUndefined()",
" Return a new object obj for which typeof obj === \"undefined\", obj == null\n"
" and obj == undefined (and vice versa for !=), and ToBoolean(obj) === false.\n"),
JS_FN_HELP("createIsHTMLDDA", CreateIsHTMLDDA, 0, 0,
"createIsHTMLDDA()",
" Return an object |obj| that \"looks like\" the |document.all| object in\n"
" browsers in certain ways: |typeof obj === \"undefined\"|, |obj == null|\n"
" and |obj == undefined| (vice versa for !=), |ToBoolean(obj) === false|,\n"
" and when called with no arguments or the single argument \"\" returns\n"
" null. (Calling |obj| any other way crashes or throws an exception.)\n"
" This function implements the exact requirements of the $262.IsHTMLDDA\n"
" property in test262."),
JS_FN_HELP("isCachingEnabled", IsCachingEnabled, 0, 0,
"isCachingEnabled()",

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

@ -3,10 +3,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// objectEmulatingUndefined is only available when running tests in the shell,
// createIsHTMLDDA is only available when running tests in the shell,
// not the browser
if (typeof objectEmulatingUndefined === "function") {
let nf = new Intl.NumberFormat('en-US', objectEmulatingUndefined());
if (typeof createIsHTMLDDA === "function") {
let nf = new Intl.NumberFormat('en-US', createIsHTMLDDA());
}
if (typeof reportCompare === "function")

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

@ -20,7 +20,7 @@ if (typeof Intl !== 'object' && typeof quit == 'function') {
* BEGIN TEST *
**************/
var opt = objectEmulatingUndefined();
var opt = createIsHTMLDDA();
opt.toString = function() { return "long"; };
var str = new Date(2013, 12 - 1, 14).toLocaleString("en-US", { weekday: opt });

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

@ -50,8 +50,8 @@ function testToObject() {
// Technically an embedding could have this as extension acting differently
// from ours, so a feature-test is inadequate. We can move this subtest
// into extensions/ if that ever matters.
if (typeof objectEmulatingUndefined === "function") {
var falsyObject = objectEmulatingUndefined();
if (typeof createIsHTMLDDA === "function") {
var falsyObject = createIsHTMLDDA();
falsyObject.foo = 7;
var obj = Object.assign({}, falsyObject);

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

@ -123,8 +123,8 @@ assertEq(Reflect.defineProperty(obj, "prop", {set: s}), true); // no-op
// Proxy defineProperty handler method that returns false
var falseValues = [false, 0, -0, "", NaN, null, undefined];
if (typeof objectEmulatingUndefined === "function")
falseValues.push(objectEmulatingUndefined());
if (typeof createIsHTMLDDA === "function")
falseValues.push(createIsHTMLDDA());
var value;
proxy = new Proxy({}, {
defineProperty(t, id, desc) {

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

@ -13,10 +13,21 @@
var setSharedArrayBuffer = global.setSharedArrayBuffer;
var getSharedArrayBuffer = global.getSharedArrayBuffer;
var evalInWorker = global.evalInWorker;
var hasCreateIsHTMLDDA = "createIsHTMLDDA" in global;
var hasThreads = ("helperThreadCount" in global ? global.helperThreadCount() > 0 : true);
var hasMailbox = typeof setSharedArrayBuffer == "function" && typeof getSharedArrayBuffer == "function";
var hasEvalInWorker = typeof evalInWorker == "function";
if (!hasCreateIsHTMLDDA && !("document" in global && "all" in global.document))
throw new Error("no [[IsHTMLDDA]] object available for testing");
var IsHTMLDDA = hasCreateIsHTMLDDA
? global.createIsHTMLDDA()
: global.document.all;
// The $262.agent framework is not appropriate for browsers yet, and some
// test cases can't work in browsers (they block the main thread).
@ -34,6 +45,7 @@
detachArrayBuffer: global.detachArrayBuffer,
evalScript: global.evaluateScript || global.evaluate,
global,
IsHTMLDDA,
agent: (function () {
// SpiderMonkey complication: With run-time argument --no-threads

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

@ -4,7 +4,7 @@ fuzzy-if(Android,4,12) == out-of-bounds-selectedindex.html out-of-bounds-selecte
== dynamic-boguskids.html boguskids-ref.html
== option-children.html option-children-ref.html
fuzzy(1,4) == padding-button-placement.html padding-button-placement-ref.html
HTTP(../..) == vertical-centering.html vertical-centering-ref.html
== vertical-centering.html vertical-centering-ref.html
== 997709-2.html 997709-2-ref.html
fuzzy-if(skiaContent,4,1) needs-focus == focusring-1.html focusring-1-ref.html
needs-focus == focusring-2.html focusring-2-ref.html

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

@ -259,14 +259,14 @@ fuzzy-if(d2d,1,400) == standalone--pct-pct--px-px.svg pass-pct-pct.xhtml
# We could certainly expand on these tests, but they provide reasonable base
# coverage.
HTTP(../..) == inline--display-block--01.xhtml inline--display-block--01-ref.xhtml
fuzzy-if(OSX,1,10) HTTP(../..) == inline--display-inline--01.xhtml inline--display-inline--01-ref.xhtml
HTTP(../..) == inline--display-inline-block--01.xhtml inline--display-inline-block--01-ref.xhtml
== inline--display-block--01.xhtml inline--display-block--01-ref.xhtml
fuzzy-if(OSX,1,10) == inline--display-inline--01.xhtml inline--display-inline--01-ref.xhtml
== inline--display-inline-block--01.xhtml inline--display-inline-block--01-ref.xhtml
== inline--float-left--01.xhtml inline--float-left--01-ref.xhtml
== inline--float-right--01.xhtml inline--float-right--01-ref.xhtml
== inline--position-absolute--01.xhtml inline--position-absolute--01-ref.xhtml
== inline--position-absolute--02.xhtml pass.svg
HTTP(../..) == inline--position-relative--01.xhtml inline--position-relative--01-ref.xhtml
== inline--position-relative--01.xhtml inline--position-relative--01-ref.xhtml
# Embedded by reference tests

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

@ -26,18 +26,18 @@ fuzzy-if(skiaContent,111,81) == simple-anchor-middle.svg simple-anchor-middle-re
== simple-fill-color-dynamic.svg simple-fill-color-dynamic-ref.svg
== simple-fill-color.svg simple-fill-color-ref.html
HTTP(../..) == simple-fill-gradient.svg simple-fill-gradient-ref.svg
== simple-fill-gradient.svg simple-fill-gradient-ref.svg
== simple-fill-none.svg simple.svg
== simple-pointer-events.svg simple.svg
== simple-multiple-dx.svg simple-multiple-dx-ref.html
== simple-multiple-dx-2.svg simple-multiple-dx.svg
== simple-multiple-dx-anchor-end-bidi.svg simple-multiple-dx-anchor-end-bidi-ref.svg
HTTP(../..) == simple-multiple-dx-anchor-middle-bidi.svg simple-multiple-dx-anchor-middle-bidi-ref.svg
== simple-multiple-dx-anchor-middle-bidi.svg simple-multiple-dx-anchor-middle-bidi-ref.svg
== simple-multiple-dx-anchor-end-rtl.svg simple-multiple-dx-anchor-end-rtl-ref.svg
== simple-multiple-dx-anchor-end.svg simple-multiple-dx-anchor-end-ref.svg
fuzzy-if(skiaContent,1,2) HTTP(../..) == simple-multiple-dx-anchor-middle-rtl.svg simple-multiple-dx-anchor-middle-rtl-ref.svg
HTTP(../..) == simple-multiple-dx-anchor-middle.svg simple-multiple-dx-anchor-middle-ref.svg
fuzzy-if(skiaContent,1,2) == simple-multiple-dx-anchor-middle-rtl.svg simple-multiple-dx-anchor-middle-rtl-ref.svg
== simple-multiple-dx-anchor-middle.svg simple-multiple-dx-anchor-middle-ref.svg
== simple-multiple-dx-bidi.svg simple-multiple-dx-bidi-ref.svg
== simple-multiple-dx-bidi-2.svg simple-multiple-dx-bidi.svg
== simple-multiple-dx-rtl.svg simple-multiple-dx-rtl-ref.svg
@ -45,7 +45,7 @@ HTTP(../..) == simple-multiple-dx-anchor-middle.svg simple-multiple-dx-anchor-mi
== simple-rtl.svg simple-rtl-ref.html
== simple-rtl-2.svg simple-rtl.svg
fails-if(webrender) HTTP(../..) == simple-transform-rotate.svg simple-transform-rotate-ref.svg
fails-if(webrender) == simple-transform-rotate.svg simple-transform-rotate-ref.svg
== multiple-x.svg multiple-x-ref.svg
== multiple-x-bidi.svg multiple-x-bidi-ref.svg
@ -171,20 +171,20 @@ fuzzy-if(!d2d,14,2) fuzzy-if(skiaContent,1,200) fails-if(webrender) == dynamic-n
== dynamic-text-shadow.svg text-shadow-ref.svg
# text and masks
fuzzy-if(skiaContent&&winWidget,50,224) HTTP(../..) == mask-applied.svg mask-applied-ref.svg
fuzzy-if(skiaContent&&winWidget,105,112) HTTP(../..) == mask-content.svg mask-content-ref.svg
fuzzy-if(skiaContent&&winWidget,53,112) HTTP(../..) == mask-content-2.svg mask-content-2-ref.svg
fuzzy-if(skiaContent&&winWidget,50,224) == mask-applied.svg mask-applied-ref.svg
fuzzy-if(skiaContent&&winWidget,105,112) == mask-content.svg mask-content-ref.svg
fuzzy-if(skiaContent&&winWidget,53,112) == mask-content-2.svg mask-content-2-ref.svg
# text and clipPaths
HTTP(../..) == clipPath-applied.svg clipPath-applied-ref.svg
fuzzy-if(skiaContent&&winWidget,105,56) HTTP(../..) == clipPath-content.svg clipPath-content-ref.svg
fuzzy-if(skiaContent&&winWidget,53,112) HTTP(../..) == clipPath-content-2.svg clipPath-content-2-ref.svg
== clipPath-applied.svg clipPath-applied-ref.svg
fuzzy-if(skiaContent&&winWidget,105,56) == clipPath-content.svg clipPath-content-ref.svg
fuzzy-if(skiaContent&&winWidget,53,112) == clipPath-content-2.svg clipPath-content-2-ref.svg
# text and patterns
fuzzy-if(cocoaWidget,1,6) fuzzy-if(skiaContent,65,313) fails-if(webrender) == pattern-content.svg pattern-content-ref.svg
# text and filters
fuzzy-if(skiaContent&&winWidget,126,336) HTTP(../..) == filter-applied.svg filter-applied-ref.svg
fuzzy-if(skiaContent&&winWidget,126,336) == filter-applied.svg filter-applied-ref.svg
# vertical text
fuzzy-if(skiaContent,1,80) == textpath-vertical-dx.svg textpath-vertical-dx-ref.svg

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

@ -63,16 +63,16 @@ fuzzy-if(skiaContent,1,90) == fixed-table-layout-023-vrl.html fixed-table-layout
== fixed-table-layout-030-vrl.html fixed-table-layout-025-ref.html
== fixed-table-layout-031-vrl.html fixed-table-layout-025-ref.html
HTTP(../..) == s72-border-spacing-002.xht s72-border-spacing-002-ref.xht
HTTP(../..) == s72-border-spacing-003.xht s72-border-spacing-002-ref.xht
HTTP(../..) == s72-border-spacing-004.xht s72-border-spacing-002-ref.xht
HTTP(../..) == s72-border-spacing-005.xht s72-border-spacing-002-ref.xht
fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) HTTP(../..) == wm-row-progression-002.xht multicol-count-002-ref.xht
fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) HTTP(../..) == wm-row-progression-003.xht multicol-count-002-ref.xht
fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) HTTP(../..) == wm-row-progression-004.xht multicol-count-002-ref.xht
fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) HTTP(../..) == wm-row-progression-005.xht multicol-count-002-ref.xht
fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) HTTP(../..) == wm-row-progression-006.xht multicol-count-002-ref.xht
fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) HTTP(../..) == wm-row-progression-007.xht multicol-count-002-ref.xht
== s72-border-spacing-002.xht s72-border-spacing-002-ref.xht
== s72-border-spacing-003.xht s72-border-spacing-002-ref.xht
== s72-border-spacing-004.xht s72-border-spacing-002-ref.xht
== s72-border-spacing-005.xht s72-border-spacing-002-ref.xht
fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) == wm-row-progression-002.xht multicol-count-002-ref.xht
fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) == wm-row-progression-003.xht multicol-count-002-ref.xht
fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) == wm-row-progression-004.xht multicol-count-002-ref.xht
fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) == wm-row-progression-005.xht multicol-count-002-ref.xht
fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) == wm-row-progression-006.xht multicol-count-002-ref.xht
fuzzy-if(winWidget,48,600) fuzzy-if(cocoaWidget,19,97) == wm-row-progression-007.xht multicol-count-002-ref.xht
fuzzy-if(Android,255,38) == table-caption-top-1.html table-caption-top-1-ref.html
fuzzy-if(Android,255,38) == table-caption-bottom-1.html table-caption-bottom-1-ref.html

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

@ -239,10 +239,10 @@ nsImageBoxFrame::UpdateImage()
nsIDocument* doc = mContent->GetComposedDoc();
if (doc) {
nsContentPolicyType contentPolicyType;
nsCOMPtr<nsIPrincipal> loadingPrincipal;
nsCOMPtr<nsIPrincipal> triggeringPrincipal;
uint64_t requestContextID = 0;
nsContentUtils::GetContentPolicyTypeForUIImageLoading(mContent,
getter_AddRefs(loadingPrincipal),
getter_AddRefs(triggeringPrincipal),
contentPolicyType,
&requestContextID);
@ -253,10 +253,14 @@ nsImageBoxFrame::UpdateImage()
doc,
baseURI);
if (uri) {
nsresult rv = nsContentUtils::LoadImage(uri, mContent, doc, loadingPrincipal, requestContextID,
doc->GetDocumentURI(), doc->GetReferrerPolicy(),
nsresult rv = nsContentUtils::LoadImage(uri, mContent, doc,
triggeringPrincipal,
requestContextID,
doc->GetDocumentURI(),
doc->GetReferrerPolicy(),
mListener, mLoadFlags,
EmptyString(), getter_AddRefs(mImageRequest),
EmptyString(),
getter_AddRefs(mImageRequest),
contentPolicyType);
if (NS_SUCCEEDED(rv) && mImageRequest) {

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

@ -862,6 +862,10 @@ pref("dom.serviceWorkers.enabled", true);
pref("dom.serviceWorkers.interception.enabled", true);
pref("dom.serviceWorkers.openWindow.enabled", true);
// Allow service workers to open windows for a longer period after a notification
// click on mobile. This is to account for some devices being quite slow.
pref("dom.serviceWorkers.disable_open_click_delay", 5000);
pref("dom.push.debug", false);
// The upstream autopush endpoint must have the Google API key corresponding to
// the App's sender ID; we bake this assumption directly into the URL.

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

@ -1279,7 +1279,9 @@ pref("dom.require_user_interaction_for_beforeunload", true);
pref("dom.disable_open_during_load", false);
pref("dom.popup_maximum", 20);
pref("dom.popup_allowed_events", "change click dblclick mouseup pointerup notificationclick reset submit touchend");
pref("dom.disable_open_click_delay", 1000);
pref("dom.serviceWorkers.disable_open_click_delay", 1000);
pref("dom.storage.enabled", true);
pref("dom.storage.default_quota", 5120);

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

@ -86,30 +86,26 @@ SetACookieNoHttp(nsICookieService *aCookieService, const char *aSpec, const char
EXPECT_TRUE(NS_SUCCEEDED(rv));
}
// returns true if cookie(s) for the given host were found; else false.
// the cookie string is returned via aCookie.
bool
GetACookie(nsICookieService *aCookieService, const char *aSpec1, const char *aSpec2, char **aCookie)
// The cookie string is returned via aCookie.
void
GetACookie(nsICookieService *aCookieService, const char *aSpec1, const char *aSpec2, nsACString& aCookie)
{
nsCOMPtr<nsIURI> uri1, uri2;
NS_NewURI(getter_AddRefs(uri1), aSpec1);
if (aSpec2)
NS_NewURI(getter_AddRefs(uri2), aSpec2);
Unused << aCookieService->GetCookieStringFromHttp(uri1, uri2, nullptr, aCookie);
return *aCookie != nullptr;
Unused << aCookieService->GetCookieStringFromHttp(uri1, uri2, nullptr, getter_Copies(aCookie));
}
// returns true if cookie(s) for the given host were found; else false.
// the cookie string is returned via aCookie.
bool
GetACookieNoHttp(nsICookieService *aCookieService, const char *aSpec, char **aCookie)
// The cookie string is returned via aCookie.
void
GetACookieNoHttp(nsICookieService *aCookieService, const char *aSpec, nsACString& aCookie)
{
nsCOMPtr<nsIURI> uri;
NS_NewURI(getter_AddRefs(uri), aSpec);
Unused << aCookieService->GetCookieString(uri, nullptr, aCookie);
return *aCookie != nullptr;
Unused << aCookieService->GetCookieString(uri, nullptr, getter_Copies(aCookie));
}
// some #defines for comparison rules
@ -203,20 +199,20 @@ TEST(TestCookie,TestCookieMain)
// test some basic variations of the domain & path
SetACookie(cookieService, "http://www.basic.com", nullptr, "test=basic", nullptr);
GetACookie(cookieService, "http://www.basic.com", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://www.basic.com", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=basic"));
GetACookie(cookieService, "http://www.basic.com/testPath/testfile.txt", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://www.basic.com/testPath/testfile.txt", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=basic"));
GetACookie(cookieService, "http://www.basic.com./", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://www.basic.com./", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
GetACookie(cookieService, "http://www.basic.com.", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://www.basic.com.", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
GetACookie(cookieService, "http://www.basic.com./testPath/testfile.txt", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://www.basic.com./testPath/testfile.txt", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
GetACookie(cookieService, "http://www.basic2.com/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://www.basic2.com/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
SetACookie(cookieService, "http://www.basic.com", nullptr, "test=basic; max-age=-1", nullptr);
GetACookie(cookieService, "http://www.basic.com/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://www.basic.com/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
// *** domain tests
@ -224,54 +220,54 @@ TEST(TestCookie,TestCookieMain)
// test some variations of the domain & path, for different domains of
// a domain cookie
SetACookie(cookieService, "http://www.domain.com", nullptr, "test=domain; domain=domain.com", nullptr);
GetACookie(cookieService, "http://domain.com", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://domain.com", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=domain"));
GetACookie(cookieService, "http://domain.com.", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://domain.com.", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
GetACookie(cookieService, "http://www.domain.com", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://www.domain.com", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=domain"));
GetACookie(cookieService, "http://foo.domain.com", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://foo.domain.com", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=domain"));
SetACookie(cookieService, "http://www.domain.com", nullptr, "test=domain; domain=domain.com; max-age=-1", nullptr);
GetACookie(cookieService, "http://domain.com", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://domain.com", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
SetACookie(cookieService, "http://www.domain.com", nullptr, "test=domain; domain=.domain.com", nullptr);
GetACookie(cookieService, "http://domain.com", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://domain.com", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=domain"));
GetACookie(cookieService, "http://www.domain.com", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://www.domain.com", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=domain"));
GetACookie(cookieService, "http://bah.domain.com", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://bah.domain.com", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=domain"));
SetACookie(cookieService, "http://www.domain.com", nullptr, "test=domain; domain=.domain.com; max-age=-1", nullptr);
GetACookie(cookieService, "http://domain.com", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://domain.com", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
SetACookie(cookieService, "http://www.domain.com", nullptr, "test=domain; domain=.foo.domain.com", nullptr);
GetACookie(cookieService, "http://foo.domain.com", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://foo.domain.com", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
SetACookie(cookieService, "http://www.domain.com", nullptr, "test=domain; domain=moose.com", nullptr);
GetACookie(cookieService, "http://foo.domain.com", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://foo.domain.com", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
SetACookie(cookieService, "http://www.domain.com", nullptr, "test=domain; domain=domain.com.", nullptr);
GetACookie(cookieService, "http://foo.domain.com", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://foo.domain.com", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
SetACookie(cookieService, "http://www.domain.com", nullptr, "test=domain; domain=..domain.com", nullptr);
GetACookie(cookieService, "http://foo.domain.com", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://foo.domain.com", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
SetACookie(cookieService, "http://www.domain.com", nullptr, "test=domain; domain=..domain.com.", nullptr);
GetACookie(cookieService, "http://foo.domain.com", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://foo.domain.com", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
SetACookie(cookieService, "http://path.net/path/file", nullptr, R"(test=taco; path="/bogus")", nullptr);
GetACookie(cookieService, "http://path.net/path/file", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://path.net/path/file", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=taco"));
SetACookie(cookieService, "http://path.net/path/file", nullptr, "test=taco; max-age=-1", nullptr);
GetACookie(cookieService, "http://path.net/path/file", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://path.net/path/file", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
// *** path tests
@ -279,67 +275,67 @@ TEST(TestCookie,TestCookieMain)
// test some variations of the domain & path, for different paths of
// a path cookie
SetACookie(cookieService, "http://path.net/path/file", nullptr, "test=path; path=/path", nullptr);
GetACookie(cookieService, "http://path.net/path", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://path.net/path", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=path"));
GetACookie(cookieService, "http://path.net/path/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://path.net/path/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=path"));
GetACookie(cookieService, "http://path.net/path/hithere.foo", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://path.net/path/hithere.foo", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=path"));
GetACookie(cookieService, "http://path.net/path?hithere/foo", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://path.net/path?hithere/foo", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=path"));
GetACookie(cookieService, "http://path.net/path2", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://path.net/path2", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
GetACookie(cookieService, "http://path.net/path2/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://path.net/path2/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
SetACookie(cookieService, "http://path.net/path/file", nullptr, "test=path; path=/path; max-age=-1", nullptr);
GetACookie(cookieService, "http://path.net/path/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://path.net/path/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
SetACookie(cookieService, "http://path.net/path/file", nullptr, "test=path; path=/path/", nullptr);
GetACookie(cookieService, "http://path.net/path", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://path.net/path", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=path"));
GetACookie(cookieService, "http://path.net/path/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://path.net/path/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=path"));
SetACookie(cookieService, "http://path.net/path/file", nullptr, "test=path; path=/path/; max-age=-1", nullptr);
GetACookie(cookieService, "http://path.net/path/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://path.net/path/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
// note that a site can set a cookie for a path it's not on.
// this is an intentional deviation from spec (see comments in
// nsCookieService::CheckPath()), so we test this functionality too
SetACookie(cookieService, "http://path.net/path/file", nullptr, "test=path; path=/foo/", nullptr);
GetACookie(cookieService, "http://path.net/path", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://path.net/path", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
GetACookie(cookieService, "http://path.net/foo", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://path.net/foo", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=path"));
SetACookie(cookieService, "http://path.net/path/file", nullptr, "test=path; path=/foo/; max-age=-1", nullptr);
GetACookie(cookieService, "http://path.net/foo/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://path.net/foo/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
// bug 373228: make sure cookies with paths longer than 1024 bytes,
// and cookies with paths or names containing tabs, are rejected.
// the following cookie has a path > 1024 bytes explicitly specified in the cookie
SetACookie(cookieService, "http://path.net/", nullptr, "test=path; path=/1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/", nullptr);
GetACookie(cookieService, "http://path.net/1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://path.net/1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
// the following cookie has a path > 1024 bytes implicitly specified by the uri path
SetACookie(cookieService, "http://path.net/1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/", nullptr, "test=path", nullptr);
GetACookie(cookieService, "http://path.net/1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://path.net/1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
// the following cookie includes a tab in the path
SetACookie(cookieService, "http://path.net/", nullptr, "test=path; path=/foo\tbar/", nullptr);
GetACookie(cookieService, "http://path.net/foo\tbar/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://path.net/foo\tbar/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
// the following cookie includes a tab in the name
SetACookie(cookieService, "http://path.net/", nullptr, "test\ttabs=tab", nullptr);
GetACookie(cookieService, "http://path.net/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://path.net/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
// the following cookie includes a tab in the value - allowed
SetACookie(cookieService, "http://path.net/", nullptr, "test=tab\ttest", nullptr);
GetACookie(cookieService, "http://path.net/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://path.net/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=tab\ttest"));
SetACookie(cookieService, "http://path.net/", nullptr, "test=tab\ttest; max-age=-1", nullptr);
GetACookie(cookieService, "http://path.net/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://path.net/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
@ -349,53 +345,53 @@ TEST(TestCookie,TestCookieMain)
// test some variations of the expiry time,
// and test deletion of previously set cookies
SetACookie(cookieService, "http://expireme.org/", nullptr, "test=expiry; max-age=-1", nullptr);
GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
SetACookie(cookieService, "http://expireme.org/", nullptr, "test=expiry; max-age=0", nullptr);
GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
SetACookie(cookieService, "http://expireme.org/", nullptr, "test=expiry; expires=bad", nullptr);
GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=expiry"));
SetACookie(cookieService, "http://expireme.org/", nullptr, "test=expiry; expires=Thu, 10 Apr 1980 16:33:12 GMT", nullptr);
GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
SetACookie(cookieService, "http://expireme.org/", nullptr, R"(test=expiry; expires="Thu, 10 Apr 1980 16:33:12 GMT)", nullptr);
GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
SetACookie(cookieService, "http://expireme.org/", nullptr, R"(test=expiry; expires="Thu, 10 Apr 1980 16:33:12 GMT")", nullptr);
GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
SetACookie(cookieService, "http://expireme.org/", nullptr, "test=expiry; max-age=60", nullptr);
GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=expiry"));
SetACookie(cookieService, "http://expireme.org/", nullptr, "test=expiry; max-age=-20", nullptr);
GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
SetACookie(cookieService, "http://expireme.org/", nullptr, "test=expiry; max-age=60", nullptr);
GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=expiry"));
SetACookie(cookieService, "http://expireme.org/", nullptr, "test=expiry; expires=Thu, 10 Apr 1980 16:33:12 GMT", nullptr);
GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
SetACookie(cookieService, "http://expireme.org/", nullptr, "test=expiry; max-age=60", nullptr);
SetACookie(cookieService, "http://expireme.org/", nullptr, "newtest=expiry; max-age=60", nullptr);
GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "test=expiry"));
EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "newtest=expiry"));
SetACookie(cookieService, "http://expireme.org/", nullptr, "test=differentvalue; max-age=0", nullptr);
GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "newtest=expiry"));
SetACookie(cookieService, "http://expireme.org/", nullptr, "newtest=evendifferentvalue; max-age=0", nullptr);
GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
SetACookie(cookieService, "http://foo.expireme.org/", nullptr, "test=expiry; domain=.expireme.org; max-age=60", nullptr);
GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=expiry"));
SetACookie(cookieService, "http://bar.expireme.org/", nullptr, "test=differentvalue; domain=.expireme.org; max-age=0", nullptr);
GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
nsAutoCString ServerTime;
@ -403,22 +399,22 @@ TEST(TestCookie,TestCookieMain)
SetTime(-OFFSET_ONE_WEEK, ServerTime, CookieString, true);
SetACookie(cookieService, "http://expireme.org/", nullptr, CookieString.get(), ServerTime.get());
GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
// Set server time earlier than client time for one year + one day, and expirty time earlier than server time for one day.
SetTime(-(OFFSET_ONE_DAY + OFFSET_ONE_WEEK), ServerTime, CookieString, false);
SetACookie(cookieService, "http://expireme.org/", nullptr, CookieString.get(), ServerTime.get());
GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
// Set server time later than client time for one year, and expiry time later than server time for one day.
SetTime(OFFSET_ONE_WEEK, ServerTime, CookieString, false);
SetACookie(cookieService, "http://expireme.org/", nullptr, CookieString.get(), ServerTime.get());
GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=expiry"));
// Set server time later than client time for one year + one day, and expiry time earlier than server time for one day.
SetTime((OFFSET_ONE_DAY + OFFSET_ONE_WEEK), ServerTime, CookieString, true);
SetACookie(cookieService, "http://expireme.org/", nullptr, CookieString.get(), ServerTime.get());
GetACookie(cookieService, "http://expireme.org/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://expireme.org/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=expiry"));
// *** multiple cookie tests
@ -426,7 +422,7 @@ TEST(TestCookie,TestCookieMain)
// test the setting of multiple cookies, and test the order of precedence
// (a later cookie overwriting an earlier one, in the same header string)
SetACookie(cookieService, "http://multiple.cookies/", nullptr, "test=multiple; domain=.multiple.cookies \n test=different \n test=same; domain=.multiple.cookies \n newtest=ciao \n newtest=foo; max-age=-6 \n newtest=reincarnated", nullptr);
GetACookie(cookieService, "http://multiple.cookies/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://multiple.cookies/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_NOT_CONTAIN, "test=multiple"));
EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "test=different"));
EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "test=same"));
@ -434,13 +430,13 @@ TEST(TestCookie,TestCookieMain)
EXPECT_TRUE(CheckResult(cookie.get(), MUST_NOT_CONTAIN, "newtest=foo"));
EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "newtest=reincarnated"));
SetACookie(cookieService, "http://multiple.cookies/", nullptr, "test=expiry; domain=.multiple.cookies; max-age=0", nullptr);
GetACookie(cookieService, "http://multiple.cookies/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://multiple.cookies/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_NOT_CONTAIN, "test=same"));
SetACookie(cookieService, "http://multiple.cookies/", nullptr, "\n test=different; max-age=0 \n", nullptr);
GetACookie(cookieService, "http://multiple.cookies/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://multiple.cookies/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_NOT_CONTAIN, "test=different"));
SetACookie(cookieService, "http://multiple.cookies/", nullptr, "newtest=dead; max-age=0", nullptr);
GetACookie(cookieService, "http://multiple.cookies/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://multiple.cookies/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
@ -448,33 +444,33 @@ TEST(TestCookie,TestCookieMain)
// test the cookie header parser, under various circumstances.
SetACookie(cookieService, "http://parser.test/", nullptr, "test=parser; domain=.parser.test; ;; ;=; ,,, ===,abc,=; abracadabra! max-age=20;=;;", nullptr);
GetACookie(cookieService, "http://parser.test/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://parser.test/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=parser"));
SetACookie(cookieService, "http://parser.test/", nullptr, "test=parser; domain=.parser.test; max-age=0", nullptr);
GetACookie(cookieService, "http://parser.test/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://parser.test/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
SetACookie(cookieService, "http://parser.test/", nullptr, "test=\"fubar! = foo;bar\\\";\" parser; domain=.parser.test; max-age=6\nfive; max-age=2.63,", nullptr);
GetACookie(cookieService, "http://parser.test/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://parser.test/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, R"(test="fubar! = foo)"));
EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "five"));
SetACookie(cookieService, "http://parser.test/", nullptr, "test=kill; domain=.parser.test; max-age=0 \n five; max-age=0", nullptr);
GetACookie(cookieService, "http://parser.test/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://parser.test/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
// test the handling of VALUE-only cookies (see bug 169091),
// i.e. "six" should assume an empty NAME, which allows other VALUE-only
// cookies to overwrite it
SetACookie(cookieService, "http://parser.test/", nullptr, "six", nullptr);
GetACookie(cookieService, "http://parser.test/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://parser.test/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "six"));
SetACookie(cookieService, "http://parser.test/", nullptr, "seven", nullptr);
GetACookie(cookieService, "http://parser.test/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://parser.test/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "seven"));
SetACookie(cookieService, "http://parser.test/", nullptr, " =eight", nullptr);
GetACookie(cookieService, "http://parser.test/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://parser.test/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "eight"));
SetACookie(cookieService, "http://parser.test/", nullptr, "test=six", nullptr);
GetACookie(cookieService, "http://parser.test/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://parser.test/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "test=six"));
// *** path ordering tests
@ -486,7 +482,7 @@ TEST(TestCookie,TestCookieMain)
SetACookie(cookieService, "http://multi.path.tests/one/two/three/four/five/", nullptr, "test6=path", nullptr);
SetACookie(cookieService, "http://multi.path.tests/one/two/three/four/five/six/", nullptr, "test7=path; path=", nullptr);
SetACookie(cookieService, "http://multi.path.tests/", nullptr, "test8=path; path=/", nullptr);
GetACookie(cookieService, "http://multi.path.tests/one/two/three/four/five/six/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://multi.path.tests/one/two/three/four/five/six/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test7=path; test6=path; test3=path; test1=path; test5=path; test4=path; test2=path; test8=path"));
@ -494,41 +490,41 @@ TEST(TestCookie,TestCookieMain)
// Since this cookie is NOT set via http, setting it fails
SetACookieNoHttp(cookieService, "http://httponly.test/", "test=httponly; httponly");
GetACookie(cookieService, "http://httponly.test/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://httponly.test/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
// Since this cookie is set via http, it can be retrieved
SetACookie(cookieService, "http://httponly.test/", nullptr, "test=httponly; httponly", nullptr);
GetACookie(cookieService, "http://httponly.test/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://httponly.test/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=httponly"));
// ... but not by web content
GetACookieNoHttp(cookieService, "http://httponly.test/", getter_Copies(cookie));
GetACookieNoHttp(cookieService, "http://httponly.test/", cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
// Non-Http cookies should not replace HttpOnly cookies
SetACookie(cookieService, "http://httponly.test/", nullptr, "test=httponly; httponly", nullptr);
SetACookieNoHttp(cookieService, "http://httponly.test/", "test=not-httponly");
GetACookie(cookieService, "http://httponly.test/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://httponly.test/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=httponly"));
// ... and, if an HttpOnly cookie already exists, should not be set at all
GetACookieNoHttp(cookieService, "http://httponly.test/", getter_Copies(cookie));
GetACookieNoHttp(cookieService, "http://httponly.test/", cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
// Non-Http cookies should not delete HttpOnly cookies
SetACookie(cookieService, "http://httponly.test/", nullptr, "test=httponly; httponly", nullptr);
SetACookieNoHttp(cookieService, "http://httponly.test/", "test=httponly; max-age=-1");
GetACookie(cookieService, "http://httponly.test/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://httponly.test/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=httponly"));
// ... but HttpOnly cookies should
SetACookie(cookieService, "http://httponly.test/", nullptr, "test=httponly; httponly; max-age=-1", nullptr);
GetACookie(cookieService, "http://httponly.test/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://httponly.test/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
// Non-Httponly cookies can replace HttpOnly cookies when set over http
SetACookie(cookieService, "http://httponly.test/", nullptr, "test=httponly; httponly", nullptr);
SetACookie(cookieService, "http://httponly.test/", nullptr, "test=not-httponly", nullptr);
GetACookieNoHttp(cookieService, "http://httponly.test/", getter_Copies(cookie));
GetACookieNoHttp(cookieService, "http://httponly.test/", cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=not-httponly"));
// scripts should not be able to set httponly cookies by replacing an existing non-httponly cookie
SetACookie(cookieService, "http://httponly.test/", nullptr, "test=not-httponly", nullptr);
SetACookieNoHttp(cookieService, "http://httponly.test/", "test=httponly; httponly");
GetACookieNoHttp(cookieService, "http://httponly.test/", getter_Copies(cookie));
GetACookieNoHttp(cookieService, "http://httponly.test/", cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=not-httponly"));
// *** Cookie prefix tests
@ -538,24 +534,24 @@ TEST(TestCookie,TestCookieMain)
SetACookie(cookieService, "http://prefixed.test/", nullptr, "__Secure-test2=test; secure", nullptr);
SetACookie(cookieService, "http://prefixed.test/", nullptr, "__Host-test1=test", nullptr);
SetACookie(cookieService, "http://prefixed.test/", nullptr, "__Host-test2=test; secure", nullptr);
GetACookie(cookieService, "http://prefixed.test/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://prefixed.test/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
// prefixed cookies won't be set without the secure flag
SetACookie(cookieService, "https://prefixed.test/", nullptr, "__Secure-test=test", nullptr);
SetACookie(cookieService, "https://prefixed.test/", nullptr, "__Host-test=test", nullptr);
GetACookie(cookieService, "https://prefixed.test/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "https://prefixed.test/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
// prefixed cookies can be set when done correctly
SetACookie(cookieService, "https://prefixed.test/", nullptr, "__Secure-test=test; secure", nullptr);
SetACookie(cookieService, "https://prefixed.test/", nullptr, "__Host-test=test; secure", nullptr);
GetACookie(cookieService, "https://prefixed.test/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "https://prefixed.test/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "__Secure-test=test"));
EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "__Host-test=test"));
// but when set must not be returned to the host insecurely
GetACookie(cookieService, "http://prefixed.test/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://prefixed.test/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
// Host-prefixed cookies cannot specify a domain
@ -563,14 +559,14 @@ TEST(TestCookie,TestCookieMain)
SetACookie(cookieService, "https://host.prefixed.test/", nullptr, "__Host-b=test; secure; domain=.prefixed.test", nullptr);
SetACookie(cookieService, "https://host.prefixed.test/", nullptr, "__Host-c=test; secure; domain=host.prefixed.test", nullptr);
SetACookie(cookieService, "https://host.prefixed.test/", nullptr, "__Host-d=test; secure; domain=.host.prefixed.test", nullptr);
GetACookie(cookieService, "https://host.prefixed.test/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "https://host.prefixed.test/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
// Host-prefixed cookies can only have a path of "/"
SetACookie(cookieService, "https://host.prefixed.test/some/path", nullptr, "__Host-e=test; secure", nullptr);
SetACookie(cookieService, "https://host.prefixed.test/some/path", nullptr, "__Host-f=test; secure; path=/", nullptr);
SetACookie(cookieService, "https://host.prefixed.test/some/path", nullptr, "__Host-g=test; secure; path=/some", nullptr);
GetACookie(cookieService, "https://host.prefixed.test/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "https://host.prefixed.test/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "__Host-f=test"));
// *** leave-secure-alone tests
@ -578,40 +574,40 @@ TEST(TestCookie,TestCookieMain)
// testing items 0 & 1 for 3.1 of spec Deprecate modification of secure
// cookies from non-secure origins
SetACookie(cookieService, "http://www.security.test/", nullptr, "test=non-security; secure", nullptr);
GetACookieNoHttp(cookieService, "https://www.security.test/", getter_Copies(cookie));
GetACookieNoHttp(cookieService, "https://www.security.test/", cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));
SetACookie(cookieService, "https://www.security.test/path/", nullptr, "test=security; secure; path=/path/", nullptr);
GetACookieNoHttp(cookieService, "https://www.security.test/path/", getter_Copies(cookie));
GetACookieNoHttp(cookieService, "https://www.security.test/path/", cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=security"));
// testing items 2 & 3 & 4 for 3.2 of spec Deprecate modification of secure
// cookies from non-secure origins
// Secure site can modify cookie value
SetACookie(cookieService, "https://www.security.test/path/", nullptr, "test=security2; secure; path=/path/", nullptr);
GetACookieNoHttp(cookieService, "https://www.security.test/path/", getter_Copies(cookie));
GetACookieNoHttp(cookieService, "https://www.security.test/path/", cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=security2"));
// If new cookie contains same name, same host and partially matching path with
// an existing security cookie on non-security site, it can't modify an existing
// security cookie.
SetACookie(cookieService, "http://www.security.test/path/foo/", nullptr, "test=non-security; path=/path/foo", nullptr);
GetACookieNoHttp(cookieService, "https://www.security.test/path/foo/", getter_Copies(cookie));
GetACookieNoHttp(cookieService, "https://www.security.test/path/foo/", cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=security2"));
// Non-secure cookie can set by same name, same host and non-matching path.
SetACookie(cookieService, "http://www.security.test/bar/", nullptr, "test=non-security; path=/bar", nullptr);
GetACookieNoHttp(cookieService, "http://www.security.test/bar/", getter_Copies(cookie));
GetACookieNoHttp(cookieService, "http://www.security.test/bar/", cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test=non-security"));
// Modify value and downgrade secure level.
SetACookie(cookieService, "https://www.security.test/", nullptr, "test_modify_cookie=security-cookie; secure; domain=.security.test", nullptr);
GetACookieNoHttp(cookieService, "https://www.security.test/", getter_Copies(cookie));
GetACookieNoHttp(cookieService, "https://www.security.test/", cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test_modify_cookie=security-cookie"));
SetACookie(cookieService, "https://www.security.test/", nullptr, "test_modify_cookie=non-security-cookie; domain=.security.test", nullptr);
GetACookieNoHttp(cookieService, "https://www.security.test/", getter_Copies(cookie));
GetACookieNoHttp(cookieService, "https://www.security.test/", cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, "test_modify_cookie=non-security-cookie"));
// Test the non-security cookie can set when domain or path not same to secure cookie of same name.
SetACookie(cookieService, "https://www.security.test/", nullptr, "test=security3", nullptr);
GetACookieNoHttp(cookieService, "http://www.security.test/", getter_Copies(cookie));
GetACookieNoHttp(cookieService, "http://www.security.test/", cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "test=security3"));
SetACookie(cookieService, "http://www.security.test/", nullptr, "test=non-security2; domain=security.test", nullptr);
GetACookieNoHttp(cookieService, "http://www.security.test/", getter_Copies(cookie));
GetACookieNoHttp(cookieService, "http://www.security.test/", cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "test=non-security2"));
// *** nsICookieManager{2} interface tests
@ -679,9 +675,9 @@ TEST(TestCookie,TestCookieMain)
}
EXPECT_EQ(i, 3);
// check the httpOnly attribute of the second cookie is honored
GetACookie(cookieService, "http://cookiemgr.test/foo/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://cookiemgr.test/foo/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_CONTAIN, "test2=yes"));
GetACookieNoHttp(cookieService, "http://cookiemgr.test/foo/", getter_Copies(cookie));
GetACookieNoHttp(cookieService, "http://cookiemgr.test/foo/", cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_NOT_CONTAIN, "test2=yes"));
// check CountCookiesFromHost()
uint32_t hostCookies = 0;
@ -746,7 +742,7 @@ TEST(TestCookie,TestCookieMain)
expected += NS_LITERAL_CSTRING("; ");
}
}
GetACookie(cookieService, "http://creation.ordering.tests/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://creation.ordering.tests/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_EQUAL, expected.get()));
// *** eviction and creation ordering tests after enable network.cookie.leave-secure-alone
@ -767,7 +763,7 @@ TEST(TestCookie,TestCookieMain)
SetACookie(cookieService, "http://creation.ordering.tests/", nullptr, name.get(), nullptr);
}
}
GetACookie(cookieService, "http://creation.ordering.tests/", nullptr, getter_Copies(cookie));
GetACookie(cookieService, "http://creation.ordering.tests/", nullptr, cookie);
EXPECT_TRUE(CheckResult(cookie.get(), MUST_BE_NULL));

0
testing/mozharness/scripts/release/updates.py Normal file → Executable file
Просмотреть файл

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

@ -161,10 +161,13 @@ function updateDescriptionSecondStepTouchActionElement(target, scrollReturnInter
document.getElementById('desc').innerHTML = "Test Description: Try to scroll element RIGHT moving your outside of the red border";
}
function updateDescriptionThirdStepTouchActionElement(target, scrollReturnInterval) {
function updateDescriptionThirdStepTouchActionElement(target, scrollReturnInterval, callback = null) {
window.setTimeout(function() {
objectScroller(target, 'left', 0);}
, scrollReturnInterval);
objectScroller(target, 'left', 0);
if (callback) {
callback();
}
}, scrollReturnInterval);
document.getElementById('desc').innerHTML = "Test Description: Try to scroll element DOWN then RIGHT starting your touch inside of the element. Then tap complete button";
}

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

@ -88,10 +88,11 @@
if(xScrollIsReceived && yScrollIsReceived) {
test_touchaction_div.done();
updateDescriptionThirdStepTouchActionElement(target0, scrollReturnInterval);
setTimeout(function() {
isFirstPart = false;
}, 2 * scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
updateDescriptionThirdStepTouchActionElement(target0, scrollReturnInterval, function () {
setTimeout(function() {
isFirstPart = false;
}, scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
});
}
}
else {

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

@ -91,14 +91,15 @@
if(xScrollIsReceived && yScrollIsReceived) {
test_touchaction_div.done();
updateDescriptionThirdStepTouchActionElement(target0, scrollReturnInterval);
setTimeout(function() {
isFirstPart = false;
xScr0 = target0.scrollLeft;
xScr0 = target0.scrollLeft;
xScrollIsReceived = false;
yScrollIsReceived = false;
}, 2 * scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
updateDescriptionThirdStepTouchActionElement(target0, scrollReturnInterval, function () {
setTimeout(function() {
isFirstPart = false;
xScr0 = target0.scrollLeft;
xScr0 = target0.scrollLeft;
xScrollIsReceived = false;
yScrollIsReceived = false;
}, scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
});
}
}
});

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

@ -103,10 +103,11 @@
if(xScrollIsReceived && yScrollIsReceived) {
test_touchaction_row.done();
updateDescriptionThirdStepTable(target0, scrollReturnInterval);
setTimeout(function() {
isFirstPart = false;
}, 2 * scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
updateDescriptionThirdStepTable(target0, scrollReturnInterval, function() {
setTimeout(function() {
isFirstPart = false;
}, scrollReturnInterval); // avoid immediate triggering while scroll is still being performed
});
}
}
else {
@ -123,9 +124,12 @@
document.getElementById('desc').innerHTML = "Test Description: Try to scroll element RIGHT staring your touch over the Row 1";
}
function updateDescriptionThirdStepTable(target, scrollReturnInterval) {
function updateDescriptionThirdStepTable(target, scrollReturnInterval, callback = null) {
window.setTimeout(function() {
objectScroller(target, 'left', 0);
if (callback) {
callback();
}
}
, scrollReturnInterval);
document.getElementById('desc').innerHTML = "Test Description: Try to scroll element DOWN then RIGHT starting your touch inside of the Cell 3";

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

@ -454,10 +454,8 @@ nsCommandLine::Init(int32_t argc, const char* const* argv, nsIFile* aWorkingDir,
continue;
}
#endif
#ifdef XP_UNIX
if (*curarg == '-' &&
*(curarg+1) == '-') {
++curarg;
if (*curarg == '-') {
if (*(curarg+1) == '-') ++curarg;
char* dup = PL_strdup(curarg);
if (!dup) return NS_ERROR_OUT_OF_MEMORY;
@ -473,7 +471,6 @@ nsCommandLine::Init(int32_t argc, const char* const* argv, nsIFile* aWorkingDir,
PL_strfree(dup);
continue;
}
#endif
appendArg(curarg);
}

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

@ -220,17 +220,19 @@ var Settings = {
* Updates the button & text at the top of the page to reflect Telemetry state.
*/
render() {
let homeExplanation = document.getElementById("home-explanation");
let fhrEnabled = Preferences.get(this.SETTINGS[0].pref, this.SETTINGS[0].defaultPrefValue);
fhrEnabled = bundle.GetStringFromName(fhrEnabled ? "telemetryEnabled" : "telemetryDisabled");
let extendedEnabled = Preferences.get(this.SETTINGS[1].pref, this.SETTINGS[1].defaultPrefValue);
extendedEnabled = bundle.GetStringFromName(extendedEnabled ? "extendedTelemetryEnabled" : "extendedTelemetryDisabled");
let parameters = [fhrEnabled, extendedEnabled].map(this.convertStringToLink);
let settingsExplanation = document.getElementById("settings-explanation");
let uploadEnabled = this.getStatusStringForSetting(this.SETTINGS[0]);
let extendedEnabled = Services.telemetry.canRecordExtended;
let collectedData = bundle.GetStringFromName(extendedEnabled ? "prereleaseData" : "releaseData");
let explanation = bundle.formatStringFromName("homeExplanation", parameters, 2);
let parameters = [
collectedData,
this.convertStringToLink(uploadEnabled),
];
let explanation = bundle.formatStringFromName("settingsExplanation", parameters, 2);
// eslint-disable-next-line no-unsanitized/property
homeExplanation.innerHTML = explanation;
settingsExplanation.innerHTML = explanation;
this.attachObservers();
},

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

@ -145,7 +145,7 @@
<section id="home-section" class="active">
<p id="page-subtitle"></p>
<p id="home-explanation"></p>
<p id="settings-explanation"></p>
<p id="ping-explanation"></p>
<p>&aboutTelemetry.moreInformations;</p>
<ul>

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

@ -214,7 +214,7 @@
<content>
<xul:hbox class="menu-iconic-left" align="center" pack="center"
xbl:inherits="selected,_moz-menuactive,disabled,checked">
<xul:image class="menu-iconic-icon" xbl:inherits="src=image,loadingprincipal=iconloadingprincipal,validate,src"/>
<xul:image class="menu-iconic-icon" xbl:inherits="src=image,triggeringprincipal=iconloadingprincipal,validate,src"/>
</xul:hbox>
<xul:label class="menu-iconic-text" flex="1" xbl:inherits="value=label,accesskey,crop,highlightable" crop="right"/>
<xul:label class="menu-iconic-highlightable-text" xbl:inherits="xbl:text=label,crop,accesskey,highlightable" crop="right"/>

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

@ -7,14 +7,14 @@
# - %2$S is replaced by brandFullName
pageSubtitle = This page shows the information about performance, hardware, usage and customizations collected by Telemetry. This information is submitted to %1$S to help improve %2$S.
# LOCALIZATION NOTE(homeExplanation):
# - %1$S is either telemetryEnabled or telemetryDisabled
# - %2$S is either extendedTelemetryEnabled or extendedTelemetryDisabled
homeExplanation = Telemetry is %1$S and extended telemetry is %2$S.
# LOCALIZATION NOTE(settingsExplanation):
# - %1$S is either releaseData or prereleaseData
# - %2$S is either telemetryEnabled or telemetryDisabled
settingsExplanation = Telemetry is collecting %1$S and upload is %2$S.
releaseData = release data
prereleaseData = pre-release data
telemetryEnabled = enabled
telemetryDisabled = disabled
extendedTelemetryEnabled = enabled
extendedTelemetryDisabled = disabled
# LOCALIZATION NOTE(pingDetails):
# - %1$S is replaced by a link with pingExplanationLink as text

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

@ -56,7 +56,7 @@ protected:
nsresult OnFrameComplete(imgIRequest* aRequest);
nsCOMPtr<nsIContent> mContent;
nsCOMPtr<nsIPrincipal> mLoadingPrincipal;
nsCOMPtr<nsIPrincipal> mTriggeringPrincipal;
nsContentPolicyType mContentType;
RefPtr<imgRequestProxy> mIconRequest;
nsMenuObjectX* mMenuObject; // [weak]

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

@ -58,7 +58,7 @@ nsMenuItemIconX::nsMenuItemIconX(nsMenuObjectX* aMenuItem,
nsIContent* aContent,
NSMenuItem* aNativeMenuItem)
: mContent(aContent)
, mLoadingPrincipal(aContent->NodePrincipal())
, mTriggeringPrincipal(aContent->NodePrincipal())
, mContentType(nsIContentPolicy::TYPE_INTERNAL_IMAGE)
, mMenuObject(aMenuItem)
, mLoadedIcon(false)
@ -213,7 +213,7 @@ nsMenuItemIconX::GetIconURI(nsIURI** aIconURI)
} else {
uint64_t dummy = 0;
nsContentUtils::GetContentPolicyTypeForUIImageLoading(mContent,
getter_AddRefs(mLoadingPrincipal),
getter_AddRefs(mTriggeringPrincipal),
mContentType,
&dummy);
}
@ -318,7 +318,7 @@ nsMenuItemIconX::LoadIcon(nsIURI* aIconURI)
nsresult rv = loader->LoadImage(aIconURI, nullptr, nullptr,
mozilla::net::RP_Unset,
mLoadingPrincipal, 0, loadGroup, this,
mTriggeringPrincipal, 0, loadGroup, this,
mContent, document, nsIRequest::LOAD_NORMAL, nullptr,
mContentType, EmptyString(),
/* aUseUrgentStartForChannel */ false,

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

@ -10,6 +10,17 @@
namespace mozilla {
/*static*/ InputEventStatistics&
InputEventStatistics::Get()
{
static UniquePtr<InputEventStatistics> sInstance;
if (!sInstance) {
sInstance = MakeUnique<InputEventStatistics>(ConstructorCookie());
ClearOnShutdown(&sInstance);
}
return *sInstance;
}
TimeDuration
InputEventStatistics::TimeDurationCircularBuffer::GetMean()
{

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

@ -79,15 +79,7 @@ public:
{
}
static InputEventStatistics& Get()
{
static UniquePtr<InputEventStatistics> sInstance;
if (!sInstance) {
sInstance = MakeUnique<InputEventStatistics>(ConstructorCookie());
ClearOnShutdown(&sInstance);
}
return *sInstance;
}
static InputEventStatistics& Get();
void UpdateInputDuration(TimeDuration aDuration)
{