Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge with master #18

Merged
merged 8 commits into from
Jun 5, 2020
Merged

Conversation

AhmedAbdoOrtiga
Copy link
Owner

Description of changes

Pull request checklist

  • Addresses an existing issue: #0000
  • Ran yarn fastpass
  • Added/updated relevant unit test(s) (and ran yarn test)
  • Verified code coverage for the changes made. Check coverage report at: <rootDir>/test-results/unit/coverage
  • PR title AND final merge commit title both start with a semantic tag (fix:, chore:, feat(feature-name):, refactor:). See CONTRIBUTING.md.
  • (UI changes only) Added screenshots/GIFs to description above
  • (UI changes only) Verified usability with NVDA/JAWS

haonliu and others added 8 commits June 5, 2020 03:10
* wire up button

* use stateful component instead of hooks

* lint fix
)

* fix: use throttle instead of timeout for scroll/resize re-drawing

* fixed lint issue and added additional test for validating when called should be throttled
#### Description of changes

This PR sets unified up to bundle Accessibility Insights for Android Service via the new `accessibility-insights-for-android-service-bin` NPM package. It does this by:

* Updating `Gruntfile.js` with a new unified-specific copy step based on the new NPM wrapper to include the APK and notice file in a specific known location in the unified drop
* Adding a new `AndroidServiceApkLocator` that encapsulates knowledge of that specific known location, intended for use in the `install-service` state machine step via a state machine dep
* Since you can't use `__dirname` from within an electron renderer process, and the recommended alternative (electron's `app.getAppPath()`) is only invokable from the main process, hooks up IPC machinery to enable the `AndroidServiceApkLocator` to invoke `getAppPath` via the main process
* `electron-builder` bundles the app contents into a single `.asar` archive by default, but that's not very helpful for bundling the APK since we need it as its own file to send to ADB. Updates `electron-builder` config to bundle it as an "extra resource" instead, which gets installed as-is outside of the `.asar` archive.

Since this involves build machinery, besides the unit tests, I've manually validated that it works end to end in both dev and release builds by performing the following steps:

1. Adding the following code to the end of `renderer-initializer.ts`:
    ```ts
    const androidServiceApkLocator = new AndroidServiceApkLocator(ipcRendererShim.getAppPath);
    androidServiceApkLocator.locateBundledApk()
        .then(info => console.log(`locateBundledApk: ${info.path} v${info.versionName}`))
        .catch(error => console.error(`locateBundledApk: ${error}`));
      ```
2. `yarn build:unified; yarn start:unified:dev`
3. Observing the following text in the dev console:
    `locateBundledApk: C:\repos\accessibility-insights-web\drop\electron\unified-dev\product\android-service\android-service.apk v1.2.0`
4. Verifying that the `C:\repos\accessibility-insights-web\drop\electron\unified-dev\product\android-service\android-service.apk` file exists with the expected content
5. `yarn build:unified:all`
6. `& '.\drop\electron\unified-production\packed\Accessibility Insights for Android setup.exe'`
7. `npx cross-env DEV_MODE=true "C:\Users\dbjor\AppData\Local\Programs\Accessibility Insights for Android\Accessibility Insights for Android.exe"`
8. Observing the following text in the dev console:
    `locateBundledApk: C:\Users\dbjor\AppData\Local\Programs\Accessibility Insights for Android\resources\android-service\android-service.apk v1.2.0`
9. Verifying that the `C:\Users\dbjor\AppData\Local\Programs\Accessibility Insights for Android\resources\android-service\android-service.apk` file exists with the expected content

#### Pull request checklist
<!-- If a checklist item is not applicable to this change, write "n/a" in the checkbox -->
- [x] Addresses an existing issue: 1724328
- [x] Ran `yarn fastpass`
- [x] Added/updated relevant unit test(s) (and ran `yarn test`)
- [x] Verified code coverage for the changes made. Check coverage report at: `<rootDir>/test-results/unit/coverage`
- [x] PR title *AND* final merge commit title both start with a semantic tag (`fix:`, `chore:`, `feat(feature-name):`, `refactor:`). See `CONTRIBUTING.md`.
- [n/a] (UI changes only) Added screenshots/GIFs to description above
- [n/a] (UI changes only) Verified usability with NVDA/JAWS
* added the spinner to the detect-adb-step ui

* added a standalone scss file for android-setup styling. simplified detect-adb-step to just return the spinner and not call a method
@AhmedAbdoOrtiga AhmedAbdoOrtiga merged commit c3b4023 into AhmedAbdoOrtiga:master Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants