xpcom/tests/TestBlockingProcess.cpp
author Drew Willcoxon <adw@mozilla.com>
Thu, 22 Aug 2019 14:50:42 +0000
changeset 542066 91c666707c219c5215117da97cbbec3bf07f42e1
parent 507657 09c71a7cf75aeaf2963050e315276fb9a866fd62
permissions -rw-r--r--
Bug 1575038 - Quantumbar: Record engagement event telemetry when openViewOnFocus is triggered without mouse clicks. r=dao, a=RyanVM We need to start engagement event recording when the view opens due to `openViewOnFocus`. We already do for mouse clicks since we call `engagementEvent.start` from `_on_mousedown`. But we don't for the Ctrl/Command-L key shortcut. The shortcut command calls `openLocation` in browser.js, which calls `gURLBar.startQuery` but not `engagementEvent.start`. Every time we call `engagementEvent.start`, we do it before calling `input.startQuery`. The one exception is in `input._on_drop` because there we just handle the dropped value directly instead of starting a new query with it. The inverse is also mostly true, i.e., every time we call `input.startQuery`, we also call `engagementEvent.start`. The three exceptions are: in UITour (where it looks like we should be calling `urlbar.search` instead), in `UrlbarInput` after picking a keyword offer result, and in `openLocation` in browser.js (mentioned above). So really the only valid place is after picking a keyword entry. So, it makes sense to move `engagementEvent.start()` into `input.startQuery` so that callers don't have to call it. I added an `event` param to `startQuery`, since `engagementEvent.start` needs one. I considered removing that need. It's possible, but then we would need a way to avoid calling `engagementEvent.start` in the keyword offer case, so `startQuery` would need something like a `suppressEngagementEvent` param. `event` basically functions as that, so I left it. Another thing to point out about this patch is that I chose to record a "typed" value when the pageproxystate is invalid and the view opens due to `openViewOnFocus`. The view does not show the user's top sites in that case, so "topsites" seems wrong. Differential Revision: https://phabricator.services.mozilla.com/D42749

#include <stdio.h>
#include "mozilla/Unused.h"

int main() {
  char tmp;
  mozilla::Unused << fread(&tmp, sizeof(tmp), 1, stdin);
  return 0;
}