Add cases for types to query args.

Add functional tests coverage for sorting by types. Use document id to
break tie for string sorting as well.

Test: Manual tests on sorting by types. Auto tests pass.
Bug: 38498081
Change-Id: Ib9222ed895812183dab4b2d22c4877f894f3afda
3 files changed