--HG--
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_certexceptionsui.js => browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_certexceptionsui.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_cookieacceptdialog.js => browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_cookieacceptdialog.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_crh.js => browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_crh.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_geoprompt.js => browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_geoprompt.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage.js => browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_localStorage.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_opendir.js => browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_opendir.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_openlocation.js => browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_openlocation.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placestitle.js => browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_placestitle.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_popupblocker.js => browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_popupblocker.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_protocolhandler.js => browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_protocolhandler.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_sslsite_transition.js => browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_sslsite_transition.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_theming.js => browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_theming.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_ui.js => browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_ui.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_urlbarfocus.js => browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_urlbarfocus.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle.js => browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_windowtitle.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoom.js => browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_zoom.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoomrestore.js => browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_zoomrestore.js
rename : browser/components/privatebrowsing/test/browser/head.js => browser/components/privatebrowsing/test/browser/global/head.js
rename : browser/components/privatebrowsing/test/browser/title.sjs => browser/components/privatebrowsing/test/browser/global/title.sjs
rename : browser/components/privatebrowsing/test/browser/browser_console_clear.js => browser/components/privatebrowsing/test/browser/obsolete/browser_console_clear.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_beforeunload.js => browser/components/privatebrowsing/test/browser/obsolete/browser_privatebrowsing_beforeunload.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_commandline_toggle.js => browser/components/privatebrowsing/test/browser/obsolete/browser_privatebrowsing_commandline_toggle.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadmonitor.js => browser/components/privatebrowsing/test/browser/obsolete/browser_privatebrowsing_downloadmonitor.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_fastswitch.js => browser/components/privatebrowsing/test/browser/obsolete/browser_privatebrowsing_fastswitch.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_findbar.js => browser/components/privatebrowsing/test/browser/obsolete/browser_privatebrowsing_findbar.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_forgetthissite.js => browser/components/privatebrowsing/test/browser/obsolete/browser_privatebrowsing_forgetthissite.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_import.js => browser/components/privatebrowsing/test/browser/obsolete/browser_privatebrowsing_import.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_newwindow_stopcmd.js => browser/components/privatebrowsing/test/browser/obsolete/browser_privatebrowsing_newwindow_stopcmd.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_pageinfo.js => browser/components/privatebrowsing/test/browser/obsolete/browser_privatebrowsing_pageinfo.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_popupmode.js => browser/components/privatebrowsing/test/browser/obsolete/browser_privatebrowsing_popupmode.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_searchbar.js => browser/components/privatebrowsing/test/browser/obsolete/browser_privatebrowsing_searchbar.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_transition.js => browser/components/privatebrowsing/test/browser/obsolete/browser_privatebrowsing_transition.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_urlbarundo.js => browser/components/privatebrowsing/test/browser/obsolete/browser_privatebrowsing_urlbarundo.js
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_viewsource.js => browser/components/privatebrowsing/test/browser/obsolete/browser_privatebrowsing_viewsource.js
rename : browser/components/privatebrowsing/test/browser/head.js => browser/components/privatebrowsing/test/browser/obsolete/head.js
rename : browser/components/privatebrowsing/test/browser/staller.sjs => browser/components/privatebrowsing/test/browser/obsolete/staller.sjs
rename : browser/components/privatebrowsing/test/browser/browser_privatebrowsing_lastpbcontextexited.js => browser/components/privatebrowsing/test/browser/perwindow/browser_privatebrowsing_lastpbcontextexited.js
This commit is contained in:
Ryan VanderMeulen 2012-10-11 21:31:33 -04:00
Родитель ee73324d6c fdb27c7386
Коммит bb8310a796
11 изменённых файлов: 127 добавлений и 28 удалений

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

@ -1817,11 +1817,6 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
* actual document fragment).
*/
if (nodeType == nsIDOMNode::DOCUMENT_FRAGMENT_NODE) {
uint32_t count = fragChildren.ref().Length();
if (!count) {
return NS_OK;
}
if (!aReplace) {
mb.Init(this, true, true);
}
@ -1832,6 +1827,11 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
mutationBatch->SetNextSibling(GetChildAt(insPos));
}
uint32_t count = fragChildren.ref().Length();
if (!count) {
return NS_OK;
}
bool appending =
!IsNodeOfType(eDOCUMENT) && uint32_t(insPos) == GetChildCount();
int32_t firstInsPos = insPos;

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

