I did a dedicated patch for converting both about:debuggings as it is slightly more
complex as we have to tweak redux data, wrappers, mocks.
This patch also convert a manual "reload" request being done by about:debugging
and instead use protocol.js front to do it.
Also, I moved isLegacyTemporaryExtension to the front as it depends on accessing the form
and it should be better to keep form processing to the fronts, if possible.
MozReview-Commit-ID: 16qZkuCBp9b
Depends on D12576
Differential Revision: https://phabricator.services.mozilla.com/D12577
I'm sorry this is just one commit, I should have split it :( I will submit tests in another patch.
- Vendored [react-router-dom](https://www.npmjs.com/package/react-router-dom) library.
- Removed `getSelectedPageComponent` from `App` component and changed it to use React Router's `Route` components.
- Made the sidebar links to point to proper URL's. Thanks to this we don't need a lot of code/props we were passing to these items to select the proper page.
Some considerations over the implementation:
- React Router's `Switch` is used to wrap our routes, to ensure only one is rendered. Right now is not strictly necessary, but I think it helps to clarify that the routes are _not_ nested.
- We need to pass a `key` prop to the `RuntimePage` rendered in the route, so when we change the actual runtime shown, the page gets updated.
- The action `selectPage` gets called on `componentWillMount`, so it doesn't change state while rendering.
- When we reload the page and a device runtime is selected, we redirect to "This Firefox" page.
(Click on this GIF to see navigation 👇)
{F1100903}
I'm sorry this has taken this long, it has been a bit of a headache 🙏
Differential Revision: https://phabricator.services.mozilla.com/D12147
I did a dedicated patch for converting both about:debuggings as it is slightly more
complex as we have to tweak redux data, wrappers, mocks.
This patch also convert a manual "reload" request being done by about:debugging
and instead use protocol.js front to do it.
Also, I moved isLegacyTemporaryExtension to the front as it depends on accessing the form
and it should be better to keep form processing to the fronts, if possible.
MozReview-Commit-ID: 16qZkuCBp9b
Depends on D12576
Differential Revision: https://phabricator.services.mozilla.com/D12577
Depends on D12095. Now that we pass a remoteId to open about:devtools-toolbox, we actually don't need transportDetails
Differential Revision: https://phabricator.services.mozilla.com/D12097
Depends on D12095. Now that we pass a remoteId to open about:devtools-toolbox, we actually don't need transportDetails
Differential Revision: https://phabricator.services.mozilla.com/D12097
Changed my mind about getDeviceDescription :)
I think it is better to remain explicit and to always say which properties we are exporting.
I also added a small test for the this-firefox mock to avoid future regressions.
Differential Revision: https://phabricator.services.mozilla.com/D12318
Still not sure what is the root issue here, but none of the regular connect tests are failing so I think the issue occurs when we remove tabs in the second step.
Differential Revision: https://phabricator.services.mozilla.com/D12332
Depends on D10096
Adds a first test that simply connects to a USB runtime (but also has to
mock this-firefox runtime).
Differential Revision: https://phabricator.services.mozilla.com/D10097
Depends on D10095
The initial intent was to extract the logic to create the USB clients
so that it could be mocked in our tests. However since USB clients
share most of their logic with network clients, it did not make sense
to extract USB without network. And once you have USB and network, there
is no good reason to keep local client out.
I don't think "runtime-helper.js" is a good module name here. The role
of this module is to build clients for runtimes, but at the same time
it is just a static helper. Could not find a good name, and we already
have inconsistent module names in our modules/ folder so I did not want
to introduce something like RuntimeClientBuilder of RuntimeClientProvider
etc...
One of the consequences is that once we start mocking this helper (in the
next patch) we will also have to mock the this-firefox runtime. It has
advantages and disadvantages but I think we can live with this for now.
Differential Revision: https://phabricator.services.mozilla.com/D10096
Depends on D9801
This a preparatory work that ensures that all the calls to DevTools client are made
through a wrapper called ClientWrapper. I initially tried having a static "client" helper
but the test code was really hard to follow. Keeping a "client-like" object makes this
easier.
Differential Revision: https://phabricator.services.mozilla.com/D10095
I want to go through a first round of review before moving forward. If we agree
on the basic approach in this patch two things:
- I want to complexify things by adding a test that connects to a runtime and shows
the runtime page (to exercise more than this very simple use case)
- I will probably separate the loader modification in a separate bug, will open a RFC to
discuss it and will use a workaround for now in our code so that we are not blocked
Overall I don't want to start adding too many features to this mocking solution, I would
rather wait until the tests help us understand what fits best our needs.
Differential Revision: https://phabricator.services.mozilla.com/D9801
Similar to what we do from WebIDE (where we pass "webide").
Let me know if the string is ok here or if you would prefer something else.
Differential Revision: https://phabricator.services.mozilla.com/D11166