There's no reason `gn test` couldn't support non-local tests. Really all it is is that in the gn file you associate some command and a bunch of dependencies with a target name.
Think about running isolated foo_unittests. Currently I do that like this:
ninja -C some/out/dir foo:foo_unittests_run
python tools/swarming_client/swarming.py run some/out/dir/foo_unittests.isolated
You could do the straightforward thing of adding a "//tools/swarming_client:swarming" and then I would do:
gn test //tools/swarming_client:swarming -- foo_unittests
That approach shares a problem with what we have now, it doesn't ensure that foo_unittests and its dependencies are properly up-to-date. So, how about automatically creating a foo_unittests_isolated runnable target for all (isolatable) unittests and then just do:
gn test //foo:foo_unittests_isolated
This is quite simpler and can ensure that the foo_unittests dependencies are up to date when running the swarming command.
Or something crazy like make the runnable bit of foo_unittests be a script that can do either a local or server based run (and the foo_unittests executable is just off somewhere where the user doesn't care about). And I can do local or server with:
gn test //foo:foo_unittests
and
gn test //foo:foo_unittests -- --swarming