Closed Bug 1520796 Opened 5 years ago Closed 5 years ago

[meta] Service Worker debugging features that must work with sw-e10s landed

Categories

(DevTools :: about:debugging, enhancement, P3)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sole, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: meta, Whiteboard: meta)

User Story

With the dom.serviceWorkers.parent_intercept pref set to true, the following features must keep working in about:debugging:

- List Service Workers
- Start worker
- Push
- Unregister

Attachments

(1 file)

No description provided.

I just tried flipping the preference dom.serviceWorkers.parent_intercept to true and did some manual test in about:debugging. I was able to:

  • list service workers
  • start service worker
  • push
  • unregister service worker
  • debug service worker (including setting a breakpoint and pausing)

So if the state of the refactor is stable enough, I think very little should break on DevTools side. We might be able to do a lot of simplifications around our code to list workers, but it's probably something we will do only once the old implementation is definitely gone.

One thing I didn't manage to make work are our browser mochitests that exercise service workers.
When opening a page that registers a service worker, I get a tab crash. In debug mode, it seems to crash on the following ASSERT:
https://searchfox.org/mozilla-central/rev/bee8cf15c901b9f4b0c074c9977da4bbebc506e3/dom/serviceworkers/ServiceWorkerRegistrationInfo.cpp#95-96

ServiceWorkerRegistrationInfo::ServiceWorkerRegistrationInfo(
    const nsACString& aScope, nsIPrincipal* aPrincipal,
    ServiceWorkerUpdateViaCache aUpdateViaCache)
    : mPrincipal(aPrincipal),
      mDescriptor(GetNextId(), GetNextVersion(), aPrincipal, aScope,
                  aUpdateViaCache),
      mControlledClientsCounter(0),
      mDelayMultiplier(0),
      mUpdateState(NoUpdate),
      mCreationTime(PR_Now()),
      mCreationTimeStamp(TimeStamp::Now()),
      mLastUpdateTime(0),
      mPendingUninstall(false),
      mCorrupt(false) {
  MOZ_ASSERT_IF(ServiceWorkerParentInterceptEnabled(),
                XRE_GetProcessType() == GeckoProcessType_Default);
}

Note that I was initially suspecting that the issue was linked to the fact that we rely on dom.serviceWorkers.testing.enabled to allow to test SW with http rather than https. Then I updated the tests to use https instead and it still crashes as explained above. But it would be interesting to know if this preference/behavior is still supported with the new implementation or if we should migrate our tests to use https?

I'll attach a patch that updates about:debugging tests to run with the new implementation in case others want to have a look at the crash.

Import this patch and then run ./mach test browser_aboutdebugging_serviceworker_push.js

It should crash when opening the tab that registers the service worker.

Assignee: nobody → jdescottes

Thanks for proactively testing this, Julian!

I wanted to make sure we didn't lose this "devtools+e10s-SW MVP" so I made it block the main serviceworkers-e10s tracker. It's weird to have this block that metabug when work here explicitly depends on that pref being flipped but I wanted to avoid adding another bug layer for flipping the pref.

Depends on: 1522511
Assignee: jdescottes → nobody

I think we can close this one, all the blocking bugs have been fixed, and we have too many metas to track devtools-sw-e10s changes :)

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: