Page: Attach unit test delegated handler to document instead

Closes gh-7235
Fixes gh-7234