Closed Bug 1500389 Opened Last year Closed 10 months ago

[remote-dbg-next] migrate aboutdebugging test: browser_service_workers_fetch_flag.js

Categories

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

enhancement

Tracking

(firefox67 fixed)

RESOLVED FIXED
Firefox 67
Tracking Status
firefox67 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

(Blocks 2 open bugs)

Details

(Whiteboard: old-remote-debugging-ng-m3)

Attachments

(3 files)

filter on remote-debugging-next-move-m3-to-m2
filter on remote-debugging-next-move-m3-to-m2
filter on remote-debugging-next-move-m3-to-m2
No longer blocks: remote-debugging-ng-m3
Priority: P3 → P2
Whiteboard: old-remote-debugging-ng-m3

You can have a look at the following documentation for some tips on how to migrate tests: https://gist.github.com/juliandescottes/fecc426ac84600357259bf513cea744c

Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Priority: P2 → P1

Had to modify localization to accomodate for the test so I would like an additional review from l10n peers here.
@stas feel free to forward if somebody else should have a look.

Below is a summary of the problem I faced here for localization, without any of the specifics related to aboutdebugging:

Localized(
  {
    id: "my-component-localization-id",
    attrs: {
      title: true,
      value: true,
    }
  }
  SomeSharedComponent{
    title: "fallback-title",
    value: "fallback-value"
  }
);

with the ftl:

my-component-localization-id =
  .title = Localized title
  .value = Localized value

The value prop can take any node, and later on in the development, I need a more complex wrapper (here for tests). It doesn'shouldn't impact the localization, but now I can't directly use my localized value:

Localized(
  {
    id: "my-component-localization-id",
    attrs: {
      title: true,
    }
  },
  SomeSharedComponent{
    title: "fallback-title",
    value: Localized(
      {
        id: my-component-localization-value
      },
      dom.span(
        {
          className: "some-class-needed-for-tests",
        },
        "fallback-value"
      )
    )
  }
);

with the ftl:

my-component-localization-id =
  .title = Localized title

my-component-localization-value = Localized value

It feels wrong to change the localization here, but the only other solution would be to introduce another Component, just to maintain the same API from the standpoint of the FTL:

Localized(
  {
    id: "my-component-localization-id",
    attrs: {
      title: true,
      value: true,
    },
  },
  SomeNewComponentForFluent{
    title: "fallback-title",
    value: "fallback-value",
  }
);

with an additional component

class SomeNewComponentForFluent extends PureComponent {
  render() {
    return SomeSharedComponent{
      title: this.props.title,
      value: dom.span(
        {
          className: "some-class-needed-for-tests",
        },
        this.props.value,
      ),
    };
  }
}

Depends on D17917
As discussed on slack. Let me know if you'd prefer another comment and/or moving this to the message CSS file?

Implementing the suggestion from the other review

Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3ab330cdeaaa
Stop using variants for localizing the serviceworker fetch status;r=stas
https://hg.mozilla.org/integration/autoland/rev/8f2713d136d4
Migrate serviceworker fetch flag test;r=ladybenko,stas
https://hg.mozilla.org/integration/autoland/rev/b6d95c5760d0
Set margin to 0 instead of initial for <p>;r=ladybenko,daisuke
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 67
You need to log in before you can comment on or make changes to this bug.