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

Unified Diff: chrome/chrome_tests.gypi

Issue 8418015: Allow javascript unit tests using webui test_api framework. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing dependency on v8_shell. Created 9 years, 1 month 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/chrome_tests.gypi
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 8fe4a930efd43d6ba831a90ab89484b856b56bcb..ca34fde68cf119dfd3f70cd8ca7ce353e1f196a0 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -4,6 +4,13 @@
{
'variables' : {
+ # Variables for js2gtest rules
+ 'gypv8sh': '../tools/gypv8sh.py',
+ 'js2gtest': 'test/base/js2gtest.js',
+ 'js2gtest_out_dir': '<(SHARED_INTERMEDIATE_DIR)/js2gtest',
+ 'mock_js': 'third_party/mock4js/mock4js.js',
+ 'test_api_js': 'test/data/webui/test_api.js',
+
'pyautolib_sources': [
'app/chrome_command_ids.h',
'app/chrome_dll_resource.h',
@@ -1937,6 +1944,7 @@
'test/base/v8_unit_test.cc',
'test/base/v8_unit_test.h',
'test/data/resource.rc',
+ 'test/data/unit/framework_unittest.js',
'tools/convert_dict/convert_dict_unittest.cc',
'../content/browser/renderer_host/render_widget_host_unittest.cc',
'../content/browser/renderer_host/text_input_client_mac_unittest.mm',
@@ -1958,7 +1966,40 @@
'../webkit/quota/mock_storage_client.cc',
'../webkit/quota/mock_storage_client.h',
],
+ 'rules': [
+ {
+ 'rule_name': 'js2unit',
+ 'extension': 'js',
+ 'msvs_external_rule': 1,
+ 'inputs': [
+ '<(gypv8sh)',
+ '<(PRODUCT_DIR)/v8_shell<(EXECUTABLE_SUFFIX)',
+ '<(mock_js)',
+ '<(test_api_js)',
+ '<(js2gtest)',
+ ],
+ 'outputs': [
+ '<(js2gtest_out_dir)/chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).cc',
+ '<(PRODUCT_DIR)/test_data/chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).js',
+ ],
+ 'process_outputs_as_sources': 1,
+ 'action': [
+ 'python',
+ '<@(_inputs)',
+ 'unit',
+ '<(RULE_INPUT_PATH)',
+ 'chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).js',
+ '<@(_outputs)',
+ ],
+ },
+ ],
'conditions': [
+ ['target_arch!="arm"', {
+ 'dependencies': [
+ # build time dependency.
+ '../v8/tools/gyp/v8.gyp:v8_shell#host',
+ ],
+ }],
['p2p_apis==1', {
'sources': [
'../content/browser/renderer_host/p2p/socket_host_test_utils.h',
@@ -2271,13 +2312,6 @@
'type': 'executable',
'msvs_cygwin_shell': 0,
'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
- 'variables': {
- 'gypv8sh': '../tools/gypv8sh.py',
- 'js2webui': 'browser/ui/webui/javascript2webui.js',
- 'js2webui_out_dir': '<(SHARED_INTERMEDIATE_DIR)/js2webui',
- 'mock_js': 'third_party/mock4js/mock4js.js',
- 'test_api_js': 'test/data/webui/test_api.js',
- },
'dependencies': [
'browser',
'browser/sync/protocol/sync_proto.gyp:sync_proto',
@@ -2632,16 +2666,17 @@
'<(PRODUCT_DIR)/v8_shell<(EXECUTABLE_SUFFIX)',
'<(mock_js)',
'<(test_api_js)',
- '<(js2webui)',
+ '<(js2gtest)',
],
'outputs': [
- '<(js2webui_out_dir)/chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).cc',
+ '<(js2gtest_out_dir)/chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).cc',
'<(PRODUCT_DIR)/test_data/chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).js',
],
'process_outputs_as_sources': 1,
'action': [
'python',
'<@(_inputs)',
+ 'webui',
'<(RULE_INPUT_PATH)',
'chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).js',
'<@(_outputs)',

Powered by Google App Engine
This is Rietveld 408576698