Skip to content
This repository has been archived by the owner on Jul 5, 2021. It is now read-only.

Firefox Lite Development Guide (Draft)

Hao-Kuang Tsai edited this page May 9, 2019 · 4 revisions

Overview

Welcome to Firefox Lite development! We are happy to have you with us. This guide gives you the idea of our development guideline like naming convention, cooperation workflow etc. If not listed, just align standard Java/Android conventions (lint should handle most of the cases). Below document is for Java code.

Contributing

Filing your PR with UI testing

  • To save build time, UI test won't always execute for every PR. If you want your PR tested with UI tests before landing, you can file another PR to ui_fullcheck (instead of master). With it, your patches will be executed with all UI tests.

UI Testing Guideline

  • Use Robo pattern or reuse AndroidUtil methods. Don't use new onView(withId(...)) check unless there's a good reason.
  • If you find duplicate view Ids, modify the production code to make withId check easier.
  • Thread.sleep(...) is only allowed in ScreengrabOnlytests since we haven't found a way to make Screengrab work with IdlingResource.
  • Only create new IdlingResource if you really need it. And besure to register/unregister within one method call so you other tests won't be affected.
  • Rollback the state you've modified in the test. So later tests won't be affected.
  • Some production code uses View.Animation api or Lottie hence it won't work with Espresso (Animation will still play). Modify production code by using Animator api or use Inject.java to work around the issue.

Naming Conventions

  • Class variable: Start from lower case and no prefix (e.g. m/s)
  • UI Test class: Use the same package structure as main source set as possible.
  • UI Test method: <testStepsWithCarmelCase_expectedResult>

Other Conventions

  • Add final as much as possible.
  • Add @VisibleForTesting for code in the none-testing source set
  • Add @CheckForResult on methods if the result is important to check/handle
  • Commit message(TBD): : Description of this commit. Fix #. e.g. add2home: Update pin shortcut icon. Fix issue#1622.

Cooperation workflow

(TBD)

Component List

(TBD)

Reviewer

(TBD)

Communication Channel

(TBD)