Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview Generator script for creating gtest-style JavaScript | 6 * @fileoverview Generator script for creating gtest-style JavaScript |
| 7 * tests for WebUI and unit tests. Generates C++ gtest wrappers | 7 * tests for WebUI and unit tests. Generates C++ gtest wrappers |
| 8 * which will invoke the appropriate JavaScript for each test. | 8 * which will invoke the appropriate JavaScript for each test. |
| 9 * @author scr@chromium.org (Sheridan Rawlins) | 9 * @author scr@chromium.org (Sheridan Rawlins) |
| 10 * @see WebUI testing: http://goo.gl/ZWFXF | 10 * @see WebUI testing: http://goo.gl/ZWFXF |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 testGenPreamble(testFixture, testFunction); | 180 testGenPreamble(testFixture, testFunction); |
| 181 if (browsePreload) | 181 if (browsePreload) |
| 182 print(' BrowsePreload(GURL("' + browsePreload + '"));'); | 182 print(' BrowsePreload(GURL("' + browsePreload + '"));'); |
| 183 if (browsePrintPreload) { | 183 if (browsePrintPreload) { |
| 184 print(' BrowsePrintPreload(GURL(WebUITestDataPathToURL(\n' + | 184 print(' BrowsePrintPreload(GURL(WebUITestDataPathToURL(\n' + |
| 185 ' FILE_PATH_LITERAL("' + browsePrintPreload + '"))));'); | 185 ' FILE_PATH_LITERAL("' + browsePrintPreload + '"))));'); |
| 186 } | 186 } |
| 187 print(' ' + testPredicate + '(RunJavascriptTestF(' + isAsyncParam + | 187 print(' ' + testPredicate + '(RunJavascriptTestF(' + isAsyncParam + |
| 188 '"' + testFixture + '", ' + | 188 '"' + testFixture + '", ' + |
| 189 '"' + testFunction + '"));'); | 189 '"' + testFunction + '"));'); |
| 190 print(' ' + testPredicate + '(RunJavascriptTestF(' + isAsyncParam + | |
|
Sheridan Rawlins
2012/11/29 17:43:48
Is there any mechanism for sheriffs to disable onl
dmazzoni
2012/11/29 18:44:33
I like this idea, but I think there should be a wa
aboxhall
2012/11/30 00:56:27
I agree - perhaps it could be more along the lines
dmazzoni
2012/11/30 19:22:31
If we use TEST_F it should be as a way to add a ne
| |
| 191 '"' + testFixture + '", ' + | |
| 192 '"accessibilityAudit"));'); | |
|
Sheridan Rawlins
2012/11/29 17:43:48
I'm confused - is this adding one call to accessib
dmazzoni
2012/11/29 18:44:33
I think there may be many cases when running once
Sheridan Rawlins
2012/11/29 18:58:54
This js test infra generates C++ gtest tests - I'm
aboxhall
2012/11/30 00:56:27
Where would the explicit TEST_F be added? Would it
| |
| 190 if (testGenPostamble) | 193 if (testGenPostamble) |
| 191 testGenPostamble(testFixture, testFunction); | 194 testGenPostamble(testFixture, testFunction); |
| 192 print('}'); | 195 print('}'); |
| 193 print(); | 196 print(); |
| 194 } | 197 } |
| 195 | 198 |
| 196 // Now that generation functions are defined, load in |jsFile|. | 199 // Now that generation functions are defined, load in |jsFile|. |
| 197 var js = read(jsFile); | 200 var js = read(jsFile); |
| 198 eval(js); | 201 eval(js); |
| OLD | NEW |