Chromium Code Reviews| 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.
|
| +} |