summaryrefslogtreecommitdiffstats
path: root/browser/components/migration/tests/unit/test_Edge_availability.js
blob: dba0e27bbe5856aad9f4d7d5cce877cc3f109436 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"use strict";

const EDGE_AVAILABLE_MIGRATIONS =
  MigrationUtils.resourceTypes.COOKIES |
  MigrationUtils.resourceTypes.BOOKMARKS |
  MigrationUtils.resourceTypes.HISTORY |
  MigrationUtils.resourceTypes.PASSWORDS;

add_task(function* () {
  let migrator = MigrationUtils.getMigrator("edge");
  Cu.import("resource://gre/modules/AppConstants.jsm");
  Assert.equal(!!(migrator && migrator.sourceExists), AppConstants.isPlatformAndVersionAtLeast("win", "10"),
               "Edge should be available for migration if and only if we're on Win 10+");
  if (migrator) {
    let migratableData = migrator.getMigrateData(null, false);
    Assert.equal(migratableData, EDGE_AVAILABLE_MIGRATIONS,
                 "All the data types we expect should be available");
  }
});