Fix running unit tests on Win and Mac

Change-Id: Ie87490a21cc0af5188d31a1a89c567895f925372
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1908568
Reviewed-by: Jan Scheffler <[email protected]>
Commit-Queue: Yang Guo <[email protected]>
Auto-Submit: Yang Guo <[email protected]>
diff --git a/scripts/deps/download_chromium.py b/scripts/deps/download_chromium.py
index 5c8b7e5..0c7364c 100644
--- a/scripts/deps/download_chromium.py
+++ b/scripts/deps/download_chromium.py
@@ -43,7 +43,13 @@
     filehandle, headers = urllib.urlretrieve(options.url)
     zip_file = zipfile.ZipFile(filehandle, 'r')
     zip_file.extractall(path=options.target)
-    os.chmod(EXPECTED_BINARY, 0o555)
+    # Fix permissions. Do this recursively is necessary for MacOS bundles.
+    if os.path.isfile(EXPECTED_BINARY):
+        os.chmod(EXPECTED_BINARY, 0o555)
+    else:
+        for root, dirs, files in os.walk(EXPECTED_BINARY):
+            for f in files:
+                os.chmod(os.path.join(root, f), 0o555)
     with open(BUILD_NUMBER_FILE, 'w') as file:
         file.write(options.build_number)