summaryrefslogtreecommitdiffstats
path: root/browser/base/content/test/newtab/browser_newtab_undo.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /browser/base/content/test/newtab/browser_newtab_undo.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'browser/base/content/test/newtab/browser_newtab_undo.js')
-rw-r--r--browser/base/content/test/newtab/browser_newtab_undo.js47
1 files changed, 47 insertions, 0 deletions
diff --git a/browser/base/content/test/newtab/browser_newtab_undo.js b/browser/base/content/test/newtab/browser_newtab_undo.js
new file mode 100644
index 000000000..ba094cb26
--- /dev/null
+++ b/browser/base/content/test/newtab/browser_newtab_undo.js
@@ -0,0 +1,47 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/*
+ * These tests make sure that the undo dialog works as expected.
+ */
+add_task(function* () {
+ // remove unpinned sites and undo it
+ yield setLinks("0,1,2,3,4,5,6,7,8");
+ setPinnedLinks("5");
+
+ yield* addNewTabPageTab();
+ yield* checkGrid("5p,0,1,2,3,4,6,7,8");
+
+ yield blockCell(4);
+ yield blockCell(4);
+ yield* checkGrid("5p,0,1,2,6,7,8");
+
+ yield* undo();
+ yield* checkGrid("5p,0,1,2,4,6,7,8");
+
+ // now remove a pinned site and undo it
+ yield blockCell(0);
+ yield* checkGrid("0,1,2,4,6,7,8");
+
+ yield* undo();
+ yield* checkGrid("5p,0,1,2,4,6,7,8");
+
+ // remove a site and restore all
+ yield blockCell(1);
+ yield* checkGrid("5p,1,2,4,6,7,8");
+
+ yield* undoAll();
+ yield* checkGrid("5p,0,1,2,3,4,6,7,8");
+});
+
+function* undo() {
+ let updatedPromise = whenPagesUpdated();
+ yield BrowserTestUtils.synthesizeMouseAtCenter("#newtab-undo-button", {}, gBrowser.selectedBrowser);
+ yield updatedPromise;
+}
+
+function* undoAll() {
+ let updatedPromise = whenPagesUpdated();
+ yield BrowserTestUtils.synthesizeMouseAtCenter("#newtab-undo-restore-button", {}, gBrowser.selectedBrowser);
+ yield updatedPromise;
+}