@ -316,6 +316,7 @@ function testChildList5() {
var c4 = document.createElement("div");
var c5 = document.createElement("div");
var df = document.createDocumentFragment();
var emptyDF = document.createDocumentFragment();
var dfc1 = df.appendChild(document.createElement("div"));
var dfc2 = df.appendChild(document.createElement("div"));
var dfc3 = df.appendChild(document.createElement("div"));
@ -358,6 +359,7 @@ function testChildList5() {
div.appendChild(c4);
div.appendChild(c5);
div.replaceChild(df, c4);
div.appendChild(emptyDF); // empty document shouldn't cause mutation records
}
function testAdoptNode() {
@ -385,8 +387,9 @@ function testOuterHTML() {
var d1 = doc.body.appendChild(document.createElement("div"));
var d2 = doc.body.appendChild(document.createElement("div"));
var d3 = doc.body.appendChild(document.createElement("div"));
var d4 = doc.body.appendChild(document.createElement("div"));
m = new M(function(records, observer) {
is(records.length, 3, "Should have 1 record");
is(records.length, 4, "Should have 1 record");
is(records[0].removedNodes.length, 1, "Should have 1 removed nodes");
is(records[0].addedNodes.length, 2, "Should have 2 added nodes");
is(records[0].previousSibling, null, "");
@ -398,7 +401,11 @@ function testOuterHTML() {
is(records[2].removedNodes.length, 1, "Should have 1 removed nodes");
is(records[2].addedNodes.length, 2, "Should have 2 added nodes");
is(records[2].previousSibling, records[1].addedNodes[1], "");
is(records[2].nextSibling, null, "");
is(records[2].nextSibling, d4, "");
is(records[3].removedNodes.length, 1, "Should have 1 removed nodes");
is(records[3].addedNodes.length, 0);
is(records[3].previousSibling, records[2].addedNodes[1], "");
is(records[3].nextSibling, null, "");
observer.disconnect();
then(testInsertAdjacentHTML);
m = null;
@ -407,6 +414,7 @@ function testOuterHTML() {
d1.outerHTML = "<div>1</div><div>1</div>";
d2.outerHTML = "<div>2</div><div>2</div>";
d3.outerHTML = "<div>3</div><div>3</div>";
d4.outerHTML = "";
}
function testInsertAdjacentHTML() {

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

@ -3257,11 +3257,17 @@ nsEventStateManager::PostHandleEvent(nsPresContext* aPresContext,
if (mDocument && fm) {
nsCOMPtr<nsIDOMWindow> currentWindow;
fm->GetFocusedWindow(getter_AddRefs(currentWindow));
if (currentWindow && currentWindow != mDocument->GetWindow() &&
if (currentWindow && mDocument->GetWindow() &&
currentWindow != mDocument->GetWindow() &&
!nsContentUtils::IsChromeDoc(mDocument)) {
nsCOMPtr<nsIDOMWindow> currentTop;
nsCOMPtr<nsIDOMWindow> newTop;
currentWindow->GetScriptableTop(getter_AddRefs(currentTop));
mDocument->GetWindow()->GetScriptableTop(getter_AddRefs(newTop));
nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(currentWindow);
nsCOMPtr<nsIDocument> currentDoc = do_QueryInterface(win->GetExtantDocument());
if (nsContentUtils::IsChromeDoc(currentDoc)) {
if (nsContentUtils::IsChromeDoc(currentDoc) ||
(currentTop && newTop && currentTop != newTop)) {
fm->SetFocusedWindow(mDocument->GetWindow());
}
}

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

@ -48,6 +48,8 @@ MOCHITEST_CHROME_FILES = \
test_sandbox_bindings.xul \
test_selectAtPoint.html \
selectAtPoint.html \
test_bug799299.xul \
file_bug799299.xul \
$(NULL)
ifeq (WINNT,$(OS_ARCH))

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

@ -0,0 +1,62 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=799299
-->
<window title="Mozilla Bug 799299"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
<!-- test results are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml">
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=799299"
target="_blank">Mozilla Bug 799299</a>
</body>
<!-- test code goes here -->
<script type="application/javascript">
<![CDATA[
/** Test for Bug 799299 **/
function sendClick(win) {
var wu = win.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindowUtils);
wu.sendMouseEventToWindow("mousedown", 10, 10, 0, 0, 0);
wu.sendMouseEventToWindow("mouseup", 10, 10, 0, 0, 0);
}
function runTests() {
var b1 = document.getElementById("b1");
var b2 = document.getElementById("b2");
b1.contentWindow.focus();
opener.wrappedJSObject.is(document.activeElement, b1);
var didCallDummy = false;
b2.contentWindow.addEventListener("mousedown", function(e) { didCallDummy = true; });
sendClick(b2.contentWindow);
opener.wrappedJSObject.ok(didCallDummy);
opener.wrappedJSObject.is(document.activeElement, b2);
b1.contentWindow.focus();
opener.wrappedJSObject.is(document.activeElement, b1);
var didCallListener = false;
b2.contentWindow.addEventListener("mousedown", function(e) { didCallListener = true; e.preventDefault(); });
sendClick(b2.contentWindow);
opener.wrappedJSObject.ok(didCallListener);
opener.wrappedJSObject.is(document.activeElement, b2);
window.close();
opener.wrappedJSObject.SimpleTest.finish();
}
SimpleTest.waitForFocus(runTests);
]]>
</script>
<hbox flex="1">
<browser id="b1" type="content" src="about:blank" flex="1" style="border: 1px solid black;"/>
<browser id="b2" type="content" src="about:blank" flex="1" style="border: 1px solid black;"/>
</hbox>
</window>

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

@ -0,0 +1,31 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=799299
-->
<window title="Mozilla Bug 799299" onload="runTests()"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
<!-- test results are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml">
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=799299"
target="_blank">Mozilla Bug 799299</a>
</body>
<!-- test code goes here -->
<script type="application/javascript">
<![CDATA[
/** Test for Bug 799299 **/
function runTests() {
window.open("file_bug799299.xul", "_blank", "chrome,width=600,height=550");
}
SimpleTest.waitForExplicitFinish();
]]>
</script>
</window>

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

@ -123,3 +123,4 @@ class ProcessExecutionMixin(LoggingMixin):
# '-c' and pass all the arguments as one argument because that is
# how sh works.
cline = subprocess.list2cmdline([prog] + args[1:])
return [_current_shell, '-c', cline]

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

@ -10,5 +10,4 @@ Modules Overview
* mozbuild.compilation -- Functionality related to compiling. This
includes managing compiler warnings.
* mozbuild.testing -- Interfaces for running tests.

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

@ -267,8 +267,6 @@ class MozbuildObject(ProcessExecutionMixin):
def _run_command_in_objdir(self, **args):
self.run_process(cwd=self.topobjdir, **args)
return [_current_shell, '-c', cline]
def _is_windows(self):
return os.name in ('nt', 'ce')

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

@ -9,10 +9,12 @@ import unittest
from tempfile import NamedTemporaryFile
from mozbuild.base import BuildConfig
from mozbuild.base import MozbuildObject
from mozbuild.config import ConfigSettings
from mozbuild.logger import LoggingManager
from mach.logging import LoggingManager
from mozbuild.base import (
BuildConfig,
MozbuildObject,
)
curdir = os.path.dirname(__file__)
@ -20,20 +22,9 @@ topsrcdir = os.path.normpath(os.path.join(curdir, '..', '..', '..', '..'))
log_manager = LoggingManager()
class TestBuildConfig(unittest.TestCase):
def test_basic(self):
c = ConfigSettings()
c.register_provider(BuildConfig)
c.build.threads = 6
class TestMozbuildObject(unittest.TestCase):
def get_base(self):
settings = ConfigSettings()
settings.register_provider(BuildConfig)
return MozbuildObject(topsrcdir, settings, log_manager)
return MozbuildObject(topsrcdir, None, log_manager)
def test_mozconfig_parsing(self):
with NamedTemporaryFile(mode='wt') as mozconfig:

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

@ -333,6 +333,7 @@ class Emulator(object):
# need to remount so we can write to /system/b2g
self._run_adb(['remount'])
self._run_adb(['shell', 'stop', 'b2g'])
self._run_adb(['shell', 'rm', '-rf', '/system/b2g/*.so'])
print 'installing gecko binaries'
self._run_adb(['push', self.gecko_path, '/system/b2g'])
print 'restarting B2G'