Before this commit, the New Tab tests had two fake pref
implementations:
* The `Services.prefs` mock in `TEST_GLOBAL`, which stubbed out a
handful of `nsIPrefBranch` methods.
* `FakensIPrefBranch`, which mocked a different handful of
`nsIPrefBranch` methods.
This commit:
* Consolidates the two fake implementations into the mock
`FakensIPrefBranch` class.
* Adds a `FakensIPrefService` subclass of `FakensIPrefBranch`, with
additional methods specific to `nsIPrefService`.
* Replaces `FakensIPrefBranch.prototype.prefs` with a new
`FAKE_GLOBAL_PREFS` map. The new approach still lets tests change and
clear prefs on existing instances of `FakensIPrefBranch` and its
subclasses, but makes the shared state explicit. The old approach of
mutating `FakensIPrefBranch.prototype.prefs` relied on a subtle quirk
of `prefs` being shared by all instances of `FakensIPrefBranch` and
its subclasses, and broke when setting `prefs` to a new, empty
object.
* Moves `{observe, ignore}Branch` into `FakePrefs`, since these are
not part of the `nsIPrefBranch` interface.
Differential Revision: https://phabricator.services.mozilla.com/D173897
We were choosing not to read from the cache if the user has configured the browser
to restore the last session, but there's also the case where the last session might
be restored regardless - for example, to recover from a parent-process crash, after
an update applies, or if using the browser restart shortcut for developers.
Differential Revision: https://phabricator.services.mozilla.com/D173782
We were choosing not to read from the cache if the user has configured the browser
to restore the last session, but there's also the case where the last session might
be restored regardless - for example, to recover from a parent-process crash, after
an update applies, or if using the browser restart shortcut for developers.
Differential Revision: https://phabricator.services.mozilla.com/D173782
The schema still imposes the following restrictions:
- Having "template" present makes "content" and "id" required.
- Having "content" present makes "template" and "id" required.
Template and content are dependent on eachother because we do not know how to
interpret content without a template and we a template with no content to
interpret is useless.
If we have a template and content, then we also need an ID for the message
because we cannot reference the message content except by its ID.
Differential Revision: https://phabricator.services.mozilla.com/D172458
The schema still imposes the following restrictions:
- Having "template" present makes "content" and "id" required.
- Having "content" present makes "template" and "id" required.
Template and content are dependent on eachother because we do not know how to
interpret content without a template and we a template with no content to
interpret is useless.
If we have a template and content, then we also need an ID for the message
because we cannot reference the message content except by its ID.
Differential Revision: https://phabricator.services.mozilla.com/D172458
Currently, the Glean `newtab` ping and legacy scalars collect
impressions and clicks for sponsored (Pocket and Contile) tiles, but
not organic tiles from Places.
This commit adds:
* Support for recording organic impressions to the
`TopSiteImpressionWrapper` component.
* Support for recording organic clicks to the `TopSiteLink`
component.
* Instrumentation for recording organic impressions and clicks,
separate from sponsored ones, to `TelemetryFeed`.
Differential Revision: https://phabricator.services.mozilla.com/D171830
This also fixes a bug in ASRouter devtools that prevented evaluation of
expressions containing nested promises. Objects containing promises are now
correctly serialized to the ASRouter devtools and expressions evaluate
correctly.
Differential Revision: https://phabricator.services.mozilla.com/D169408
This also fixes a bug in ASRouter devtools that prevented evaluation of
expressions containing nested promises. Objects containing promises are now
correctly serialized to the ASRouter devtools and expressions evaluate
correctly.
Differential Revision: https://phabricator.services.mozilla.com/D169408
This also fixes a bug in ASRouter devtools that prevented evaluation of
expressions containing nested promises. Objects containing promises are now
correctly serialized to the ASRouter devtools and expressions evaluate
correctly.
Differential Revision: https://phabricator.services.mozilla.com/D169408