summaryrefslogtreecommitdiffstats
path: root/browser/components/places/tests/unit/test_invalid_defaultLocation.js
blob: e533d051d0a5e6e27ecff1a27f9ced1f1961ca74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* Any copyright is dedicated to the Public Domain.
 * https://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";

/**
 * Test that if browser.bookmarks.defaultLocation contains an invalid GUID,
 * PlacesUIUtils.defaultParentGuid will return a proper default value.
 */

add_task(async function () {
  Services.prefs.setCharPref(
    "browser.bookmarks.defaultLocation",
    "useOtherBookmarks"
  );

  info(
    "Checking that default parent guid was set back to the toolbar because of invalid preferable guid"
  );
  Assert.equal(
    await PlacesUIUtils.defaultParentGuid,
    PlacesUtils.bookmarks.toolbarGuid,
    "Default parent guid is a toolbar guid"
  );
});