Merge "Adding unit tests for preferred display mode" into tm-dev