summaryrefslogtreecommitdiffstats
path: root/browser/base/content/test/newtab/browser_newtab_update.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2018-02-03 06:00:38 -0500
committerMatt A. Tobin <email@mattatobin.com>2018-02-03 06:00:38 -0500
commit8148615da179fdd60f19018e13b4e94b95609cc6 (patch)
tree771fccdd99fa3adf35fdd2c81d8197b415a89b91 /browser/base/content/test/newtab/browser_newtab_update.js
parent494802c1be7888025b95260d23db187467d2b9dd (diff)
downloadUXP-8148615da179fdd60f19018e13b4e94b95609cc6.tar
UXP-8148615da179fdd60f19018e13b4e94b95609cc6.tar.gz
UXP-8148615da179fdd60f19018e13b4e94b95609cc6.tar.lz
UXP-8148615da179fdd60f19018e13b4e94b95609cc6.tar.xz
UXP-8148615da179fdd60f19018e13b4e94b95609cc6.zip
Remove browser tests - Part 1: The Tests (except for experiments)
Diffstat (limited to 'browser/base/content/test/newtab/browser_newtab_update.js')
-rw-r--r--browser/base/content/test/newtab/browser_newtab_update.js48
1 files changed, 0 insertions, 48 deletions
diff --git a/browser/base/content/test/newtab/browser_newtab_update.js b/browser/base/content/test/newtab/browser_newtab_update.js
deleted file mode 100644
index 6cf089dfd..000000000
--- a/browser/base/content/test/newtab/browser_newtab_update.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-/**
- * Checks that newtab is updated as its links change.
- */
-add_task(function* () {
- // First, start with an empty page. setLinks will trigger a hidden page
- // update because it calls clearHistory. We need to wait for that update to
- // happen so that the next time we wait for a page update below, we catch the
- // right update and not the one triggered by setLinks.
- let updatedPromise = whenPagesUpdated();
- let setLinksPromise = setLinks([]);
- yield Promise.all([updatedPromise, setLinksPromise]);
-
- // Strategy: Add some visits, open a new page, check the grid, repeat.
- yield fillHistoryAndWaitForPageUpdate([1]);
- yield* addNewTabPageTab();
- yield* checkGrid("1,,,,,,,,");
-
- yield fillHistoryAndWaitForPageUpdate([2]);
- yield* addNewTabPageTab();
- yield* checkGrid("2,1,,,,,,,");
-
- yield fillHistoryAndWaitForPageUpdate([1]);
- yield* addNewTabPageTab();
- yield* checkGrid("1,2,,,,,,,");
-
- yield fillHistoryAndWaitForPageUpdate([2, 3, 4]);
- yield* addNewTabPageTab();
- yield* checkGrid("2,1,3,4,,,,,");
-
- // Make sure these added links have the right type
- let type = yield performOnCell(1, cell => { return cell.site.link.type });
- is(type, "history", "added link is history");
-});
-
-function fillHistoryAndWaitForPageUpdate(links) {
- let updatedPromise = whenPagesUpdated;
- let fillHistoryPromise = fillHistory(links.map(link));
- return Promise.all([updatedPromise, fillHistoryPromise]);
-}
-
-function link(id) {
- return { url: "http://example" + id + ".com/", title: "site#" + id };
-}