Relands "Adds the metadata optional field to the standard JSON results"

This CL had to be reverted because GPU bots were failing because the
results_merger.py script could not handle the test_name_prefix field
that was still getting populated in the JSON results. This CL will
add the metadata field along side the test_name_prefix field in the
Optional fields list in the results_merger.py script. It also removes
the checking of test_name_prefix in the gpu unit tests because the
test_name_prefix field will be removed from the top level of the
results in a future CL.

Bug: chromium:698902
Change-Id: I4867e60ca5a97d426d5fd1a4de08e26c14d326ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1559492
Commit-Queue: Rakib Hasan <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Cr-Commit-Position: refs/heads/master@{#649665}
diff --git a/docs/testing/json_test_results_format.md b/docs/testing/json_test_results_format.md
index fce9ccc5..ed62ae04 100644
--- a/docs/testing/json_test_results_format.md
+++ b/docs/testing/json_test_results_format.md
@@ -86,9 +86,8 @@
 | `artifact_permanent_location` | string | **Optional.** The URI of the root location where the artifacts are stored. If present, any artifact locations are taken to be relative to this location. Currently only the `gs://` scheme is supported. |
 | `build_number` | string | **Optional.** If this test run was produced on a bot, this should be the build number of the run, e.g., "1234". |
 | `builder_name` | string | **Optional.** If this test run was produced on a bot, this should be the builder name of the bot, e.g., "Linux Tests". |
+| `metadata` | dict | **Optional.** It maps to a dictionary that contains all the key value pairs used as metadata. This dictionary also includes the tags, test name prefix and test expectations file paths used during a test run. |
 | `test_name_prefix` | string | **Optional.** If a prefix was specified to be removed from test names, then that prefix can be placed here. |
-| `expectations_files` | array of strings | **Optional.** If a list of expectations file paths are passed to the test runner, then that list can be placed here. |
-| `tags` | array of strings | **Optional.** If a list of test expectations file tags are passed to the test runner, then that list can be placed here. |
 | `chromium_revision` | string | **Optional.** The revision of the current Chromium checkout, if relevant, e.g. "356123". |
 | `has_pretty_patch` | bool | **Optional, layout test specific, deprecated.** Whether the web tests' output contains PrettyDiff-formatted diffs for test failures. |
 | `has_wdiff` | bool | **Optional, layout test specific, deprecated.** Whether the web tests' output contains wdiff-formatted diffs for test failures. |