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

Unified Diff: chrome/browser/ui/webui/javascript2webui.js

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
Index: chrome/browser/ui/webui/javascript2webui.js
diff --git a/chrome/browser/ui/webui/javascript2webui.js b/chrome/browser/ui/webui/javascript2webui.js
new file mode 100755
index 0000000000000000000000000000000000000000..4f6c2d21e133d45149b05d771f9464ca5a29464b
--- /dev/null
+++ b/chrome/browser/ui/webui/javascript2webui.js
@@ -0,0 +1,23 @@
+#!tools/v8sh.py
Paweł Hajdan Jr. 2011/06/10 07:38:29 I'm not sure that this shebang with a relative pat
Sheridan Rawlins 2011/06/11 18:07:19 Removed in favor of passing paths in (from gyp/pyt
+// 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.
+if (arguments.length < 3) {
+ print('usage: ' + arguments[0] + ' test_fixture testfile.js');
+ quit();
+}
+var test_fixture = arguments[1];
+var js_file = arguments[2];
+var prevfuncs = {};
+for (var func in this) {
+ if (this[func] instanceof Function)
+ prevfuncs[func] = func;
+}
+var js = load(js_file);
+print('// GENERATED FILE (from');
Paweł Hajdan Jr. 2011/06/10 07:38:29 Please add an info what tool generated this file.
Sheridan Rawlins 2011/06/11 18:07:19 Done.
+print('// ' + arguments[0] + ').');
+print('// PLEASE DO NOT HAND EDIT!');
+for (var func in this) {
+ if (!prevfuncs[func] && this[func] instanceof Function)
+ print('WEB_UI_UNITTEST_F(' + test_fixture + ', ' + func + ');');
Paweł Hajdan Jr. 2011/06/10 07:38:29 Could you remove the WEB_UI_UNITTEST_F macro and j
Sheridan Rawlins 2011/06/11 18:07:19 Done.
+}
« no previous file with comments | « .gitignore ('k') | chrome/browser/ui/webui/web_ui_browsertest.cc » ('j') | tools/gypv8sh.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698