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

Issue 8438063: Make it possible to include another file and port print_preview unit test to unit_tests. (Closed)

Created:
9 years, 1 month ago by Sheridan Rawlins
Modified:
9 years, 1 month ago
CC:
chromium-reviews, arv (Not doing code reviews), Paweł Hajdan Jr., mmenke, David Tseng
Visibility:
Public.

Description

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.* Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=109310

Patch Set 1 #

Total comments: 36

Patch Set 2 : Address code review comments. #

Patch Set 3 : Fix failing win. #

Patch Set 4 : Added comments for js2gtest.js. #

Patch Set 5 : Add descriptions to TEST_F's params. #

Total comments: 4

Patch Set 6 : Made cp.py script since it's fairly general. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+285 lines, -193 lines) Patch
A build/cp.py View 1 2 3 4 5 1 chunk +18 lines, -0 lines 2 comments Download
D chrome/browser/resources/print_preview/print_preview_utils_test.html View 1 chunk +0 lines, -110 lines 0 comments Download
A + chrome/browser/resources/print_preview/print_preview_utils_unittest.gtestjs View 1 6 chunks +38 lines, -35 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 5 chunks +23 lines, -4 lines 0 comments Download
M chrome/test/base/js2gtest.js View 1 2 3 4 5 chunks +109 lines, -3 lines 0 comments Download
A chrome/test/data/unit/framework_unittest.gtestjs View 1 1 chunk +44 lines, -0 lines 0 comments Download
M chrome/test/data/webui/test_api.js View 1 5 chunks +53 lines, -41 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
Sheridan Rawlins
Auxiliary files can be included with addLibraries (in the case where the test file is ...
9 years, 1 month ago (2011-11-03 02:19:06 UTC) #1
dpapad
Another reviewer should be added for the gyp changes as I am not familiar with ...
9 years, 1 month ago (2011-11-03 16:14:34 UTC) #2
arv (Not doing code reviews)
Can we name these files *.gtest.js instead? http://codereview.chromium.org/8438063/diff/1/chrome/browser/resources/print_preview/print_preview_utils_unittest.gtestjs File chrome/browser/resources/print_preview/print_preview_utils_unittest.gtestjs (right): http://codereview.chromium.org/8438063/diff/1/chrome/browser/resources/print_preview/print_preview_utils_unittest.gtestjs#newcode16 chrome/browser/resources/print_preview/print_preview_utils_unittest.gtestjs:16: addLibraries: [ ...
9 years, 1 month ago (2011-11-03 19:04:12 UTC) #3
Sheridan Rawlins
Brad, can you review the gyp changes, and address Arv's question: arv: Can we name ...
9 years, 1 month ago (2011-11-05 16:51:25 UTC) #4
Sheridan Rawlins
Added comments, shortened the push call, and asked arv for more clarification about the use ...
9 years, 1 month ago (2011-11-05 22:28:02 UTC) #5
bradn
http://codereview.chromium.org/8438063/diff/15001/chrome/chrome_tests.gypi File chrome/chrome_tests.gypi (right): http://codereview.chromium.org/8438063/diff/15001/chrome/chrome_tests.gypi#newcode1990 chrome/chrome_tests.gypi:1990: '-c', 'import shutil,sys; shutil.copyfile(sys.argv[1], sys.argv[2])', Minor nit. It might ...
9 years, 1 month ago (2011-11-07 06:10:37 UTC) #6
Sheridan Rawlins
Regarding suffixing in .gtest.js, a quick first pass reveals that gyp doesn't support it currently. ...
9 years, 1 month ago (2011-11-08 01:11:49 UTC) #7
dpapad
LGTM.
9 years, 1 month ago (2011-11-08 01:17:53 UTC) #8
arv (Not doing code reviews)
lgtm http://codereview.chromium.org/8438063/diff/1/chrome/test/base/js2gtest.js File chrome/test/base/js2gtest.js (right): http://codereview.chromium.org/8438063/diff/1/chrome/test/base/js2gtest.js#newcode57 chrome/test/base/js2gtest.js:57: var browsePreload = this[testFixture].prototype.browsePreload; var proto = this[testFixture].prototype; ...
9 years, 1 month ago (2011-11-09 03:02:05 UTC) #9
bradn
Lgtm On Nov 8, 2011 7:02 PM, <arv@chromium.org> wrote: > lgtm > > > > ...
9 years, 1 month ago (2011-11-09 05:13:24 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/scr@chromium.org/8438063/20001
9 years, 1 month ago (2011-11-09 05:22:00 UTC) #11
commit-bot: I haz the power
Try job failure for 8438063-20001 (retry) (retry) (retry) on win_rel for step "chrome_frame_net_tests". It's a ...
9 years, 1 month ago (2011-11-09 07:32:04 UTC) #12
M-A Ruel
http://codereview.chromium.org/8438063/diff/20001/build/cp.py File build/cp.py (right): http://codereview.chromium.org/8438063/diff/20001/build/cp.py#newcode1 build/cp.py:1: #!/usr/bin/python This file is not needed. Use the gyp ...
9 years, 1 month ago (2011-11-23 03:06:37 UTC) #13
bradn
9 years, 1 month ago (2011-11-23 04:11:00 UTC) #14
http://codereview.chromium.org/8438063/diff/20001/build/cp.py
File build/cp.py (right):

http://codereview.chromium.org/8438063/diff/20001/build/cp.py#newcode1
build/cp.py:1: #!/usr/bin/python
On 2011/11/23 03:06:38, Marc-Antoine Ruel wrote:
> This file is not needed. Use the gyp action 'copies' instead.

Copies doesn't work for his use case, as he need something that applies to each
instance of a rule.

Powered by Google App Engine
This is Rietveld 408576698