summaryrefslogtreecommitdiffstats
path: root/browser/components/newtab/test/browser/abouthomecache/browser_basic_endtoend.js
blob: bd42dd4af9048041da7dfbf24e8418e2afcbced0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

/**
 * Tests that the about:home cache gets written on shutdown, and read
 * from in the subsequent startup.
 */
add_task(async function test_basic_behaviour() {
  await withFullyLoadedAboutHome(async browser => {
    // First, clear the cache to test the base case.
    await clearCache();
    await simulateRestart(browser);
    await ensureCachedAboutHome(browser);

    // Next, test that a subsequent restart also shows the cached
    // about:home.
    await simulateRestart(browser);
    await ensureCachedAboutHome(browser);
  });
});