authpolicy: Add unit test for DevicePolicyEncoder

Makes sure that all device policies get encoded into protobuf
properly.

Gets rid of a weird hack for integer and boolean policies to make
sure that EncodeInteger and EncodeBoolean wasn't mixed up. If the
two are mixed up now, the unit test fails since the policy is not
actually encoded.

Uses recent changes to generate_policy_source.py to make sure that
all device policies are actually handled and unit tested. Thus, if
protofiles gets uprev'ed and the uprev'er forgets to add new device
policies, this unit test fails.

BUG=chromium:659101
TEST=Compiled, ran tests, made sure it works as described here.

Change-Id: If655f967c231715ded31959d5f8abbaa1577f21a
Reviewed-on: https://chromium-review.googlesource.com/462966
Commit-Ready: Lutz Justen <ljusten@chromium.org>
Tested-by: Lutz Justen <ljusten@chromium.org>
Reviewed-by: Roman Sorokin <rsorokin@chromium.org>
4 files changed