B2G/QA/Customizations

From MozillaWiki
< B2G‎ | QA
Jump to: navigation, search

SIM Customization Testing

SIM Customization

SIM customizations focuses on utilizing knowledge of the SIM card's MCC/MNC to determine which build customization to set onto the phone. The build customization can control things such as what apps are preloaded on the device, what support contacts are included, what ringtones are set by default, what wallpaper is used, etc.

Example: Let's say my customization I'm using is here - https://github.com/mozilla-b2g/gaia/tree/master/customization. After I complete the FTE, Gaia will check the MCC/MNC of the current SIM card and see if it matches any MCC/MNC found in the variant.json file (https://github.com/mozilla-b2g/gaia/blob/master/customization/variant.json). If there's a match found (e.g. MCC/MNC matches 310-260), then Gaia will customize each area called out under the MCC/MNC for that SIM card. If there's no match, then a default customization is used instead. If the phone is restarted and a SIM is then detected, then Gaia will customize each area called out under the MCC/MNC for that SIM card that's allowed to be done on top of the default customization.

SIM Requirements

The test coverage required for testing SIM customizations needs to cover the following SIMs:

  • For current implementation, 3 digits please.
  • T-Mobile US - MCC = 310, MNC = 260
  • AT&T US - MCC = 310, MNC = 410
  • CHT Taiwan - MCC = 466, MNC = 092
  • TWN Taiwan - MCC =466, MNC = 097
  • FarEasTone Taiwan - MCC =466, MNC = 001
  • VIBO Taiwan - MCC =466, MNC = 089
  • Mobile country code
  • <TBD for other SIMs needed>

To validate you have the right SIM for testing, follow the directions here to determine if the SIM you have matches the MCC/MNC pair needed. Note that you might not have all SIMs available for testing this feature, so be sure to indicate which SIMs you could test vs. not test when you execute a test pass on this feature.

Only SIM 1 is currently supported

Build Setup

Follow the following steps to get your build setup for running test cases that place the SIM card in before and after the First Time Experience application is ran.

  1. Flash the latest build for the version you are aiming to test
  2. Pull Gaia locally with git installed by running "git clone https://github.com/mozilla-b2g/gaia.git"
  3. Pull the reference customization locally with git installed by running "git clone https://github.com/mozilla/qa-testcase-data.git"
  4. In the Gaia directory, run "git checkout branchname", where branchname equals the branch you are testing (e.g. if you want 1.2, you would run git checkout v1.2). (see #note for modification guide)
  5. In the Gaia directory, run "MOZILLA_OFFICIAL=1 GAIA_DISTRIBUTION_DIR=../qa-testcase-data/customization/reference make production"


  1. Flash the latest build for the version you are aiming to test
  2. Pull Gaia locally with git installed by running "git clone https://github.com/mozilla-b2g/gaia.git"
  3. Using the reference customization from https://github.com/mozilla-b2g/gaia/tree/master/customization (see #note for modification guide)
  4. "MOZILLA_OFFICIAL=1 GAIA_DISTRIBUTION_DIR=customization make production"


If nothing errors out, you should have Gaia 1.2 flashed on top of your daily build with a customization included. At this point, you should be able to do a test run with that customization with the SIM you have included.

Executing Test Cases

For each build you generate, you can only run a subset of test cases that apply to the particular SIM included. For example, if you include a T-Mobile SIM with a MCC = 310 & MNC = 260, then you can run the test cases for that particular SIM. Additionally, not including a SIM means you can only run test cases for the no SIM use cases. Therefore, when running MozTrap test cases for this feature, make sure that you only run the test cases associated with the SIM card you have included. Test cases on Moztrap

Note

  • Default search engine
  • For default customization - customization/search/provider.json
  • For sim specific customization (by MNC/MCC) - customization/variant.json & customization/mobizilla/mobizilla_default_search.json


  • Bookmark
  • For sim specific customization (by MNC/MCC) - customization/variant.json & customization/mobizilla/mobizilla_default_bookmark.json


  • Contacts
  • For sim specific customization (by MNC/MCC) - customization/variant.json & customization/mobizilla/mobizilla_contacts.json


  • Support Contact
  • For sim specific customization (by MNC/MCC) - customization/variant.json & customization/mobizilla/mobizilla_support_contacts.json
  • Add or remove the following line in customization/variant.json

"support_contacts": "mobizilla/mobizilla_support_contacts.json"

  • Add or remove contact in customization/mobizilla/mobizilla_support_contacts.json
  • For default customization - customization/support.json
  • ../qa-testcase-data/customization/nodefaultsupportcontacts


  • Voice Mail
  • For sim specific customization (by MNC/MCC) - shared/resources/apn.json
  • Add or move the following line in the carrier section.

{"voicemail":"555555555","type":["operatorvariant"]}


  • Ringtones
  • For sim specific customization (by MNC/MCC) - customization/variant.json & customization/mobizilla/mobizilla_expected_ringtone.json
  • Add or remove the following lines in customization/variant.json
"ringtone": {
        "path": "mobizilla/mobizilla_ringtone.ogg",
        "name": "Mobizilla ringtone",
        "id": "builtin:mobizilla_ringtone"
      },


  • Wallpaper
  • For sim specific customization (by MNC/MCC) - customization/variant.json & customization/mobizilla/mobizilla_wallpaper.png
  • For default customization - customization/settings.json

"wallpaper.image": "data:image/png;base64,iVBORw0... more HEX here


  • Message settings in Cell & Data/APN settings
  • For sim specific customization (by MNC/MCC) - shared/resources/apn.json

{"carrier":"台灣大哥大(TW Mobile) (MMS)","apn":"MMS","mmsc":"http://mms.catchme.net.qq","mmsproxy":"10.10.10.2","mmsport":"800","type":["mms"]}


  • Keyboard settings
  • For sim specific customization (by MNC/MCC) - customization/variant.json & customization/mobizilla/mobizilla_keyboard.json


  • Network type
  • For sim specific customization (by MNC/MCC) - customization/variant.json & customization/mobizilla/mobizilla_network_type.json
  • (List in settings) Network Type select -> Go to "Settings/Cellular & Data/Network Operator/Network Type"
  • (Icon in quick bar) Current network mode -> A default netowork icon is displayed in the Quick bar (not sure it works)
  • (Text in settings) Cellular data -> Configured operator network text is displayed in "cellular & data" option (not sure it works)
  • (Icon) Network display Indicators -> Network Display Indicator icon in status bar (not sure it works)
  • test cases #11790 #11789


  • Homescreen
  • For vertical home screen - default customization - homescreens.json
  • For horizontal home screen - For sim specific customization (by MNC/MCC) - customization/variant.json & customization/mobizilla/mobizilla_network_type.json


.. more

Reference