Bug 860344 - Define mocks based on document domain

Instead of inferring the document's domain from the `location` object,
query the global `document.domain` string. This approach acheives the
desired behavior for iFrames that do not declare a `src` attribute (in
such cases, `location.toString()` yeilds "about:blank", but
`document.domain` correctly returns the domain of the parent document.
Merge pull request #9098 from jugglinmike/860344-desktop-helper-in-tests

Define mocks based on document domain