New script to downgrade .mojom files from the new to the old mojo types

Following the discussion in chromium-mojo and platform-architecture-dev,
we're proposing to add this script to the chromium repository so that
external repositories that still depend on the old mojo types (e.g.
Android's and ChromeOS's libchrome repos) have a simple and maintained
way to downgrade Chromium's .mojom files to the old syntax, while they
can't support the new one.

This CL includes a new mojom_types_downgrader.py script that can be
integrates with those external builds requiring it, plus the necessary
unit tests to guarantee that the downgraded files can still be parsed
correctly by the bindings generator (i.e. mojom_bindings_generator.py).

For extra context, see the relevant discussion in the chromium-mojo ML:
https://groups.google.com/a/chromium.org/d/msg/chromium-mojo/BRK0Xeu7bgQ/z00hkpaGEQAJ

Bug: 1035484
Change-Id: I4c92345e82a188052b06efce9a1bc749d561cca1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2041759
Commit-Queue: Mario Sanchez Prada <mario@igalia.com>
Reviewed-by: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#745386}
4 files changed