Port shared test runner logic into separate package

The shared test runner logic was reimplementing parts of Mocha,
in particular the test logging and filtering. Moreover, it was
booting the hosted mode server and puppeteer outside of Mocha.

Mocha supports root level hooks [1]. These hooks allow us to
perform work before a test starts. Moreover, by using the
before and after hook, we can run logic before and after
all tests.

By using these hooks, we can extract the "boot the hosted mode
server and hookup puppeteer" part to these root hooks.
Additionally, we can reset the pages in the `beforeEach`, which
means that tests themselves don't have to reset the pages.

We also put the implementation code into third_party/conductor,
as we would like to reuse this logic for the Puppeteer tests.
The Puppeteer test suite now also uses Mocha and has very
similar requirements as to our DevTools tests. By extracting
from DevTools, we can look into expanding the test runner to
other usecases, but that is out of scope for now.

[1]: https://mochajs.org/#root-level-hooks

Bug: 1071369

Change-Id: Ie9f954359d9de84da564b74b6f5517dd535db008
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2150458
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
diff --git a/scripts/devtools_paths.py b/scripts/devtools_paths.py
index 035c5fa..543cfa6 100644
--- a/scripts/devtools_paths.py
+++ b/scripts/devtools_paths.py
@@ -58,6 +58,10 @@
     return path.join(node_modules_path(), 'eslint', 'bin', 'eslint.js')
 
 
+def mocha_path():
+    return path.join(node_modules_path(), 'mocha', 'bin', 'mocha')
+
+
 def check_localizable_resources_path():
     return path.join(devtools_root_path(), 'scripts', 'localization', 'check_localizable_resources.js')