Bug 901126 - Split browser_newtab_drag_drop.js into two tests. r=ttaubert, a=test-only
authorAndrew Wang <iforgot120@gmail.com>
Wed, 21 Aug 2013 08:32:47 -0400
changeset 153860 3987a287ccc8fd886abe9abc5d1b8c82b91ba414
parent 153859 e743faa98501c31a0d452daab9e6d8319e5b6fdc
child 153861 4c6d2a6c4e818e9ef8203472916fd3d75f4a8443
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersttaubert, test-only
bugs901126
milestone25.0a2
Bug 901126 - Split browser_newtab_drag_drop.js into two tests. r=ttaubert, a=test-only
browser/base/content/test/newtab/Makefile.in
browser/base/content/test/newtab/browser_newtab_drag_drop.js
browser/base/content/test/newtab/browser_newtab_drag_drop_ext.js
--- a/browser/base/content/test/newtab/Makefile.in
+++ b/browser/base/content/test/newtab/Makefile.in
@@ -9,16 +9,17 @@ VPATH		= @srcdir@
 relativesrcdir  = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MOCHITEST_BROWSER_FILES = \
 	browser_newtab_block.js \
 	browser_newtab_disable.js \
 	browser_newtab_drag_drop.js \
+	browser_newtab_drag_drop_ext.js \
 	browser_newtab_drop_preview.js \
 	browser_newtab_focus.js \
 	browser_newtab_reset.js \
 	browser_newtab_tabsync.js \
 	browser_newtab_undo.js \
 	browser_newtab_unpin.js \
 	browser_newtab_bug721442.js \
 	browser_newtab_bug722273.js \
--- a/browser/base/content/test/newtab/browser_newtab_drag_drop.js
+++ b/browser/base/content/test/newtab/browser_newtab_drag_drop.js
@@ -66,52 +66,9 @@ function runTests() {
   yield setLinks("0,1,2,3,4,5,6,7,8");
   setPinnedLinks("0,1,2,,,5");
 
   yield addNewTabPageTab();
   checkGrid("0p,1p,2p,3,4,5p,6,7,8");
 
   yield simulateDrop(0, 4);
   checkGrid("3,1p,2p,4,0p,5p,6,7,8");
-
-  // drag a new site onto the very first cell
-  yield setLinks("0,1,2,3,4,5,6,7,8");
-  setPinnedLinks(",,,,,,,7,8");
-
-  yield addNewTabPageTab();
-  checkGrid("0,1,2,3,4,5,6,7p,8p");
-
-  yield simulateExternalDrop(0);
-  checkGrid("99p,0,1,2,3,4,5,7p,8p");
-
-  // drag a new site onto the grid and make sure that pinned cells don't get
-  // pushed out
-  yield setLinks("0,1,2,3,4,5,6,7,8");
-  setPinnedLinks(",,,,,,,7,8");
-
-  yield addNewTabPageTab();
-  checkGrid("0,1,2,3,4,5,6,7p,8p");
-
-  yield simulateExternalDrop(7);
-  checkGrid("0,1,2,3,4,5,7p,99p,8p");
-
-  // drag a new site beneath a pinned cell and make sure the pinned cell is
-  // not moved
-  yield setLinks("0,1,2,3,4,5,6,7,8");
-  setPinnedLinks(",,,,,,,,8");
-
-  yield addNewTabPageTab();
-  checkGrid("0,1,2,3,4,5,6,7,8p");
-
-  yield simulateExternalDrop(7);
-  checkGrid("0,1,2,3,4,5,6,99p,8p");
-
-  // drag a new site onto a block of pinned sites and make sure they're shifted
-  // around accordingly
-  yield setLinks("0,1,2,3,4,5,6,7,8");
-  setPinnedLinks("0,1,2,,,,,,");
-
-  yield addNewTabPageTab();
-  checkGrid("0p,1p,2p");
-
-  yield simulateExternalDrop(1);
-  checkGrid("0p,99p,1p,2p,3,4,5,6,7");
 }
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/newtab/browser_newtab_drag_drop_ext.js
@@ -0,0 +1,55 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/*
+ * These tests make sure that dragging and dropping sites works as expected.
+ * Sites contained in the grid need to shift around to indicate the result
+ * of the drag-and-drop operation. If the grid is full and we're dragging
+ * a new site into it another one gets pushed out.
+ * This is a continuation of browser_newtab_drag_drop.js
+ * to decrease test run time, focusing on external sites.
+ */
+function runTests() {
+  // drag a new site onto the very first cell
+  yield setLinks("0,1,2,3,4,5,6,7,8");
+  setPinnedLinks(",,,,,,,7,8");
+
+  yield addNewTabPageTab();
+  checkGrid("0,1,2,3,4,5,6,7p,8p");
+
+  yield simulateExternalDrop(0);
+  checkGrid("99p,0,1,2,3,4,5,7p,8p");
+
+  // drag a new site onto the grid and make sure that pinned cells don't get
+  // pushed out
+  yield setLinks("0,1,2,3,4,5,6,7,8");
+  setPinnedLinks(",,,,,,,7,8");
+
+  yield addNewTabPageTab();
+  checkGrid("0,1,2,3,4,5,6,7p,8p");
+
+  yield simulateExternalDrop(7);
+  checkGrid("0,1,2,3,4,5,7p,99p,8p");
+
+  // drag a new site beneath a pinned cell and make sure the pinned cell is
+  // not moved
+  yield setLinks("0,1,2,3,4,5,6,7,8");
+  setPinnedLinks(",,,,,,,,8");
+
+  yield addNewTabPageTab();
+  checkGrid("0,1,2,3,4,5,6,7,8p");
+
+  yield simulateExternalDrop(7);
+  checkGrid("0,1,2,3,4,5,6,99p,8p");
+
+  // drag a new site onto a block of pinned sites and make sure they're shifted
+  // around accordingly
+  yield setLinks("0,1,2,3,4,5,6,7,8");
+  setPinnedLinks("0,1,2,,,,,,");
+
+  yield addNewTabPageTab();
+  checkGrid("0p,1p,2p");
+
+  yield simulateExternalDrop(1);
+  checkGrid("0p,99p,1p,2p,3,4,5,6,7");
+}
\ No newline at end of file