From 32595346ae02a0d0cd145391fd182f84604537bf Mon Sep 17 00:00:00 2001 From: Jonathan Griffin Date: Thu, 11 Oct 2012 12:07:34 -0700 Subject: [PATCH 1/6] Bug 800102 - Make installing gecko on B2G emulator more reliable, r=ahal, DONTBUILD(NPOTB) --- testing/marionette/client/marionette/emulator.py | 1 + 1 file changed, 1 insertion(+) diff --git a/testing/marionette/client/marionette/emulator.py b/testing/marionette/client/marionette/emulator.py index 35d2c2071aa0..396082b417e1 100644 --- a/testing/marionette/client/marionette/emulator.py +++ b/testing/marionette/client/marionette/emulator.py @@ -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' From f2f23df43576146d87c7b38698bc22d566c7b302 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 11 Oct 2012 21:47:11 +0200 Subject: [PATCH 2/6] Bug 799648 - Followup: Remove a line accidentally left in; r=gps (NPOTB, DONTBUILD) --- python/mozbuild/mozbuild/base.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/python/mozbuild/mozbuild/base.py b/python/mozbuild/mozbuild/base.py index ab69115655d9..17ec445200be 100644 --- a/python/mozbuild/mozbuild/base.py +++ b/python/mozbuild/mozbuild/base.py @@ -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') From 0b8c6fe6b13458f5507bb9f51db59dca91d79815 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 11 Oct 2012 22:00:37 +0200 Subject: [PATCH 3/6] Bug 799648 - Followup followup: Add the line back where it was meant to be; r=gps (NPOTB, DONTBUILD) --- python/mach/mach/mixin/process.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/mach/mach/mixin/process.py b/python/mach/mach/mixin/process.py index 50d4e68f69a8..b504f0b78cb0 100644 --- a/python/mach/mach/mixin/process.py +++ b/python/mach/mach/mixin/process.py @@ -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] From 6e290149548b82c90a93a4a025055be517cf7c46 Mon Sep 17 00:00:00 2001 From: Olli Pettay Date: Fri, 12 Oct 2012 01:43:42 +0300 Subject: [PATCH 4/6] Bug 799299 - focus contention with two visible html content areas, r=masayuki --- content/events/src/nsEventStateManager.cpp | 10 ++- dom/tests/mochitest/chrome/Makefile.in | 2 + dom/tests/mochitest/chrome/file_bug799299.xul | 62 +++++++++++++++++++ dom/tests/mochitest/chrome/test_bug799299.xul | 31 ++++++++++ 4 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 dom/tests/mochitest/chrome/file_bug799299.xul create mode 100644 dom/tests/mochitest/chrome/test_bug799299.xul diff --git a/content/events/src/nsEventStateManager.cpp b/content/events/src/nsEventStateManager.cpp index b65e5f44a4b4..c685fd69e4c6 100644 --- a/content/events/src/nsEventStateManager.cpp +++ b/content/events/src/nsEventStateManager.cpp @@ -3257,11 +3257,17 @@ nsEventStateManager::PostHandleEvent(nsPresContext* aPresContext, if (mDocument && fm) { nsCOMPtr currentWindow; fm->GetFocusedWindow(getter_AddRefs(currentWindow)); - if (currentWindow && currentWindow != mDocument->GetWindow() && + if (currentWindow && mDocument->GetWindow() && + currentWindow != mDocument->GetWindow() && !nsContentUtils::IsChromeDoc(mDocument)) { + nsCOMPtr currentTop; + nsCOMPtr newTop; + currentWindow->GetScriptableTop(getter_AddRefs(currentTop)); + mDocument->GetWindow()->GetScriptableTop(getter_AddRefs(newTop)); nsCOMPtr win = do_QueryInterface(currentWindow); nsCOMPtr currentDoc = do_QueryInterface(win->GetExtantDocument()); - if (nsContentUtils::IsChromeDoc(currentDoc)) { + if (nsContentUtils::IsChromeDoc(currentDoc) || + (currentTop && newTop && currentTop != newTop)) { fm->SetFocusedWindow(mDocument->GetWindow()); } } diff --git a/dom/tests/mochitest/chrome/Makefile.in b/dom/tests/mochitest/chrome/Makefile.in index a740bab5660e..d9a4ccc46ae0 100644 --- a/dom/tests/mochitest/chrome/Makefile.in +++ b/dom/tests/mochitest/chrome/Makefile.in @@ -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)) diff --git a/dom/tests/mochitest/chrome/file_bug799299.xul b/dom/tests/mochitest/chrome/file_bug799299.xul new file mode 100644 index 000000000000..62fd20ddd9e6 --- /dev/null +++ b/dom/tests/mochitest/chrome/file_bug799299.xul @@ -0,0 +1,62 @@ + + + + + + + + + + + diff --git a/dom/tests/mochitest/chrome/test_bug799299.xul b/dom/tests/mochitest/chrome/test_bug799299.xul new file mode 100644 index 000000000000..9819f95a1d30 --- /dev/null +++ b/dom/tests/mochitest/chrome/test_bug799299.xul @@ -0,0 +1,31 @@ + + + + + + + From 864fcf162c2f70a8d95dad1950484f11067e35a8 Mon Sep 17 00:00:00 2001 From: Olli Pettay Date: Fri, 12 Oct 2012 02:01:40 +0300 Subject: [PATCH 5/6] Bug 798974, MutationObserver doesn't handle correctly empty document fragments, r=sicking --- content/base/src/nsINode.cpp | 10 +++++----- content/base/test/test_mutationobservers.html | 12 ++++++++++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/content/base/src/nsINode.cpp b/content/base/src/nsINode.cpp index 919e94c659bc..ac121f4d58a7 100644 --- a/content/base/src/nsINode.cpp +++ b/content/base/src/nsINode.cpp @@ -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; diff --git a/content/base/test/test_mutationobservers.html b/content/base/test/test_mutationobservers.html index 3a48bc787e6c..42f5763e0652 100644 --- a/content/base/test/test_mutationobservers.html +++ b/content/base/test/test_mutationobservers.html @@ -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 = "
1
1
"; d2.outerHTML = "
2
2
"; d3.outerHTML = "
3
3
"; + d4.outerHTML = ""; } function testInsertAdjacentHTML() { From fdb27c738601a9cea679c36cb52acaac07a0bc46 Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Thu, 11 Oct 2012 17:13:18 -0700 Subject: [PATCH 6/6] Bug 800633 - Clean up references to code moved out of mozbuild; r=jhammel DONTBUILD (NPOTB) --- python/mozbuild/README.rst | 1 - python/mozbuild/mozbuild/test/test_base.py | 23 +++++++--------------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/python/mozbuild/README.rst b/python/mozbuild/README.rst index 7256b9ee0f5f..bd621fae3550 100644 --- a/python/mozbuild/README.rst +++ b/python/mozbuild/README.rst @@ -10,5 +10,4 @@ Modules Overview * mozbuild.compilation -- Functionality related to compiling. This includes managing compiler warnings. -* mozbuild.testing -- Interfaces for running tests. diff --git a/python/mozbuild/mozbuild/test/test_base.py b/python/mozbuild/mozbuild/test/test_base.py index 5206492a98ab..5b9f0fdf3425 100644 --- a/python/mozbuild/mozbuild/test/test_base.py +++ b/python/mozbuild/mozbuild/test/test_base.py @@ -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: