Bug 427500 - Upgrade the copy of MochiKit used in Mochitest, to v1.4.2; (Gv1a) Explicitly test http://svn.mochikit.com/mochikit/tags/MochiKit-1.4.2/ (== r1480), make it run and pass.
authorSerge Gautherie <sgautherie.bz@free.fr>
Fri, 16 Apr 2010 16:50:56 +0200
changeset 40928 89ab9d52bef226ad9b2d4ef2703f8129aaad7456
parent 40927 3e10611826dced12287801aa02fc1a79db0d2908
child 40929 ac2ca60ceb8bfd31edd4e5bd0f664f1b18a3d49b
push id12837
push usersgautherie.bz@free.fr
push dateFri, 16 Apr 2010 14:51:42 +0000
treeherdermozilla-central@89ab9d52bef2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs427500
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
Bug 427500 - Upgrade the copy of MochiKit used in Mochitest, to v1.4.2; (Gv1a) Explicitly test http://svn.mochikit.com/mochikit/tags/MochiKit-1.4.2/ (== r1480), make it run and pass. r=ctalbert.
testing/mochitest/tests/Makefile.in
testing/mochitest/tests/MochiKit-1.4.2/Makefile.in
testing/mochitest/tests/MochiKit-1.4.2/MochiKit/Makefile.in
testing/mochitest/tests/MochiKit-1.4.2/tests/Makefile.in
testing/mochitest/tests/MochiKit-1.4.2/tests/SimpleTest/Makefile.in
testing/mochitest/tests/MochiKit-1.4.2/tests/SimpleTest/SimpleTest.js
testing/mochitest/tests/MochiKit-1.4.2/tests/SimpleTest/test.css
testing/mochitest/tests/MochiKit-1.4.2/tests/test_MochiKit-DragAndDrop.html
testing/mochitest/tests/MochiKit-1.4.2/tests/test_MochiKit-Style.html
toolkit/toolkit-makefiles.sh
--- a/testing/mochitest/tests/Makefile.in
+++ b/testing/mochitest/tests/Makefile.in
@@ -15,16 +15,17 @@
 # The Original Code is mozilla.org code.
 #
 # The Initial Developer of the Original Code is
 # Netscape Communications Corporation.
 # Portions created by the Initial Developer are Copyright (C) 1998
 # the Initial Developer. All Rights Reserved.
 #
 # Contributor(s):
+#	Serge Gautherie <sgautherie.bz@free.fr>
 #
 # Alternatively, the contents of this file may be used under the terms of
 # either the GNU General Public License Version 2 or later (the "GPL"), or
 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 # in which case the provisions of the GPL or the LGPL are applicable instead
 # of those above. If you wish to allow use of your version of this file only
 # under the terms of either the GPL or the LGPL, and not to allow others to
 # use your version of this file under the terms of the MPL, indicate your
@@ -38,19 +39,21 @@
 DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir  = testing/mochitest/tests
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS =	 SimpleTest \
-	 browser \
-	 $(NULL)
+PARALLEL_DIRS = \
+	MochiKit-1.4.2 \
+	SimpleTest \
+	browser \
+	$(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
 _TEST_FILES = test_MochiKit-Async.html \
 		test_MochiKit-Base.html \
 		test_MochiKit-DateTime.html \
 		test_MochiKit-DOM.html \
 		test_MochiKit-Style.html \
new file mode 100644
--- /dev/null
+++ b/testing/mochitest/tests/MochiKit-1.4.2/Makefile.in
@@ -0,0 +1,51 @@
+#
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Makefile for MochiKit v1.4.2 code and tests.
+#
+# The Initial Developer of the Original Code is
+# Serge Gautherie <sgautherie.bz@free.fr>.
+# Portions created by the Initial Developer are Copyright (C) 2010
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+
+DEPTH		= ../../../..
+topsrcdir	= @top_srcdir@
+srcdir		= @srcdir@
+VPATH		= @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+PARALLEL_DIRS = \
+	MochiKit \
+	tests \
+	$(NULL)
+
+include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/testing/mochitest/tests/MochiKit-1.4.2/MochiKit/Makefile.in
@@ -0,0 +1,71 @@
+#
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Makefile for MochiKit v1.4.2 code.
+#
+# The Initial Developer of the Original Code is
+# Serge Gautherie <sgautherie.bz@free.fr>.
+# Portions created by the Initial Developer are Copyright (C) 2010
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+
+DEPTH		= ../../../../..
+topsrcdir	= @top_srcdir@
+srcdir		= @srcdir@
+VPATH		= @srcdir@
+relativesrcdir  = testing/mochitest/tests/MochiKit-1.4.2/MochiKit
+
+include $(DEPTH)/config/autoconf.mk
+include $(topsrcdir)/config/rules.mk
+
+_MOCHIKIT_FILES = \
+	Async.js \
+	Base.js \
+	Color.js \
+	DateTime.js \
+	DOM.js \
+	DragAndDrop.js \
+	Format.js \
+	Iter.js \
+	Logging.js \
+	LoggingPane.js \
+	MochiKit.js \
+	MockDOM.js \
+	Position.js \
+	Selector.js \
+	Signal.js \
+	Sortable.js \
+	Style.js \
+	Test.js \
+	Visual.js \
+	$(NULL)
+
+libs:: $(_MOCHIKIT_FILES)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/$(relativesrcdir)
new file mode 100644
--- /dev/null
+++ b/testing/mochitest/tests/MochiKit-1.4.2/tests/Makefile.in
@@ -0,0 +1,85 @@
+#
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Makefile for MochiKit v1.4.2 tests.
+#
+# The Initial Developer of the Original Code is
+# Serge Gautherie <sgautherie.bz@free.fr>.
+# Portions created by the Initial Developer are Copyright (C) 2010
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+
+DEPTH		= ../../../../..
+topsrcdir	= @top_srcdir@
+srcdir		= @srcdir@
+VPATH		= @srcdir@
+relativesrcdir  = testing/mochitest/tests/MochiKit-1.4.2/tests
+
+include $(DEPTH)/config/autoconf.mk
+
+PARALLEL_DIRS = \
+	SimpleTest \
+	$(NULL)
+
+include $(topsrcdir)/config/rules.mk
+
+_TEST_FILES = \
+	test_Base.js \
+	test_Color.js \
+	test_DateTime.js \
+	test_DragAndDrop.js \
+	test_Format.js \
+	test_Iter.js \
+	test_Logging.js \
+	test_MochiKit-Async.html \
+	test_MochiKit-Async.json \
+	test_MochiKit-Base.html \
+	test_MochiKit-Color.html \
+	test_MochiKit-DateTime.html \
+	test_MochiKit-DOM.html \
+	test_MochiKit-DOM-Safari.html \
+	test_MochiKit-DragAndDrop.html \
+	test_MochiKit-Format.html \
+	test_MochiKit-Iter.html \
+	test_MochiKit-Logging.html \
+	test_MochiKit-MochiKit.html \
+	test_MochiKit-Selector.html \
+	test_MochiKit-Signal.html \
+	test_MochiKit-Style.html \
+	test_MochiKit-Visual.html \
+	test_Signal.js \
+	$(NULL)
+
+# This test is broken: "Error: JSAN is not defined ... Line: 10".
+# (And is removed in future MochiKit v1.5)
+#	test_MochiKit-JSAN.html \
+
+libs:: $(_TEST_FILES)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/$(relativesrcdir)
new file mode 100644
--- /dev/null
+++ b/testing/mochitest/tests/MochiKit-1.4.2/tests/SimpleTest/Makefile.in
@@ -0,0 +1,58 @@
+#
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is SimpleTest stubs for MochiKit v1.4.2 tests.
+#
+# The Initial Developer of the Original Code is
+# Serge Gautherie <sgautherie.bz@free.fr>.
+# Portions created by the Initial Developer are Copyright (C) 2010
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+
+#
+# We want to run the tests in our own (modified) harness.
+#
+
+DEPTH		= ../../../../../..
+topsrcdir	= @top_srcdir@
+srcdir		= @srcdir@
+VPATH		= @srcdir@
+relativesrcdir  = testing/mochitest/tests/MochiKit-1.4.2/tests/SimpleTest
+
+include $(DEPTH)/config/autoconf.mk
+include $(topsrcdir)/config/rules.mk
+
+_STUBS_FILES = \
+	SimpleTest.js \
+	test.css \
+	$(NULL)
+
+libs:: $(_STUBS_FILES)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/$(relativesrcdir)
new file mode 100644
--- /dev/null
+++ b/testing/mochitest/tests/MochiKit-1.4.2/tests/SimpleTest/SimpleTest.js
@@ -0,0 +1,47 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is SimpleTest.js stub for MochiKit v1.4.2 tests.
+ *
+ * The Initial Developer of the Original Code is
+ * Serge Gautherie <sgautherie.bz@free.fr>.
+ * Portions created by the Initial Developer are Copyright (C) 2010
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+// NB: This code was adapted from
+//     http://www.nczonline.net/blog/2009/07/28/the-best-way-to-load-external-javascript/.
+
+
+var script = document.createElement('script');
+script.type = 'text/javascript';
+script.src = '../../SimpleTest/SimpleTest.js';
+
+var headFC = document.getElementsByTagName('head')[0];
+// Use insertBefore() instead of appendChild(), to avoid http://support.microsoft.com/kb/927917.
+headFC.parentNode.insertBefore(script, headFC);
new file mode 100644
--- /dev/null
+++ b/testing/mochitest/tests/MochiKit-1.4.2/tests/SimpleTest/test.css
@@ -0,0 +1,38 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is test.css stub for MochiKit v1.4.2 tests.
+ *
+ * The Initial Developer of the Original Code is
+ * Serge Gautherie <sgautherie.bz@free.fr>.
+ * Portions created by the Initial Developer are Copyright (C) 2010
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+
+@import url("../../../SimpleTest/test.css");
--- a/testing/mochitest/tests/MochiKit-1.4.2/tests/test_MochiKit-DragAndDrop.html
+++ b/testing/mochitest/tests/MochiKit-1.4.2/tests/test_MochiKit-DragAndDrop.html
@@ -1,16 +1,22 @@
 <html>
 <head>
     <script type="text/javascript" src="../MochiKit/Base.js"></script>
     <script type="text/javascript" src="../MochiKit/Iter.js"></script>
     <script type="text/javascript" src="../MochiKit/DOM.js"></script>
     <script type="text/javascript" src="../MochiKit/Style.js"></script>
     <script type="text/javascript" src="../MochiKit/Color.js"></script>
     <script type="text/javascript" src="../MochiKit/Signal.js"></script>    
+    <!--
+      Include MochiKit/Position.js to fix the 2 following errors:
+      "Error: uncaught exception: MochiKit.Visual depends on MochiKit.Position!"
+      "Error: uncaught exception: MochiKit.DragAndDrop depends on MochiKit.Position!"
+     -->
+    <script type="text/javascript" src="../MochiKit/Position.js"></script>
     <script type="text/javascript" src="../MochiKit/Visual.js"></script>    
     <script type="text/javascript" src="../MochiKit/DragAndDrop.js"></script>    
     <script type="text/javascript" src="SimpleTest/SimpleTest.js"></script>        
     <link rel="stylesheet" type="text/css" href="SimpleTest/test.css">
     <style type="text/css">
     .drop-hover {
     }
     #drag1 {
--- a/testing/mochitest/tests/MochiKit-1.4.2/tests/test_MochiKit-Style.html
+++ b/testing/mochitest/tests/MochiKit-1.4.2/tests/test_MochiKit-Style.html
@@ -163,16 +163,24 @@ try {
     dims = getViewportDimensions();
     is(dims.w > 0, true, 'test getViewportDimensions w');
     is(dims.h > 0, true, 'test getViewportDimensions h');
 
     pos = getViewportPosition();
     is(pos.x, 0, 'test getViewportPosition x');
     is(pos.y, 0, 'test getViewportPosition y');
 
+    // The 3(+3) following |is(dims.w, 80, ...);| need a width of at least 652px to pass.
+    // Our SimpleTest/TestRunner.js runs tests inside an |iframe.width = "500";| only.
+    // Work around that.
+    // NB: This test already passes without this workaround when run alone.
+    setElementPosition('testTable', {'x': dims.w - (3 * (2 + 80 + 2))});
+    pos = getElementPosition('testTable');
+    is(dims.w - pos.x >= (3 * (2 + 80 + 2)), true, 'Is viewport width enough to display \'testTable\' at expected size?');
+
     dims = getElementDimensions('testCell1', true);
     is(dims.w, 80, 'default left table cell content w ok');
     is(dims.h, 30, 'default left table cell content h ok');
     dims = getElementDimensions('testCell2', true);
     is(dims.w, 80, 'default middle table cell content w ok');
     is(dims.h, 30, 'default middle table cell content h ok');
     dims = getElementDimensions('testCell3', true);
     is(dims.w, 80, 'default right table cell content w ok');
--- a/toolkit/toolkit-makefiles.sh
+++ b/toolkit/toolkit-makefiles.sh
@@ -982,16 +982,20 @@ if [ "$ENABLE_TESTS" ]; then
     parser/xml/test/Makefile
     rdf/tests/triplescat/Makefile
     testing/mochitest/Makefile
     testing/mochitest/MochiKit/Makefile
     testing/mochitest/chrome/Makefile
     testing/mochitest/ssltunnel/Makefile
     testing/mochitest/static/Makefile
     testing/mochitest/tests/Makefile
+    testing/mochitest/tests/MochiKit-1.4.2/Makefile
+    testing/mochitest/tests/MochiKit-1.4.2/MochiKit/Makefile
+    testing/mochitest/tests/MochiKit-1.4.2/tests/Makefile
+    testing/mochitest/tests/MochiKit-1.4.2/tests/SimpleTest/Makefile
     testing/mochitest/tests/SimpleTest/Makefile
     testing/mochitest/tests/browser/Makefile
     testing/xpcshell/Makefile
     testing/xpcshell/example/Makefile
     toolkit/components/alerts/test/Makefile
     toolkit/components/autocomplete/tests/Makefile
     toolkit/components/commandlines/test/Makefile
     toolkit/components/contentprefs/tests/Makefile