[Extensions] Set tabs.executeScript() URLs to chrome-extension: scheme

Set the script URL for scripts executed via chrome.tabs.executeScript()
to use the chrome-extension: scheme, e.g.
chrome-extension://<id>/<path-to-script>, rather than the file URL.
This prevents referencing the filesystem in the URL, and is consistent
with content scripts that are statically specified in the manifest.

Add a regression test (that also tests the statically-defined content
script behavior). This entailed adding a new test utility,
WebContentsConsoleObserver, to track the messages sent to the console
for a given WebContents. This can replace ConsoleObserverDelegate in
the future.

Bug: 714617
Change-Id: I3de400e6dccf9f9a662824b4810bd52245cd4d62
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1962676
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Emily Stark <estark@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726842}
7 files changed