Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: tools/v8sh.py

Issue 7087014: Support automatic javascript test registry in gtest when creating WebUI tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: undid sorting of .gitignore Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« tools/gypv8sh.py ('K') | « tools/gypv8sh.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/v8sh.py
diff --git a/tools/v8sh.py b/tools/v8sh.py
new file mode 100755
index 0000000000000000000000000000000000000000..b8efdba46699b957fe712389526b20ab31d5596a
--- /dev/null
+++ b/tools/v8sh.py
@@ -0,0 +1,31 @@
+#!/usr/bin/python
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+# This script prints out include dependencies in chrome. Since it ignores
+# defines, it gives just a rough estimation of file size.
+#
+# Usage:
+# in another js script, put the following first line:
+# #!/usr/bin/env tools/v8sh.py
+# --or--
+# python tools/v8sh.py chrome/browser/ui/webui/javascript2webui.js
+# WebUIBrowserTest chrome/test/data/webui/sample_downloads.js
+import json
+import sys
+import tempfile
+import os
+import subprocess
+arguments = "arguments=" + json.dumps(sys.argv[1:])
+jsfilename = sys.argv[1]
+tmpfile = tempfile.NamedTemporaryFile()
+with open(jsfilename) as jsfile:
+ jsfile.readline()
+ for line in jsfile:
+ tmpfile.write(line)
+tmpfile.flush()
+v8_shell = os.path.join(
+ os.path.dirname(os.path.dirname(sys.argv[0])),'out/Debug/v8_shell')
Paweł Hajdan Jr. 2011/06/10 07:38:29 What with Release mode and non-Linux platforms?
Sheridan Rawlins 2011/06/11 18:07:19 Done. (Pass the <(PRODUCT_DIR) to the script).
+cmd = (v8_shell, '-e', arguments, tmpfile.name);
+subprocess.call(cmd);
« tools/gypv8sh.py ('K') | « tools/gypv8sh.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698