summaryrefslogtreecommitdiffstats
path: root/browser/base/content/test/newtab/browser_newtab_bug876313.js
diff options
context:
space:
mode:
Diffstat (limited to 'browser/base/content/test/newtab/browser_newtab_bug876313.js')
-rw-r--r--browser/base/content/test/newtab/browser_newtab_bug876313.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/browser/base/content/test/newtab/browser_newtab_bug876313.js b/browser/base/content/test/newtab/browser_newtab_bug876313.js
new file mode 100644
index 000000000..1c0b0f501
--- /dev/null
+++ b/browser/base/content/test/newtab/browser_newtab_bug876313.js
@@ -0,0 +1,24 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/*
+ * This test makes sure that the changes made by unpinning
+ * a site are actually written to NewTabUtils' storage.
+ */
+add_task(function* () {
+ // Second cell is pinned with page #99.
+ yield setLinks("0,1,2,3,4,5,6,7,8");
+ setPinnedLinks(",99");
+
+ yield* addNewTabPageTab();
+ yield* checkGrid("0,99p,1,2,3,4,5,6,7");
+
+ // Unpin the second cell's site.
+ yield unpinCell(1);
+ yield* checkGrid("0,1,2,3,4,5,6,7,8");
+
+ // Clear the pinned cache to force NewTabUtils to read the pref again.
+ NewTabUtils.pinnedLinks.resetCache();
+ NewTabUtils.allPages.update();
+ yield* checkGrid("0,1,2,3,4,5,6,7,8");
+});