--disable-extensions-except causes the extensions at the given paths to be loaded and then added to a whitelist.
If the extension finishes being installed synchronously, then it is added to the ExtensionService before the whitelist is updated, so it is not enabled. (The whitelist uses the extension ID, so that may be why we add the ID to the whitelist after creating the Extension, but it creates this assumption.)
This works because UnpackedInstaller runs a RequirementsChecker check, which always posts its callback asynchronously. Is it valid to assume extensions are loaded from the command line asynchronously? Or can we allow checks like RequirementsChecker to finish synchronously?
The CL where this came up (because it caused DisableExtensionsExceptBrowserTest.DisableExtensionsExceptFlag to fail) is: https://codereview.chromium.org/2783813002/
Comment 1 by rdevlin....@chromium.org
, Apr 5 2017