diff options
author | scr@chromium.org <scr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-09 21:55:09 +0000 |
---|---|---|
committer | scr@chromium.org <scr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-09 21:55:09 +0000 |
commit | e010983a890901bb8dfdc5fc19043dd5faf7a330 (patch) | |
tree | 933cc0ba796fbec00b8f38e1af208f0cb998bfb4 /chrome/chrome_tests.gypi | |
parent | 698415277ea798691a713c39c43af91a3d7a0dfc (diff) | |
download | chromium_src-e010983a890901bb8dfdc5fc19043dd5faf7a330.zip chromium_src-e010983a890901bb8dfdc5fc19043dd5faf7a330.tar.gz chromium_src-e010983a890901bb8dfdc5fc19043dd5faf7a330.tar.bz2 |
Make it possible to include another file and port print_preview unit test to unit_tests.
Print Preview unit_tests were good to tackle because it brought in a dependency on the need
to include another js file.
This also hilighted another need - that of being able to include non-generative js files in gyp
and have them copied to the test_data dir, while doing both generation and copy for gtest files.
I changed the "extension" of files which generate C++ with gtest-like syntax to .gtestjs and
added a copyjs rule to the chrome_tests.gypi.
FWIW, I believe this is mostly needed for unit_tests and only applied it there, although I would
be amenable to also making this change for the webui tests to make it clear that they are not
plain js files.
R=dpapad@chromium.org
BUG=101443,102222
TEST=unit_tests --gtest_filter=PrintPreviewUtilsUnitTest.*
Review URL: http://codereview.chromium.org/8438063
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109310 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/chrome_tests.gypi')
-rw-r--r-- | chrome/chrome_tests.gypi | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 615623a..b6c52df 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -1531,6 +1531,8 @@ 'browser/profiles/profile_info_cache_unittest.cc', 'browser/profiles/profile_manager_unittest.cc', 'browser/renderer_host/web_cache_manager_unittest.cc', + 'browser/resources/print_preview/print_preview_utils.js', + 'browser/resources/print_preview/print_preview_utils_unittest.gtestjs', 'browser/resources_util_unittest.cc', 'browser/rlz/rlz_unittest.cc', 'browser/safe_browsing/bloom_filter_unittest.cc', @@ -1956,7 +1958,7 @@ 'test/base/v8_unit_test.cc', 'test/base/v8_unit_test.h', 'test/data/resource.rc', - 'test/data/unit/framework_unittest.js', + 'test/data/unit/framework_unittest.gtestjs', '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', @@ -1980,10 +1982,27 @@ ], 'rules': [ { - 'rule_name': 'js2unit', + 'rule_name': 'copyjs', 'extension': 'js', 'msvs_external_rule': 1, 'inputs': [ + '../build/cp.py', + ], + 'outputs': [ + '<(PRODUCT_DIR)/test_data/chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).<(_extension)', + ], + 'action': [ + 'python', + '<@(_inputs)', + '<(RULE_INPUT_PATH)', + '<@(_outputs)', + ], + }, + { + 'rule_name': 'js2unit', + 'extension': 'gtestjs', + 'msvs_external_rule': 1, + 'inputs': [ '<(gypv8sh)', '<(PRODUCT_DIR)/v8_shell<(EXECUTABLE_SUFFIX)', '<(mock_js)', @@ -1992,7 +2011,7 @@ ], 'outputs': [ '<(js2gtest_out_dir)/chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).cc', - '<(PRODUCT_DIR)/test_data/chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).js', + '<(PRODUCT_DIR)/test_data/chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).<(_extension)', ], 'process_outputs_as_sources': 1, 'action': [ @@ -2000,7 +2019,7 @@ '<@(_inputs)', 'unit', '<(RULE_INPUT_PATH)', - 'chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).js', + 'chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).<(_extension)', '<@(_outputs)', ], }, |