Add the check layout framework for tests.

Also add a test for margins.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/699113002