Open Bug 1541692 Opened 5 years ago Updated 2 years ago

In test harness, openRDM and closeRDM seem to reset the docshell

Categories

(DevTools :: Responsive Design Mode, task, P2)

task

Tracking

(Not tracked)

People

(Reporter: bradwerth, Unassigned)

References

(Blocks 2 open bugs)

Details

The test devtools/client/responsive.html/test/browser/browser_toggle_zoom.js, added by Bug 1541158, demonstrates that openRDM and closeRDM behave differently when running in a mochitest than they behave when running interactively. Specifically, they seem to reset the docshell state going in and out of Responsive Design Mode. This disparity makes it impossible to test some features that depend on the docshell state being copied to or from the RDM pane.

Priority: -- → P2

I figured out what the difference was:

Firefox normally stores (in the content pref database) the zoom level per url (or domain, really). This is so that if you visit that same site again later, the same zoom level will be re-applied.
This doesn't seem to work when mochitests run.
And, it turns out that that's what makes the zoom level of a page propagate to RDM when it is first opened.
We swap browsers and do a lot of complicated stuff when RDM opens, but ultimately, the content pref is read again, and re-applied to the new browser inside RDM.
This doesn't, however, happen when the test runs because no pref was ever set to record the zoom level.

(In reply to Patrick Brosset <:pbro> from comment #1)

I figured out what the difference was:

Thank you for finding this. So the issue will be one of two things:

  1. The zoom level is never copied from the docshell.
  2. The zoom level is copied from the docshell, but then overwritten by a default value from the content pref database (since the URL isn't found there).

I'll try to figure out which of the two is happening and fix it.

Priority: P2 → P1

Downgrading to P1 as this is a test harness problem only. In fact, let me mark this as a Task.

Type: defect → task
Priority: P1 → P2

Looks like this is resolved with new browser UI. I'll mark this as closed when Bug 1585121 lands.

Depends on: 1585121
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.