Fix flaky media progress event layout test

Reworks this layout test to use throttling to ensure the media load
(and progress event firing) doesn't end before the test does.

R=acolwell@chromium.org
BUG=280342
TEST=reworked layout test passes locally on Debug linux desktop.

Review URL: https://chromiumcodereview.appspot.com/23583006

git-svn-id: svn://svn.chromium.org/blink/trunk@156883 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Move title encoding fixup code into Document

BUG=277886

Review URL: https://chromiumcodereview.appspot.com/23408002

git-svn-id: svn://svn.chromium.org/blink/trunk@156884 bbb929c8-8fbe-4397-9dbb-9b2b20218538