Make DWDS test server more re-usable
Currently DWDS' TestServer is only being used by context.dart. That's because so much set up is required for the parameters passed to TestServer.start that we are only doing so from the TextContext set up.
We should move a lot of that logic to TestServer itself so that it is lightweight to start with default arguments.
I would like to also make it accessible outside of the DWDS directory (that way we use the test server to start an app to connect to with the debug extension, and then move the debug extension tests to their own directory instead of the dwds directory)
Note: In preparing https://github.com/dart-lang/webdev/pull/1983, I spent a fair amount of time trying to add a test by allowing the TestServer to support embedding. See https://github.com/dart-lang/webdev/commit/252dffd39d788b93aad47bdd770cd6fb6e31a51f for those changes. Unfortunately, we need to make sure the embedded Dart app and the page it is embedded in share the same origin (see error below). Therefore, this is another case to make TestServer more re-usable, by letting it serve multiple apps.
Error:
SecurityError: Blocked a frame with origin "http://localhost:65339" from accessing a cross-origin frame.
Error: Blocked a frame with origin "http://localhost:65339" from accessing a cross-origin frame.
at Object._launchCommunicationWithDebugExtension
This is something we'll probably want to do before moving DWDS into the Dart SDK to avoid having to also move the debug extension into the SDK (although we might want to do that as well?).