Bug 1806159 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

We currently don't have any tests verifying default bookmarks. We'd likely need marionette-like tests that start up the browser from a fresh browser.
We currently don't have any tests verifying default bookmarks. We'd likely need marionette-like tests that start up the browser from a fresh browser.

Update: I added more details below.

--

Some notes about default bookmarks:
- On Firefox, default bookmarks are usually displayed on the Bookmarks Toolbar (ex. "Get Involved" is one of the default bookmarks on Nightly)
- The file containing default bookmarks is in [browser/base/content/default-bookmarks.html](https://searchfox.org/mozilla-central/rev/aec3a901e6f6b3041b5ec457c9111a042cef1fb1/browser/base/content/default-bookmarks.html). The default bookmarks differ depending on whether we're loading a nightly, beta, or release version of Firefox. (For context, see our [release schedule](https://whattrainisitnow.com/calendar/)).
- For this Bugzilla ticket, let's try to add a test to verify bookmarks according to Firefox version. We can use [AppConstants](https://searchfox.org/mozilla-central/rev/aec3a901e6f6b3041b5ec457c9111a042cef1fb1/toolkit/modules/AppConstants.sys.mjs#15,22,29) in our test file to determine what version of Firefox we're using.
- There are other tests that verify default bookmarks (ex. see [browser/components/places/tests/unit/test_browserGlue_corrupt_nobackup_default.js](https://searchfox.org/mozilla-central/rev/aec3a901e6f6b3041b5ec457c9111a042cef1fb1/browser/components/places/tests/unit/test_browserGlue_corrupt_nobackup_default.js#39-49)). They however don't check default bookmarks for other Firefox versions, which is what we want to do.

Some steps for guidance:
- For more information about writing tests, see [this Firefox Source Docs article on testing](https://firefox-source-docs.mozilla.org/browser/urlbar/testing.html).
- As for where to add the test, maybe adding it in [this directory](https://searchfox.org/mozilla-central/source/browser/base/content/test/menubar) would be a good start.
- We can fetch bookmarks from the toolbar by calling `await PlacesUtils.bookmarks.fetch` with parentGuid as `PlacesUtils.bookmarks.toolbarGuid`. Use [searchfox](https://searchfox.org/) to find examples.
We currently don't have any tests verifying default bookmarks. We'd likely need marionette-like tests that start up the browser from a fresh browser.

Update: I added more details below.

--

Some notes about default bookmarks:
- The file containing default bookmarks is in [browser/base/content/default-bookmarks.html](https://searchfox.org/mozilla-central/rev/aec3a901e6f6b3041b5ec457c9111a042cef1fb1/browser/base/content/default-bookmarks.html). The default bookmarks differ depending on whether we're loading a nightly, beta, or release version of Firefox. (For context, see our [release schedule](https://whattrainisitnow.com/calendar/)).
- On Firefox, default bookmarks are usually displayed on the Bookmarks Toolbar (ex. "Get Involved" is one of the default bookmarks on Nightly)
- For this Bugzilla ticket, let's try to add a test to verify bookmarks according to Firefox version. We can use [AppConstants](https://searchfox.org/mozilla-central/rev/aec3a901e6f6b3041b5ec457c9111a042cef1fb1/toolkit/modules/AppConstants.sys.mjs#15,22,29) in our test file to determine what version of Firefox we're using.
- There are other tests that verify default bookmarks (ex. see [browser/components/places/tests/unit/test_browserGlue_corrupt_nobackup_default.js](https://searchfox.org/mozilla-central/rev/aec3a901e6f6b3041b5ec457c9111a042cef1fb1/browser/components/places/tests/unit/test_browserGlue_corrupt_nobackup_default.js#39-49)). They however don't check default bookmarks for other Firefox versions, which is what we want to do.

Some steps for guidance:
- For more information about writing tests, see [this Firefox Source Docs article on testing](https://firefox-source-docs.mozilla.org/browser/urlbar/testing.html).
- As for where to add the test, maybe adding it in [this directory](https://searchfox.org/mozilla-central/source/browser/base/content/test/menubar) would be a good start.
- We can fetch bookmarks from the toolbar by calling `await PlacesUtils.bookmarks.fetch` with parentGuid as `PlacesUtils.bookmarks.toolbarGuid`. Use [searchfox](https://searchfox.org/) to find examples.
We currently don't have any tests verifying default bookmarks. We'd likely need marionette-like tests that start up the browser from a fresh browser.

Update: I added more details below.

--

Some notes about default bookmarks:
- The file containing default bookmarks is in [browser/base/content/default-bookmarks.html](https://searchfox.org/mozilla-central/rev/aec3a901e6f6b3041b5ec457c9111a042cef1fb1/browser/base/content/default-bookmarks.html). The default bookmarks differ depending on whether we're loading a nightly, beta, or release version of Firefox. (For context, see our [release schedule](https://whattrainisitnow.com/calendar/)).
- On Firefox, default bookmarks are usually displayed on the Bookmarks Toolbar (ex. "Get Involved" is one of the default bookmarks on Nightly)
- For this Bugzilla ticket, let's try to add a test to verify bookmarks according to Firefox version. We can use [AppConstants](https://searchfox.org/mozilla-central/rev/aec3a901e6f6b3041b5ec457c9111a042cef1fb1/toolkit/modules/AppConstants.sys.mjs#15,22,29) in our test file to determine what version of Firefox we're using.
- There are other tests that verify default bookmarks (ex. see [browser/components/places/tests/unit/test_browserGlue_corrupt_nobackup_default.js](https://searchfox.org/mozilla-central/rev/aec3a901e6f6b3041b5ec457c9111a042cef1fb1/browser/components/places/tests/unit/test_browserGlue_corrupt_nobackup_default.js#39-49)). They however don't check default bookmarks for other Firefox versions, which is what we want to do.

Some steps for guidance:
- For more information about writing tests, see [this Firefox Source Docs article on testing](https://firefox-source-docs.mozilla.org/browser/urlbar/testing.html).
- As for where to add the test, maybe adding it in [this directory](https://searchfox.org/mozilla-central/source/browser/base/content/test/menubar) would be a good start.
- We can fetch bookmarks from the toolbar by calling `await PlacesUtils.bookmarks.fetch` with parentGuid as `PlacesUtils.bookmarks.toolbarGuid`. Use [searchfox](https://searchfox.org/) to find examples.
- Also see this [example of forced import](https://searchfox.org/mozilla-central/rev/9b8ebf06145feeccf34dc126cf45b07e86556392/browser/components/places/tests/unit/test_browserGlue_prefs.js#95-126) for default bookmarks by Marco below
We currently don't have any tests verifying default bookmarks. We'd likely need marionette-like tests that start up the browser from a fresh browser.

Update: I added more details below.

--

Some notes about default bookmarks:
- The file containing default bookmarks is in [browser/base/content/default-bookmarks.html](https://searchfox.org/mozilla-central/rev/aec3a901e6f6b3041b5ec457c9111a042cef1fb1/browser/base/content/default-bookmarks.html). The default bookmarks differ depending on whether we're loading a nightly, beta, or release version of Firefox. (For context, see our [release schedule](https://whattrainisitnow.com/calendar/)).
- On Firefox, default bookmarks are usually displayed on the Bookmarks Toolbar (ex. "Get Involved" is one of the default bookmarks on Nightly)
- For this Bugzilla ticket, let's try to add a test to verify bookmarks according to Firefox version. We can use [AppConstants](https://searchfox.org/mozilla-central/rev/aec3a901e6f6b3041b5ec457c9111a042cef1fb1/toolkit/modules/AppConstants.sys.mjs#15,22,29) in our test file to determine what version of Firefox we're using.
- There are other tests that verify default bookmarks (ex. see [browser/components/places/tests/unit/test_browserGlue_corrupt_nobackup_default.js](https://searchfox.org/mozilla-central/rev/aec3a901e6f6b3041b5ec457c9111a042cef1fb1/browser/components/places/tests/unit/test_browserGlue_corrupt_nobackup_default.js#39-49)). They however don't check default bookmarks for other Firefox versions, which is what we want to do.

Some steps for guidance:
- For more information about writing tests, see [this Firefox Source Docs article on testing](https://firefox-source-docs.mozilla.org/browser/urlbar/testing.html).
- As for where to add the test, maybe adding it [here](https://searchfox.org/mozilla-central/source/browser/components/places/tests/unit) would be a good start.
- We can fetch bookmarks from the toolbar by calling `await PlacesUtils.bookmarks.fetch` with parentGuid as `PlacesUtils.bookmarks.toolbarGuid`. Use [searchfox](https://searchfox.org/) to find examples.
- Also see this [example of forced import](https://searchfox.org/mozilla-central/rev/9b8ebf06145feeccf34dc126cf45b07e86556392/browser/components/places/tests/unit/test_browserGlue_prefs.js#95-126) for default bookmarks by Marco below

Back to Bug 1806159 Comment 0