mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge last green changeset of mozilla-inbound to mozilla-central
This commit is contained in:
commit
fb741abc43
@ -96,7 +96,7 @@
|
||||
this.invoke = function removeTextData_invoke()
|
||||
{
|
||||
var tree = {
|
||||
role: ROLE_SECTION,
|
||||
role: ROLE_PARAGRAPH,
|
||||
children: [
|
||||
{
|
||||
role: ROLE_TEXT_LEAF,
|
||||
@ -112,7 +112,7 @@
|
||||
this.finalCheck = function removeTextData_finalCheck()
|
||||
{
|
||||
var tree = {
|
||||
role: ROLE_SECTION,
|
||||
role: ROLE_PARAGRAPH,
|
||||
children: []
|
||||
};
|
||||
testAccessibleTree(this.containerNode, tree);
|
||||
@ -147,7 +147,8 @@
|
||||
gQueue.push(new setOnClickNRoleAttrs("span"));
|
||||
|
||||
// text data removal of text node should remove its text accessible
|
||||
gQueue.push(new removeTextData("container2"));
|
||||
gQueue.push(new removeTextData("p"));
|
||||
gQueue.push(new removeTextData("pre"));
|
||||
|
||||
gQueue.invoke(); // SimpleTest.finish() will be called in the end
|
||||
}
|
||||
@ -168,6 +169,11 @@
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=625652">
|
||||
Mozilla Bug 625652
|
||||
</a>
|
||||
<a target="_blank"
|
||||
title="Remove text accesible getting no text inside a preformatted area"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=706335">
|
||||
Mozilla Bug 706335
|
||||
</a>
|
||||
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
@ -179,7 +185,8 @@
|
||||
<span id="span">span</span>
|
||||
</div>
|
||||
|
||||
<div id="container2">text</div>
|
||||
<p id="p">text</p>
|
||||
<pre id="pre">text</pre>
|
||||
|
||||
<div id="eventdump"></div>
|
||||
</body>
|
||||
|
@ -1,6 +1,7 @@
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
var frame = document.getElementById("customizeToolbarSheetIFrame");
|
||||
frame.addEventListener("load", testCustomizeFrameLoadedPre, true);
|
||||
|
||||
|
@ -99,4 +99,5 @@ function test() {
|
||||
});
|
||||
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ function test() {
|
||||
let cm = Cc["@mozilla.org/cookiemanager;1"].
|
||||
getService(Ci.nsICookieManager);
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
const TEST_URL = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/title.sjs";
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
let blankState = { windows: [{ tabs: [{ entries: [{ url: "about:blank" }] }]}]};
|
||||
let crashState = { windows: [{ tabs: [{ entries: [{ url: "about:mozilla" }] }]}]};
|
||||
|
@ -44,6 +44,7 @@ function observeOneRestore(callback) {
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
// There should be one tab when we start the test
|
||||
let [origTab] = gBrowser.visibleTabs;
|
||||
|
@ -52,6 +52,7 @@ function cleanup() {
|
||||
function test() {
|
||||
/** Bug 607016 - If a tab is never restored, attributes (eg. hidden) aren't updated correctly **/
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
// Set the pref to true so we know exactly how many tabs should be restoring at
|
||||
// any given time. This guarantees that a finishing load won't start another.
|
||||
|
@ -5,6 +5,7 @@
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
let doc;
|
||||
let objectNode;
|
||||
|
@ -127,6 +127,7 @@ function finishInspectorTests()
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", function() {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
@ -111,6 +111,7 @@ function inspectorRuleTrap()
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
tab1 = gBrowser.addTab();
|
||||
gBrowser.selectedTab = tab1;
|
||||
|
@ -4,6 +4,7 @@
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
let doc;
|
||||
let nodes;
|
||||
|
@ -218,6 +218,7 @@ function finishInspectorTests()
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", function() {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
@ -213,6 +213,7 @@ function finishUp() {
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", function() {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
@ -137,6 +137,7 @@ function ruleViewOpened2()
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
tab1 = gBrowser.addTab();
|
||||
gBrowser.selectedTab = tab1;
|
||||
|
@ -263,6 +263,7 @@ function inspectorTabUnload1(evt)
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
tab1 = gBrowser.addTab();
|
||||
gBrowser.selectedTab = tab1;
|
||||
|
@ -105,6 +105,7 @@ function finishUp() {
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", function() {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
@ -14,6 +14,7 @@ Cu.import("resource:///modules/devtools/CssHtmlTree.jsm");
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("load", tabLoaded, true);
|
||||
}
|
||||
|
@ -79,6 +79,7 @@ function finishUp()
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", function(evt) {
|
||||
gBrowser.selectedBrowser.removeEventListener(evt.type, arguments.callee, true);
|
||||
|
@ -43,6 +43,7 @@
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-error.html";
|
||||
|
||||
function test() {
|
||||
expectUncaughtException();
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("load", onLoad, true);
|
||||
}
|
||||
|
@ -44,6 +44,7 @@
|
||||
const TEST_DUPLICATE_ERROR_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-duplicate-error.html";
|
||||
|
||||
function test() {
|
||||
expectUncaughtException();
|
||||
addTab(TEST_DUPLICATE_ERROR_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testDuplicateErrors, false);
|
||||
}
|
||||
@ -57,6 +58,7 @@ function testDuplicateErrors() {
|
||||
|
||||
Services.console.registerListener(consoleObserver);
|
||||
|
||||
expectUncaughtException();
|
||||
content.location.reload();
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,7 @@ function contentLoaded(aEvent) {
|
||||
browser.removeEventListener("load", contentLoaded, true);
|
||||
|
||||
let button = content.document.querySelector("button");
|
||||
expectUncaughtException();
|
||||
EventUtils.sendMouseEvent({ type: "click" }, button, content);
|
||||
executeSoon(buttonClicked);
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ function tabLoaded(aEvent) {
|
||||
HUDService.activateHUDForContext(gBrowser.selectedTab);
|
||||
|
||||
gBrowser.selectedBrowser.addEventListener("load", tabReloaded, true);
|
||||
expectUncaughtException();
|
||||
content.location.reload();
|
||||
}
|
||||
|
||||
@ -43,6 +44,7 @@ function tabReloaded(aEvent) {
|
||||
|
||||
newTabIsOpen = true;
|
||||
gBrowser.selectedBrowser.addEventListener("load", tabLoaded, true);
|
||||
expectUncaughtException();
|
||||
content.location = TEST_URI;
|
||||
});
|
||||
}
|
||||
@ -53,6 +55,7 @@ function testEnd() {
|
||||
}
|
||||
|
||||
function test() {
|
||||
expectUncaughtException();
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("load", tabLoaded, true);
|
||||
}
|
||||
|
@ -64,6 +64,7 @@ function test()
|
||||
browser.removeEventListener(aEvent.type, arguments.callee, true);
|
||||
executeSoon(onContentLoaded);
|
||||
}, true);
|
||||
expectUncaughtException();
|
||||
content.location = TEST_URI;
|
||||
}, true);
|
||||
}
|
||||
|
@ -90,6 +90,7 @@ function test()
|
||||
registerCleanupFunction(testEnd);
|
||||
|
||||
executeSoon(function() {
|
||||
expectUncaughtException();
|
||||
content.location = TEST_URI;
|
||||
});
|
||||
}, true);
|
||||
|
@ -25,6 +25,7 @@ function onLoad(aEvent) {
|
||||
|
||||
gHudId = HUDService.getHudIdByWindow(content);
|
||||
browser.addEventListener("load", testWebDevLimits, true);
|
||||
expectUncaughtException();
|
||||
content.location = TEST_URI;
|
||||
}
|
||||
|
||||
@ -70,6 +71,7 @@ function testJsLimits(aEvent) {
|
||||
for (let i = 0; i < 11; i++) {
|
||||
var script = content.document.createElement("script");
|
||||
script.text = "fubar" + i + ".bogus(6);";
|
||||
expectUncaughtException();
|
||||
head.insertBefore(script, head.firstChild);
|
||||
}
|
||||
|
||||
|
@ -417,7 +417,10 @@ function testGen() {
|
||||
networkPanel = HUDService.openNetworkPanel(filterBox, httpActivity);
|
||||
networkPanel.isDoneCallback = function NP_doneCallback() {
|
||||
networkPanel.isDoneCallback = null;
|
||||
testDriver.next();
|
||||
try {
|
||||
testDriver.next();
|
||||
} catch (e if e instanceof StopIteration) {
|
||||
}
|
||||
}
|
||||
|
||||
yield;
|
||||
@ -478,5 +481,5 @@ function testGen() {
|
||||
networkPanel.panel.hidePopup(); */
|
||||
|
||||
// All done!
|
||||
finishTest();
|
||||
finish();
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-error.html";
|
||||
|
||||
function test() {
|
||||
expectUncaughtException();
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testViewSource, false);
|
||||
}
|
||||
|
@ -1314,24 +1314,24 @@ xpicleanup@BIN_SUFFIX@
|
||||
js3250.dll
|
||||
plugins/npnul32.dll
|
||||
#if _MSC_VER != 1400
|
||||
@BINPATH@/Microsoft.VC80.CRT.manifest
|
||||
@BINPATH@/msvcm80.dll
|
||||
@BINPATH@/msvcp80.dll
|
||||
@BINPATH@/msvcr80.dll
|
||||
Microsoft.VC80.CRT.manifest
|
||||
msvcm80.dll
|
||||
msvcp80.dll
|
||||
msvcr80.dll
|
||||
#endif
|
||||
#if _MSC_VER != 1500
|
||||
@BINPATH@/Microsoft.VC90.CRT.manifest
|
||||
@BINPATH@/msvcm90.dll
|
||||
@BINPATH@/msvcp90.dll
|
||||
@BINPATH@/msvcr90.dll
|
||||
Microsoft.VC90.CRT.manifest
|
||||
msvcm90.dll
|
||||
msvcp90.dll
|
||||
msvcr90.dll
|
||||
#endif
|
||||
#if _MSC_VER != 1600
|
||||
@BINPATH@/msvcp100.dll
|
||||
@BINPATH@/msvcr100.dll
|
||||
msvcp100.dll
|
||||
msvcr100.dll
|
||||
#endif
|
||||
#if _MSC_VER != 1700
|
||||
@BINPATH@/msvcp110.dll
|
||||
@BINPATH@/msvcr110.dll
|
||||
msvcp110.dll
|
||||
msvcr110.dll
|
||||
#endif
|
||||
mozcrt19.dll
|
||||
mozcpp19.dll
|
||||
|
@ -225,8 +225,7 @@ ContentParent::Init()
|
||||
nsCOMPtr<nsIThreadInternal>
|
||||
threadInt(do_QueryInterface(NS_GetCurrentThread()));
|
||||
if (threadInt) {
|
||||
threadInt->GetObserver(getter_AddRefs(mOldObserver));
|
||||
threadInt->SetObserver(this);
|
||||
threadInt->AddObserver(this);
|
||||
}
|
||||
if (obs) {
|
||||
obs->NotifyObservers(static_cast<nsIObserver*>(this), "ipc:content-created", nsnull);
|
||||
@ -344,7 +343,7 @@ ContentParent::ActorDestroy(ActorDestroyReason why)
|
||||
nsCOMPtr<nsIThreadInternal>
|
||||
threadInt(do_QueryInterface(NS_GetCurrentThread()));
|
||||
if (threadInt)
|
||||
threadInt->SetObserver(mOldObserver);
|
||||
threadInt->RemoveObserver(this);
|
||||
if (mRunToCompletionDepth)
|
||||
mRunToCompletionDepth = 0;
|
||||
|
||||
@ -1118,11 +1117,9 @@ ContentParent::RecvLoadURIExternal(const IPC::URI& uri)
|
||||
/* void onDispatchedEvent (in nsIThreadInternal thread); */
|
||||
NS_IMETHODIMP
|
||||
ContentParent::OnDispatchedEvent(nsIThreadInternal *thread)
|
||||
{
|
||||
if (mOldObserver)
|
||||
return mOldObserver->OnDispatchedEvent(thread);
|
||||
|
||||
return NS_OK;
|
||||
{
|
||||
NS_NOTREACHED("OnDispatchedEvent unimplemented");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* void onProcessNextEvent (in nsIThreadInternal thread, in boolean mayWait, in unsigned long recursionDepth); */
|
||||
@ -1134,9 +1131,6 @@ ContentParent::OnProcessNextEvent(nsIThreadInternal *thread,
|
||||
if (mRunToCompletionDepth)
|
||||
++mRunToCompletionDepth;
|
||||
|
||||
if (mOldObserver)
|
||||
return mOldObserver->OnProcessNextEvent(thread, mayWait, recursionDepth);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1156,9 +1150,6 @@ ContentParent::AfterProcessNextEvent(nsIThreadInternal *thread,
|
||||
}
|
||||
}
|
||||
|
||||
if (mOldObserver)
|
||||
return mOldObserver->AfterProcessNextEvent(thread, recursionDepth);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -235,7 +235,6 @@ private:
|
||||
PRInt32 mGeolocationWatchID;
|
||||
int mRunToCompletionDepth;
|
||||
bool mShouldCallUnblockChild;
|
||||
nsCOMPtr<nsIThreadObserver> mOldObserver;
|
||||
|
||||
// This is a cache of all of the memory reporters
|
||||
// registered in the child process. To update this, one
|
||||
|
@ -73,6 +73,7 @@ using mozilla::dom::StorageChild;
|
||||
#include "nsNetCID.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
||||
// calls FlushAndDeleteTemporaryTables(false)
|
||||
#define NS_DOMSTORAGE_FLUSH_TIMER_TOPIC "domstorage-flush-timer"
|
||||
@ -1601,6 +1602,40 @@ nsDOMStorage::GetItem(const nsAString& aKey, nsAString &aData)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static Telemetry::ID
|
||||
TelemetryIDForKey(nsPIDOMStorage::nsDOMStorageType type)
|
||||
{
|
||||
switch (type) {
|
||||
default:
|
||||
MOZ_ASSERT(false);
|
||||
// We need to return something to satisfy the compiler.
|
||||
// Fallthrough.
|
||||
case nsPIDOMStorage::GlobalStorage:
|
||||
return Telemetry::GLOBALDOMSTORAGE_KEY_SIZE_BYTES;
|
||||
case nsPIDOMStorage::LocalStorage:
|
||||
return Telemetry::LOCALDOMSTORAGE_KEY_SIZE_BYTES;
|
||||
case nsPIDOMStorage::SessionStorage:
|
||||
return Telemetry::SESSIONDOMSTORAGE_KEY_SIZE_BYTES;
|
||||
}
|
||||
}
|
||||
|
||||
static Telemetry::ID
|
||||
TelemetryIDForValue(nsPIDOMStorage::nsDOMStorageType type)
|
||||
{
|
||||
switch (type) {
|
||||
default:
|
||||
MOZ_ASSERT(false);
|
||||
// We need to return something to satisfy the compiler.
|
||||
// Fallthrough.
|
||||
case nsPIDOMStorage::GlobalStorage:
|
||||
return Telemetry::GLOBALDOMSTORAGE_VALUE_SIZE_BYTES;
|
||||
case nsPIDOMStorage::LocalStorage:
|
||||
return Telemetry::LOCALDOMSTORAGE_VALUE_SIZE_BYTES;
|
||||
case nsPIDOMStorage::SessionStorage:
|
||||
return Telemetry::SESSIONDOMSTORAGE_VALUE_SIZE_BYTES;
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMStorage::GetItem(const nsAString& aKey, nsIDOMStorageItem **aItem)
|
||||
{
|
||||
@ -1617,6 +1652,9 @@ nsDOMStorage::SetItem(const nsAString& aKey, const nsAString& aData)
|
||||
if (!CacheStoragePermissions())
|
||||
return NS_ERROR_DOM_SECURITY_ERR;
|
||||
|
||||
Telemetry::Accumulate(TelemetryIDForKey(mStorageType), aKey.Length());
|
||||
Telemetry::Accumulate(TelemetryIDForValue(mStorageType), aData.Length());
|
||||
|
||||
nsString oldValue;
|
||||
nsresult rv = mStorageImpl->SetValue(IsCallerSecure(), aKey, aData, oldValue);
|
||||
if (NS_FAILED(rv))
|
||||
|
@ -13,15 +13,34 @@ function run_test()
|
||||
testURI(Services.io.newURI("moz-safe-about:rights", null, null));
|
||||
}
|
||||
|
||||
function sum(a)
|
||||
{
|
||||
return a.reduce(function(prev, current, index, array) {
|
||||
return prev + current;
|
||||
});
|
||||
}
|
||||
|
||||
function testURI(aURI)
|
||||
{
|
||||
print("Testing: " + aURI.spec);
|
||||
let storage = getStorageForURI(aURI);
|
||||
let Telemetry = Components.classes["@mozilla.org/base/telemetry;1"].
|
||||
getService(Components.interfaces.nsITelemetry);
|
||||
let key_histogram = Telemetry.getHistogramById("LOCALDOMSTORAGE_KEY_SIZE_BYTES");
|
||||
let value_histogram = Telemetry.getHistogramById("LOCALDOMSTORAGE_VALUE_SIZE_BYTES");
|
||||
let before_key_snapshot = key_histogram.snapshot();
|
||||
let before_value_snapshot = value_histogram.snapshot();
|
||||
storage.setItem("test-item", "test-value");
|
||||
print("Check that our value has been correctly stored.");
|
||||
let after_key_snapshot = key_histogram.snapshot();
|
||||
let after_value_snapshot = value_histogram.snapshot();
|
||||
do_check_eq(storage.length, 1);
|
||||
do_check_eq(storage.key(0), "test-item");
|
||||
do_check_eq(storage.getItem("test-item"), "test-value");
|
||||
do_check_eq(sum(after_key_snapshot.counts),
|
||||
sum(before_key_snapshot.counts)+1);
|
||||
do_check_eq(sum(after_value_snapshot.counts),
|
||||
sum(before_value_snapshot.counts)+1);
|
||||
|
||||
print("Check that our value is correctly removed.");
|
||||
storage.removeItem("test-item");
|
||||
|
@ -2498,14 +2498,16 @@ GLContext::SetBlitFramebufferForDestTexture(GLuint aTexture)
|
||||
aTexture,
|
||||
0);
|
||||
|
||||
if (aTexture && (fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER) !=
|
||||
LOCAL_GL_FRAMEBUFFER_COMPLETE)) {
|
||||
|
||||
GLenum result = fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER);
|
||||
if (aTexture && (result != LOCAL_GL_FRAMEBUFFER_COMPLETE)) {
|
||||
nsCAutoString msg;
|
||||
msg.Append("Framebuffer not complete -- error 0x");
|
||||
msg.AppendInt(result, 16);
|
||||
// Note: if you are hitting this, it is likely that
|
||||
// your texture is not texture complete -- that is, you
|
||||
// allocated a texture name, but didn't actually define its
|
||||
// size via a call to TexImage2D.
|
||||
NS_RUNTIMEABORT("Error setting up framebuffer --- framebuffer not complete!");
|
||||
NS_RUNTIMEABORT(msg.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1000,9 +1000,12 @@ LayerManagerOGL::SetupBackBuffer(int aWidth, int aHeight)
|
||||
mBackBufferTexture,
|
||||
0);
|
||||
|
||||
if (mGLContext->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER) !=
|
||||
LOCAL_GL_FRAMEBUFFER_COMPLETE) {
|
||||
NS_RUNTIMEABORT("Error setting up framebuffer --- framebuffer not complete");
|
||||
GLenum result = mGLContext->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER);
|
||||
if (result != LOCAL_GL_FRAMEBUFFER_COMPLETE) {
|
||||
nsCAutoString msg;
|
||||
msg.Append("Framebuffer not complete -- error 0x");
|
||||
msg.AppendInt(result, 16);
|
||||
NS_RUNTIMEABORT(msg.get());
|
||||
}
|
||||
|
||||
mBackBufferSize.width = aWidth;
|
||||
@ -1161,9 +1164,12 @@ LayerManagerOGL::CreateFBOWithTexture(const nsIntRect& aRect, InitMode aInit,
|
||||
|
||||
// Making this call to fCheckFramebufferStatus prevents a crash on
|
||||
// PowerVR. See bug 695246.
|
||||
if (mGLContext->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER) !=
|
||||
LOCAL_GL_FRAMEBUFFER_COMPLETE) {
|
||||
NS_RUNTIMEABORT("Error setting up framebuffer --- framebuffer not complete");
|
||||
GLenum result = mGLContext->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER);
|
||||
if (result != LOCAL_GL_FRAMEBUFFER_COMPLETE) {
|
||||
nsCAutoString msg;
|
||||
msg.Append("Framebuffer not complete -- error 0x");
|
||||
msg.AppendInt(result, 16);
|
||||
NS_RUNTIMEABORT(msg.get());
|
||||
}
|
||||
|
||||
SetupPipeline(aRect.width, aRect.height, DontApplyWorldTransform);
|
||||
|
@ -187,6 +187,7 @@ function nextTest() {
|
||||
}
|
||||
|
||||
function test() {
|
||||
ignoreAllUncaughtExceptions();
|
||||
nextTest();
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,6 @@
|
||||
#include "jswatchpoint.h"
|
||||
#include "jswrapper.h"
|
||||
#include "assembler/wtf/Platform.h"
|
||||
#include "assembler/jit/ExecutableAllocator.h"
|
||||
#include "yarr/BumpPointerAllocator.h"
|
||||
#include "methodjit/MethodJIT.h"
|
||||
#include "methodjit/PolyIC.h"
|
||||
|
@ -112,7 +112,7 @@ throwpoline_exit:
|
||||
JaegerInterpolineScripted:
|
||||
ld [%l0 + 0x10], %l0 /* Load f->prev_ */
|
||||
st %l0, [%fp - 36] /* Update f->regs->fp_ */
|
||||
ba JaegerInterpoline
|
||||
ba interpoline_enter
|
||||
nop
|
||||
.size JaegerInterpolineScripted, . - JaegerInterpolineScripted
|
||||
|
||||
@ -120,6 +120,7 @@ JaegerInterpolineScripted:
|
||||
.global JaegerInterpoline
|
||||
.type JaegerInterpoline, #function
|
||||
JaegerInterpoline:
|
||||
interpoline_enter:
|
||||
mov %o0,%o2
|
||||
mov %l3,%o0
|
||||
mov %l2,%o1
|
||||
|
@ -7084,6 +7084,34 @@ nsTextFrame::Reflow(nsPresContext* aPresContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
/**
|
||||
* Notifies accessibility about text reflow. Used by nsTextFrame::ReflowText.
|
||||
*/
|
||||
class NS_STACK_CLASS ReflowTextA11yNotifier
|
||||
{
|
||||
public:
|
||||
ReflowTextA11yNotifier(nsPresContext* aPresContext, nsIContent* aContent) :
|
||||
mPresContext(aPresContext), mContent(aContent)
|
||||
{
|
||||
}
|
||||
~ReflowTextA11yNotifier()
|
||||
{
|
||||
nsAccessibilityService* accService = nsIPresShell::AccService();
|
||||
if (accService) {
|
||||
accService->UpdateText(mPresContext->PresShell(), mContent);
|
||||
}
|
||||
}
|
||||
private:
|
||||
ReflowTextA11yNotifier();
|
||||
ReflowTextA11yNotifier(const ReflowTextA11yNotifier&);
|
||||
ReflowTextA11yNotifier& operator =(const ReflowTextA11yNotifier&);
|
||||
|
||||
nsIContent* mContent;
|
||||
nsPresContext* mPresContext;
|
||||
};
|
||||
#endif
|
||||
|
||||
void
|
||||
nsTextFrame::ReflowText(nsLineLayout& aLineLayout, nscoord aAvailableWidth,
|
||||
nsRenderingContext* aRenderingContext,
|
||||
@ -7098,6 +7126,11 @@ nsTextFrame::ReflowText(nsLineLayout& aLineLayout, nscoord aAvailableWidth,
|
||||
|
||||
nsPresContext* presContext = PresContext();
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
// Schedule the update of accessible tree since rendered text might be changed.
|
||||
ReflowTextA11yNotifier(presContext, mContent);
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// Set up flags and clear out state
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
@ -7608,14 +7641,6 @@ nsTextFrame::ReflowText(nsLineLayout& aLineLayout, nscoord aAvailableWidth,
|
||||
aMetrics.width, aMetrics.height, aMetrics.ascent,
|
||||
aStatus);
|
||||
#endif
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
// Schedule the update of accessible tree when rendered text might be changed.
|
||||
nsAccessibilityService* accService = nsIPresShell::AccService();
|
||||
if (accService) {
|
||||
accService->UpdateText(presContext->PresShell(), mContent);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* virtual */ bool
|
||||
|
@ -7,7 +7,7 @@ function test() {
|
||||
aEvent.stopPropagation();
|
||||
}
|
||||
|
||||
let onPopupShowing = function (aEvent)
|
||||
let onPopupShown = function (aEvent)
|
||||
{
|
||||
is(aEvent.originalTarget.localName, "tooltip", "tooltip is showing");
|
||||
|
||||
@ -29,7 +29,7 @@ function test() {
|
||||
doc.removeEventListener("mouseleave", doStopPropagation, true);
|
||||
doc.removeEventListener("mouseover", doStopPropagation, true);
|
||||
doc.removeEventListener("mouseout", doStopPropagation, true);
|
||||
document.removeEventListener("popupshowing", onPopupShowing, true);
|
||||
document.removeEventListener("popupshown", onPopupShown, true);
|
||||
document.removeEventListener("popuphiding", onPopupHiding, true);
|
||||
|
||||
gBrowser.removeCurrentTab();
|
||||
@ -50,7 +50,7 @@ function test() {
|
||||
doc.addEventListener("mouseleave", doStopPropagation, true);
|
||||
doc.addEventListener("mouseover", doStopPropagation, true);
|
||||
doc.addEventListener("mouseout", doStopPropagation, true);
|
||||
document.addEventListener("popupshown", onPopupShowing, true);
|
||||
document.addEventListener("popupshown", onPopupShown, true);
|
||||
document.addEventListener("popuphiding", onPopupHiding, true);
|
||||
|
||||
EventUtils.synthesizeMouseAtCenter(p1, { type: "mousemove" }, win);
|
||||
|
@ -210,6 +210,10 @@ Tester.prototype = {
|
||||
}
|
||||
};
|
||||
|
||||
if (this.SimpleTest.isExpectingUncaughtException()) {
|
||||
this.currentTest.addResult(new testResult(false, "expectUncaughtException was called but no uncaught exception was detected!", "", false));
|
||||
}
|
||||
|
||||
// Clear document.popupNode. The test could have set it to a custom value
|
||||
// for its own purposes, nulling it out it will go back to the default
|
||||
// behavior of returning the last opened popup.
|
||||
@ -250,6 +254,8 @@ Tester.prototype = {
|
||||
execTest: function Tester_execTest() {
|
||||
this.dumper.dump("TEST-START | " + this.currentTest.path + "\n");
|
||||
|
||||
this.SimpleTest.reset();
|
||||
|
||||
// Load the tests into a testscope
|
||||
this.currentTest.scope = new testScope(this, this.currentTest);
|
||||
|
||||
@ -259,7 +265,7 @@ Tester.prototype = {
|
||||
this.currentTest.scope.gTestPath = this.currentTest.path;
|
||||
|
||||
// Override SimpleTest methods with ours.
|
||||
["ok", "is", "isnot", "todo", "todo_is", "todo_isnot"].forEach(function(m) {
|
||||
["ok", "is", "isnot", "todo", "todo_is", "todo_isnot", "info"].forEach(function(m) {
|
||||
this.SimpleTest[m] = this[m];
|
||||
}, this.currentTest.scope);
|
||||
|
||||
@ -296,7 +302,13 @@ Tester.prototype = {
|
||||
this.currentTest.scope.test();
|
||||
}
|
||||
} catch (ex) {
|
||||
this.currentTest.addResult(new testResult(false, "Exception thrown", ex, false));
|
||||
var isExpected = !!this.SimpleTest.isExpectingUncaughtException();
|
||||
if (!this.SimpleTest.isIgnoringAllUncaughtExceptions()) {
|
||||
this.currentTest.addResult(new testResult(isExpected, "Exception thrown", ex, false));
|
||||
this.SimpleTest.expectUncaughtException(false);
|
||||
} else {
|
||||
this.currentTest.addResult(new testMessage("Exception thrown: " + ex));
|
||||
}
|
||||
this.currentTest.scope.finish();
|
||||
}
|
||||
|
||||
@ -379,12 +391,11 @@ function testMessage(aName) {
|
||||
// cannot conflict with global variables used in tests.
|
||||
function testScope(aTester, aTest) {
|
||||
this.__tester = aTester;
|
||||
this.__browserTest = aTest;
|
||||
|
||||
var self = this;
|
||||
this.ok = function test_ok(condition, name, diag, stack) {
|
||||
self.__browserTest.addResult(new testResult(condition, name, diag, false,
|
||||
stack ? stack : Components.stack.caller));
|
||||
aTest.addResult(new testResult(condition, name, diag, false,
|
||||
stack ? stack : Components.stack.caller));
|
||||
};
|
||||
this.is = function test_is(a, b, name) {
|
||||
self.ok(a == b, name, "Got " + a + ", expected " + b, false,
|
||||
@ -395,8 +406,8 @@ function testScope(aTester, aTest) {
|
||||
Components.stack.caller);
|
||||
};
|
||||
this.todo = function test_todo(condition, name, diag, stack) {
|
||||
self.__browserTest.addResult(new testResult(!condition, name, diag, true,
|
||||
stack ? stack : Components.stack.caller));
|
||||
aTest.addResult(new testResult(!condition, name, diag, true,
|
||||
stack ? stack : Components.stack.caller));
|
||||
};
|
||||
this.todo_is = function test_todo_is(a, b, name) {
|
||||
self.todo(a == b, name, "Got " + a + ", expected " + b,
|
||||
@ -407,7 +418,7 @@ function testScope(aTester, aTest) {
|
||||
Components.stack.caller);
|
||||
};
|
||||
this.info = function test_info(name) {
|
||||
self.__browserTest.addResult(new testMessage(name));
|
||||
aTest.addResult(new testMessage(name));
|
||||
};
|
||||
|
||||
this.executeSoon = function test_executeSoon(func) {
|
||||
@ -438,7 +449,13 @@ function testScope(aTester, aTest) {
|
||||
// StopIteration means test is finished.
|
||||
self.finish();
|
||||
} catch (ex) {
|
||||
aTest.addResult(new testResult(false, "Exception thrown", ex, false));
|
||||
var isExpected = !!self.SimpleTest.isExpectingUncaughtException();
|
||||
if (!self.SimpleTest.isIgnoringAllUncaughtExceptions()) {
|
||||
aTest.addResult(new testResult(isExpected, "Exception thrown", ex, false));
|
||||
self.SimpleTest.expectUncaughtException(false);
|
||||
} else {
|
||||
aTest.addResult(new testMessage("Exception thrown: " + ex));
|
||||
}
|
||||
self.finish();
|
||||
}
|
||||
};
|
||||
@ -467,19 +484,16 @@ function testScope(aTester, aTest) {
|
||||
self.SimpleTest.copyToProfile(filename);
|
||||
};
|
||||
|
||||
this.expectUncaughtException = function test_expectUncaughtException() {
|
||||
self.SimpleTest.expectUncaughtException();
|
||||
this.expectUncaughtException = function test_expectUncaughtException(aExpecting) {
|
||||
self.SimpleTest.expectUncaughtException(aExpecting);
|
||||
};
|
||||
|
||||
this.ignoreAllUncaughtExceptions = function test_ignoreAllUncaughtExceptions() {
|
||||
self.SimpleTest.ignoreAllUncaughtExceptions();
|
||||
this.ignoreAllUncaughtExceptions = function test_ignoreAllUncaughtExceptions(aIgnoring) {
|
||||
self.SimpleTest.ignoreAllUncaughtExceptions(aIgnoring);
|
||||
};
|
||||
|
||||
this.finish = function test_finish() {
|
||||
self.__done = true;
|
||||
if (self.SimpleTest._expectingUncaughtException) {
|
||||
self.ok(false, "expectUncaughtException was called but no uncaught exception was detected!");
|
||||
}
|
||||
if (self.__waitTimer) {
|
||||
self.executeSoon(function() {
|
||||
if (self.__done && self.__waitTimer) {
|
||||
|
@ -47,9 +47,8 @@ include $(topsrcdir)/config/rules.mk
|
||||
_STATIC_FILES = test_sample.xul \
|
||||
test_sanityChromeUtils.xul \
|
||||
test_sanityPluginUtils.html \
|
||||
# Disabled until bug 652494 is resolved.
|
||||
# test_sanityException.xul \
|
||||
# test_sanityException2.xul \
|
||||
test_sanityException.xul \
|
||||
test_sanityException2.xul \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_STATIC_FILES)
|
||||
|
@ -15,7 +15,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=670817
|
||||
|
||||
SimpleTest.expectUncaughtException();
|
||||
ok(true, "a call to ok");
|
||||
throw "uncaught exception";
|
||||
throw "this is a deliberately thrown exception";
|
||||
|
||||
]]></script>
|
||||
</body>
|
||||
|
@ -17,7 +17,7 @@ SimpleTest.waitForExplicitFinish();
|
||||
ok(true, "a call to ok");
|
||||
SimpleTest.executeSoon(function() {
|
||||
SimpleTest.expectUncaughtException();
|
||||
throw "an uncaught exception";
|
||||
throw "this is a deliberately thrown exception";
|
||||
});
|
||||
SimpleTest.executeSoon(function() {
|
||||
SimpleTest.finish();
|
||||
|
@ -693,8 +693,16 @@ SimpleTest.expectChildProcessCrash = function () {
|
||||
* Indicates to the test framework that the next uncaught exception during
|
||||
* the test is expected, and should not cause a test failure.
|
||||
*/
|
||||
SimpleTest.expectUncaughtException = function () {
|
||||
SimpleTest._expectingUncaughtException = true;
|
||||
SimpleTest.expectUncaughtException = function (aExpecting) {
|
||||
SimpleTest._expectingUncaughtException = aExpecting === void 0 || !!aExpecting;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns whether the test has indicated that it expects an uncaught exception
|
||||
* to occur.
|
||||
*/
|
||||
SimpleTest.isExpectingUncaughtException = function () {
|
||||
return SimpleTest._expectingUncaughtException;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -702,8 +710,26 @@ SimpleTest.expectUncaughtException = function () {
|
||||
* during the test are known problems that should be fixed in the future,
|
||||
* but which should not cause the test to fail currently.
|
||||
*/
|
||||
SimpleTest.ignoreAllUncaughtExceptions = function () {
|
||||
SimpleTest._ignoringAllUncaughtExceptions = true;
|
||||
SimpleTest.ignoreAllUncaughtExceptions = function (aIgnoring) {
|
||||
SimpleTest._ignoringAllUncaughtExceptions = aIgnoring === void 0 || !!aIgnoring;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns whether the test has indicated that all uncaught exceptions should be
|
||||
* ignored.
|
||||
*/
|
||||
SimpleTest.isIgnoringAllUncaughtExceptions = function () {
|
||||
return SimpleTest._ignoringAllUncaughtExceptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* Resets any state this SimpleTest object has. This is important for
|
||||
* browser chrome mochitests, which reuse the same SimpleTest object
|
||||
* across a run.
|
||||
*/
|
||||
SimpleTest.reset = function () {
|
||||
SimpleTest._ignoringAllUncaughtExceptions = false;
|
||||
SimpleTest._expectingUncaughtException = false;
|
||||
};
|
||||
|
||||
if (isPrimaryTestWindow) {
|
||||
@ -924,22 +950,21 @@ var info = SimpleTest.info;
|
||||
|
||||
var gOldOnError = window.onerror;
|
||||
window.onerror = function simpletestOnerror(errorMsg, url, lineNumber) {
|
||||
var funcIdentifier = "[SimpleTest/SimpleTest.js, window.onerror]";
|
||||
|
||||
// Log the message.
|
||||
// XXX Chrome mochitests sometimes trigger this window.onerror handler,
|
||||
// but there are a number of uncaught JS exceptions from those tests.
|
||||
// For now, for tests that self identify as having unintentional uncaught
|
||||
// exceptions, just dump it so that the error is visible but doesn't cause
|
||||
// a test failure. See bug 652494.
|
||||
var message = "An error occurred: " + errorMsg + " at " + url + ":" + lineNumber;
|
||||
var href = SpecialPowers.getPrivilegedProps(window, 'location.href');
|
||||
var isExpected = !!SimpleTest._expectingUncaughtException;
|
||||
var message = "an " + (isExpected ? "" : "un") + "expected uncaught JS exception reported through window.onerror";
|
||||
var error = errorMsg + " at " + url + ":" + lineNumber;
|
||||
if (!SimpleTest._ignoringAllUncaughtExceptions) {
|
||||
SimpleTest.ok(isExpected, funcIdentifier, message);
|
||||
SimpleTest.ok(isExpected, message, error);
|
||||
SimpleTest._expectingUncaughtException = false;
|
||||
} else {
|
||||
SimpleTest.todo(false, funcIdentifier, message);
|
||||
SimpleTest.todo(false, message + ": " + error);
|
||||
}
|
||||
// There is no Components.stack.caller to log. (See bug 511888.)
|
||||
|
||||
|
@ -52,9 +52,8 @@ _BROWSER_TEST_FILES = \
|
||||
browser_privileges.js \
|
||||
browser_popupNode.js \
|
||||
browser_popupNode_check.js \
|
||||
# Disabled until bug 652494 is resolved.
|
||||
# browser_sanityException.js \
|
||||
# browser_sanityException2.js \
|
||||
browser_sanityException.js \
|
||||
browser_sanityException2.js \
|
||||
# Disabled, these are only good for testing the harness' failure reporting
|
||||
# browser_zz_fail_openwindow.js \
|
||||
# browser_fail.js \
|
||||
|
@ -1,5 +1,5 @@
|
||||
function test() {
|
||||
ok(true, "ok called");
|
||||
expectUncaughtException();
|
||||
throw "uncaught exception";
|
||||
throw "this is a deliberately thrown exception";
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ function test() {
|
||||
ok(true, "ok called");
|
||||
executeSoon(function() {
|
||||
expectUncaughtException();
|
||||
throw "uncaught exception";
|
||||
throw "this is a deliberately thrown exception";
|
||||
});
|
||||
executeSoon(function() {
|
||||
finish();
|
||||
|
@ -88,6 +88,7 @@ var Watcher = {
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
Services.wm.addListener(Watcher);
|
||||
|
||||
|
@ -259,5 +259,22 @@ HISTOGRAM(XUL_REFLOW_MS, 1, 3000, 10, EXPONENTIAL, "xul reflows")
|
||||
HISTOGRAM(XUL_INITIAL_FRAME_CONSTRUCTION, 1, 3000, 10, EXPONENTIAL, "initial xul frame construction")
|
||||
HISTOGRAM_BOOLEAN(XMLHTTPREQUEST_ASYNC_OR_SYNC, "Type of XMLHttpRequest, async or sync")
|
||||
|
||||
/**
|
||||
* DOM Storage telemetry.
|
||||
*/
|
||||
#define DOMSTORAGE_HISTOGRAM(PREFIX, TYPE, TYPESTRING, DESCRIPTION) \
|
||||
HISTOGRAM(PREFIX ## DOMSTORAGE_ ## TYPE ## _SIZE_BYTES, \
|
||||
1024, 32768, 10, EXPONENTIAL, "DOM storage: size of " TYPESTRING "s stored in " DESCRIPTION "Storage")
|
||||
#define DOMSTORAGE_KEY_VAL_SIZE(PREFIX, DESCRIPTION) \
|
||||
DOMSTORAGE_HISTOGRAM(PREFIX, KEY, "key", DESCRIPTION) \
|
||||
DOMSTORAGE_HISTOGRAM(PREFIX, VALUE, "value", DESCRIPTION)
|
||||
|
||||
DOMSTORAGE_KEY_VAL_SIZE(GLOBAL, "global")
|
||||
DOMSTORAGE_KEY_VAL_SIZE(LOCAL, "local")
|
||||
DOMSTORAGE_KEY_VAL_SIZE(SESSION, "session")
|
||||
|
||||
#undef DOMSTORAGE_KEY_VAL_SIZE
|
||||
#undef DOMSTORAGE_HISTOGRAM
|
||||
|
||||
|
||||
#undef HISTOGRAM_BOOLEAN
|
||||
|
@ -62,7 +62,6 @@
|
||||
#include "nsIProperties.h"
|
||||
#include "nsToolkitCompsCID.h"
|
||||
#include "nsIUrlClassifierUtils.h"
|
||||
#include "nsIRandomGenerator.h"
|
||||
#include "nsUrlClassifierDBService.h"
|
||||
#include "nsUrlClassifierUtils.h"
|
||||
#include "nsUrlClassifierProxies.h"
|
||||
@ -488,9 +487,13 @@ public:
|
||||
bool before,
|
||||
nsTArray<nsUrlClassifierEntry> &entries);
|
||||
|
||||
// Ask the db for a random number. This is temporary, and should be
|
||||
// replaced with nsIRandomGenerator when 419739 is fixed.
|
||||
nsresult RandomNumber(PRInt64 *randomNum);
|
||||
// Return an array with all Prefixes known
|
||||
nsresult ReadPrefixes(nsTArray<PRUint32>& array, PRUint32 aKey);
|
||||
|
||||
|
||||
protected:
|
||||
nsresult ReadEntries(mozIStorageStatement *statement,
|
||||
nsTArray<nsUrlClassifierEntry>& entries);
|
||||
@ -509,6 +512,7 @@ protected:
|
||||
nsCOMPtr<mozIStorageStatement> mLastPartialEntriesStatement;
|
||||
nsCOMPtr<mozIStorageStatement> mPartialEntriesBeforeStatement;
|
||||
|
||||
nsCOMPtr<mozIStorageStatement> mRandomStatement;
|
||||
nsCOMPtr<mozIStorageStatement> mAllPrefixStatement;
|
||||
};
|
||||
|
||||
@ -567,7 +571,11 @@ nsUrlClassifierStore::Init(nsUrlClassifierDBServiceWorker *worker,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = mConnection->CreateStatement
|
||||
(NS_LITERAL_CSTRING("SELECT domain, partial_data, complete_data FROM ")
|
||||
(NS_LITERAL_CSTRING("SELECT abs(random())"),
|
||||
getter_AddRefs(mRandomStatement));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = mConnection->CreateStatement(NS_LITERAL_CSTRING("SELECT domain, partial_data, complete_data FROM ")
|
||||
+ entriesName,
|
||||
getter_AddRefs(mAllPrefixStatement));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
@ -589,6 +597,7 @@ nsUrlClassifierStore::Close()
|
||||
mPartialEntriesAfterStatement = nsnull;
|
||||
mPartialEntriesBeforeStatement = nsnull;
|
||||
mLastPartialEntriesStatement = nsnull;
|
||||
mRandomStatement = nsnull;
|
||||
|
||||
mAllPrefixStatement = nsnull;
|
||||
|
||||
@ -773,6 +782,21 @@ nsUrlClassifierStore::ReadNoiseEntries(PRInt64 rowID,
|
||||
return ReadEntries(wraparoundStatement, entries);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsUrlClassifierStore::RandomNumber(PRInt64 *randomNum)
|
||||
{
|
||||
mozStorageStatementScoper randScoper(mRandomStatement);
|
||||
bool exists;
|
||||
nsresult rv = mRandomStatement->ExecuteStep(&exists);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (!exists)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
*randomNum = mRandomStatement->AsInt64(0);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// nsUrlClassifierAddStore class implementation
|
||||
|
||||
@ -1767,16 +1791,9 @@ nsUrlClassifierDBServiceWorker::AddNoise(PRInt64 nearID,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIRandomGenerator> rg =
|
||||
do_GetService("@mozilla.org/security/random-generator;1");
|
||||
NS_ENSURE_STATE(rg);
|
||||
|
||||
PRInt32 randomNum;
|
||||
PRUint8 *temp;
|
||||
nsresult rv = rg->GenerateRandomBytes(sizeof(randomNum), &temp);
|
||||
PRInt64 randomNum;
|
||||
nsresult rv = mMainStore.RandomNumber(&randomNum);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
memcpy(&randomNum, temp, sizeof(randomNum));
|
||||
NS_Free(temp);
|
||||
|
||||
PRInt32 numBefore = randomNum % count;
|
||||
|
||||
@ -3078,8 +3095,13 @@ nsUrlClassifierDBServiceWorker::FinishStream()
|
||||
static_cast<PRUint32>(gWorkingTimeThreshold)) {
|
||||
// We've spent long enough working that we should commit what we
|
||||
// have and hold off for a bit.
|
||||
ApplyUpdate();
|
||||
|
||||
nsresult rv = ApplyUpdate();
|
||||
if (NS_FAILED(rv)) {
|
||||
if (rv == NS_ERROR_FILE_CORRUPTED) {
|
||||
ResetDatabase();
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
nextStreamDelay = gDelayTime * 1000;
|
||||
}
|
||||
}
|
||||
@ -3191,7 +3213,13 @@ nsUrlClassifierDBServiceWorker::FinishUpdate()
|
||||
if (mConnection)
|
||||
mConnection->GetLastError(&errcode);
|
||||
|
||||
ApplyUpdate();
|
||||
nsresult rv = ApplyUpdate();
|
||||
if (NS_FAILED(rv)) {
|
||||
if (rv == NS_ERROR_FILE_CORRUPTED) {
|
||||
ResetDatabase();
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(mUpdateStatus)) {
|
||||
mUpdateObserver->UpdateSuccess(mUpdateWait);
|
||||
@ -3453,7 +3481,12 @@ nsUrlClassifierDBServiceWorker::OpenDb()
|
||||
|
||||
LOG(("loading Prefix Set\n"));
|
||||
rv = LoadPrefixSet(mPSFile);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
if (rv == NS_ERROR_FILE_CORRUPTED) {
|
||||
ResetDatabase();
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -3561,6 +3594,11 @@ nsresult nsUrlClassifierStore::ReadPrefixes(nsTArray<PRUint32>& array,
|
||||
|
||||
array.AppendElement(keyedVal);
|
||||
pcnt++;
|
||||
// Normal DB size is about 500k entries. If we are getting 10x
|
||||
// as much, the database must be corrupted.
|
||||
if (pcnt > 5000000) {
|
||||
return NS_ERROR_FILE_CORRUPTED;
|
||||
}
|
||||
}
|
||||
|
||||
LOG(("SB prefixes: %d fulldomain: %d\n", pcnt, fcnt));
|
||||
@ -3648,7 +3686,8 @@ nsUrlClassifierDBServiceWorker::LoadPrefixSet(nsCOMPtr<nsIFile> & aFile)
|
||||
}
|
||||
if (!exists || NS_FAILED(rv)) {
|
||||
LOG(("no (usable) stored PrefixSet found, constructing from store"));
|
||||
ConstructPrefixSet();
|
||||
rv = ConstructPrefixSet();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -312,8 +312,15 @@ nsUrlClassifierPrefixSet::Contains(PRUint32 aPrefix, bool * aFound)
|
||||
// Now search through the deltas for the target.
|
||||
PRUint32 diff = target - mIndexPrefixes[i];
|
||||
PRUint32 deltaIndex = mIndexStarts[i];
|
||||
PRUint32 deltaSize = mDeltas.Length();
|
||||
PRUint32 end = (i + 1 < mIndexStarts.Length()) ? mIndexStarts[i+1]
|
||||
: mDeltas.Length();
|
||||
: deltaSize;
|
||||
|
||||
// Sanity check the read values
|
||||
if (end > deltaSize) {
|
||||
return NS_ERROR_FILE_CORRUPTED;
|
||||
}
|
||||
|
||||
while (diff > 0 && deltaIndex < end) {
|
||||
diff -= mDeltas[deltaIndex];
|
||||
deltaIndex++;
|
||||
@ -402,24 +409,28 @@ nsUrlClassifierPrefixSet::LoadFromFd(AutoFDClose & fileFd)
|
||||
PRInt32 read;
|
||||
|
||||
read = PR_Read(fileFd, &magic, sizeof(PRUint32));
|
||||
NS_ENSURE_TRUE(read > 0, NS_ERROR_FAILURE);
|
||||
NS_ENSURE_TRUE(read == sizeof(PRUint32), NS_ERROR_FAILURE);
|
||||
|
||||
if (magic == PREFIXSET_VERSION_MAGIC) {
|
||||
PRUint32 indexSize;
|
||||
PRUint32 deltaSize;
|
||||
|
||||
read = PR_Read(fileFd, &mRandomKey, sizeof(PRUint32));
|
||||
NS_ENSURE_TRUE(read > 0, NS_ERROR_FAILURE);
|
||||
NS_ENSURE_TRUE(read == sizeof(PRUint32), NS_ERROR_FILE_CORRUPTED);
|
||||
read = PR_Read(fileFd, &indexSize, sizeof(PRUint32));
|
||||
NS_ENSURE_TRUE(read > 0, NS_ERROR_FAILURE);
|
||||
NS_ENSURE_TRUE(read == sizeof(PRUint32), NS_ERROR_FILE_CORRUPTED);
|
||||
read = PR_Read(fileFd, &deltaSize, sizeof(PRUint32));
|
||||
NS_ENSURE_TRUE(read > 0, NS_ERROR_FAILURE);
|
||||
NS_ENSURE_TRUE(read == sizeof(PRUint32), NS_ERROR_FILE_CORRUPTED);
|
||||
|
||||
if (indexSize == 0) {
|
||||
LOG(("stored PrefixSet is empty!"));
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (deltaSize > (indexSize * DELTAS_LIMIT)) {
|
||||
return NS_ERROR_FILE_CORRUPTED;
|
||||
}
|
||||
|
||||
nsTArray<PRUint32> mNewIndexPrefixes;
|
||||
nsTArray<PRUint32> mNewIndexStarts;
|
||||
nsTArray<PRUint16> mNewDeltas;
|
||||
@ -428,13 +439,15 @@ nsUrlClassifierPrefixSet::LoadFromFd(AutoFDClose & fileFd)
|
||||
mNewIndexPrefixes.SetLength(indexSize);
|
||||
mNewDeltas.SetLength(deltaSize);
|
||||
|
||||
read = PR_Read(fileFd, mNewIndexPrefixes.Elements(), indexSize*sizeof(PRUint32));
|
||||
NS_ENSURE_TRUE(read > 0, NS_ERROR_FAILURE);
|
||||
read = PR_Read(fileFd, mNewIndexStarts.Elements(), indexSize*sizeof(PRUint32));
|
||||
NS_ENSURE_TRUE(read > 0, NS_ERROR_FAILURE);
|
||||
PRInt32 toRead = indexSize*sizeof(PRUint32);
|
||||
read = PR_Read(fileFd, mNewIndexPrefixes.Elements(), toRead);
|
||||
NS_ENSURE_TRUE(read == toRead, NS_ERROR_FILE_CORRUPTED);
|
||||
read = PR_Read(fileFd, mNewIndexStarts.Elements(), toRead);
|
||||
NS_ENSURE_TRUE(read == toRead, NS_ERROR_FILE_CORRUPTED);
|
||||
if (deltaSize > 0) {
|
||||
read = PR_Read(fileFd, mNewDeltas.Elements(), deltaSize*sizeof(PRUint16));
|
||||
NS_ENSURE_TRUE(read > 0, NS_ERROR_FAILURE);
|
||||
toRead = deltaSize*sizeof(PRUint16);
|
||||
read = PR_Read(fileFd, mNewDeltas.Elements(), toRead);
|
||||
NS_ENSURE_TRUE(read == toRead, NS_ERROR_FILE_CORRUPTED);
|
||||
}
|
||||
|
||||
MutexAutoLock lock(mPrefixSetLock);
|
||||
|
@ -1,5 +1,10 @@
|
||||
<!ENTITY addons.windowTitle "Add-ons Manager">
|
||||
|
||||
<!ENTITY search.placeholder "Search all add-ons">
|
||||
<!-- LOCALIZATION NOTE (search.commandKey):
|
||||
The search command key should match findOnCmd.commandkey from browser.dtd -->
|
||||
<!ENTITY search.commandkey "f">
|
||||
|
||||
<!ENTITY loading.label "Loading…">
|
||||
<!ENTITY listEmpty.installed.label "You don't have any add-ons of this type installed">
|
||||
<!ENTITY listEmpty.availableUpdates.label "No updates found">
|
||||
|
@ -1725,6 +1725,16 @@ var gHeader = {
|
||||
updateNavButtonVisibility();
|
||||
},
|
||||
|
||||
focusSearchBox: function() {
|
||||
this._search.focus();
|
||||
},
|
||||
|
||||
onKeyPress: function(aEvent) {
|
||||
if (String.fromCharCode(aEvent.charCode) == "/") {
|
||||
this.focusSearchBox();
|
||||
}
|
||||
},
|
||||
|
||||
get shouldShowNavButtons() {
|
||||
var docshellItem = window.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
|
@ -55,7 +55,8 @@
|
||||
disablefastfind="true"
|
||||
ondragenter="gDragDrop.onDragOver(event)"
|
||||
ondragover="gDragDrop.onDragOver(event)"
|
||||
ondrop="gDragDrop.onDrop(event)">
|
||||
ondrop="gDragDrop.onDrop(event)"
|
||||
onkeypress="gHeader.onKeyPress(event)">
|
||||
|
||||
<xhtml:link rel="shortcut icon"
|
||||
href="chrome://mozapps/skin/extensions/extensionGeneric-16.png"/>
|
||||
@ -145,6 +146,11 @@
|
||||
<command id="cmd_contribute"/>
|
||||
</commandset>
|
||||
|
||||
<keyset>
|
||||
<key id="focusSearch" key="&search.commandkey;" modifiers="accel"
|
||||
oncommand="gHeader.focusSearchBox();"/>
|
||||
</keyset>
|
||||
|
||||
<!-- main header -->
|
||||
<hbox id="header" align="center">
|
||||
<toolbarbutton id="back-btn" class="nav-button header-button" command="cmd_back"
|
||||
|
@ -57,6 +57,7 @@ _MAIN_TEST_FILES = \
|
||||
browser_bug562992.js \
|
||||
browser_bug567127.js \
|
||||
browser_bug567137.js \
|
||||
browser_bug570760.js \
|
||||
browser_bug572561.js \
|
||||
browser_bug577990.js \
|
||||
browser_bug580298.js \
|
||||
|
41
toolkit/mozapps/extensions/test/browser/browser_bug570760.js
Normal file
41
toolkit/mozapps/extensions/test/browser/browser_bug570760.js
Normal file
@ -0,0 +1,41 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
// Bug 570760 - Make ctrl-f and / focus the search box in the add-ons manager
|
||||
|
||||
var gManagerWindow;
|
||||
var focusCount = 0;
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
open_manager(null, function(aWindow) {
|
||||
gManagerWindow = aWindow;
|
||||
|
||||
var searchBox = gManagerWindow.document.getElementById("header-search");
|
||||
function focusHandler() {
|
||||
searchBox.blur();
|
||||
focusCount++;
|
||||
}
|
||||
searchBox.addEventListener("focus", focusHandler);
|
||||
f_key_test();
|
||||
slash_key_test();
|
||||
searchBox.removeEventListener("focus", focusHandler);
|
||||
end_test();
|
||||
});
|
||||
}
|
||||
|
||||
function end_test() {
|
||||
close_manager(gManagerWindow, finish);
|
||||
}
|
||||
|
||||
function f_key_test() {
|
||||
EventUtils.synthesizeKey("f", { accelKey: true }, gManagerWindow);
|
||||
is(focusCount, 1, "Search box should have been focused due to the f key");
|
||||
}
|
||||
|
||||
function slash_key_test() {
|
||||
EventUtils.synthesizeKey("/", { }, gManagerWindow);
|
||||
is(focusCount, 2, "Search box should have been focused due to the / key");
|
||||
}
|
@ -3,6 +3,7 @@
|
||||
// exception
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
var triggers = encodeURIComponent(JSON.stringify(TESTROOT + "unsigned.xpi"));
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
|
@ -3,6 +3,7 @@
|
||||
// exception
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
var triggers = encodeURIComponent(JSON.stringify({
|
||||
"Unsigned XPI": {
|
||||
|
@ -5,6 +5,7 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
// Tests that cancelling multiple installs doesn't fail
|
||||
function test() {
|
||||
ignoreAllUncaughtExceptions();
|
||||
Harness.installConfirmCallback = confirm_install;
|
||||
Harness.installEndedCallback = install_ended;
|
||||
Harness.installsCompletedCallback = finish_test;
|
||||
|
@ -1,6 +1,7 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
// Test whether an InstallTrigger.install call fails when xpinstall is disabled
|
||||
function test() {
|
||||
ignoreAllUncaughtExceptions();
|
||||
Harness.installDisabledCallback = install_disabled;
|
||||
Harness.installBlockedCallback = allow_blocked;
|
||||
Harness.installConfirmCallback = confirm_install;
|
||||
|
@ -3,6 +3,7 @@
|
||||
// web content
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
var cr = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
|
||||
.getService(Components.interfaces.nsIChromeRegistry);
|
||||
|
@ -2,6 +2,7 @@
|
||||
// Tests installing an unsigned add-on through a navigation. Should not be
|
||||
// blocked since the referer is whitelisted.
|
||||
function test() {
|
||||
ignoreAllUncaughtExceptions();
|
||||
Harness.installConfirmCallback = confirm_install;
|
||||
Harness.installsCompletedCallback = finish_test;
|
||||
Harness.setup();
|
||||
|
Loading…
Reference in New Issue
Block a user