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

Side by Side Diff: chrome/browser/ui/webui/javascript2webui.js

Issue 8333013: Allow generator javascript test files to go anywhere in the source tree (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Nits. Created 9 years, 2 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/options_browsertest.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 if (arguments.length < 3) { 4 if (arguments.length < 3) {
5 print('usage: ' + 5 print('usage: ' +
6 arguments[0] + ' path-to-testfile.js testfile.js [output.cc]'); 6 arguments[0] + ' path-to-testfile.js testfile.js [output.cc]');
7 quit(-1); 7 quit(-1);
8 } 8 }
9 var jsFile = arguments[1]; 9 var jsFile = arguments[1];
10 var jsFileBase = arguments[2]; 10 var jsFileBase = arguments[2];
(...skipping 26 matching lines...) Expand all
37 var testPredicate = testShouldFail ? 'ASSERT_FALSE' : 'ASSERT_TRUE'; 37 var testPredicate = testShouldFail ? 'ASSERT_FALSE' : 'ASSERT_TRUE';
38 38
39 if (typedefCppFixture && !(testFixture in typedeffedCppFixtures)) { 39 if (typedefCppFixture && !(testFixture in typedeffedCppFixtures)) {
40 print('typedef ' + typedefCppFixture + ' ' + testFixture + ';'); 40 print('typedef ' + typedefCppFixture + ' ' + testFixture + ';');
41 typedeffedCppFixtures[testFixture] = typedefCppFixture; 41 typedeffedCppFixtures[testFixture] = typedefCppFixture;
42 } 42 }
43 43
44 print('IN_PROC_BROWSER_TEST_F(' + testFixture + ', ' + testFunction + ') {'); 44 print('IN_PROC_BROWSER_TEST_F(' + testFixture + ', ' + testFunction + ') {');
45 if (testGenPreamble) 45 if (testGenPreamble)
46 testGenPreamble(testFixture, testFunction); 46 testGenPreamble(testFixture, testFunction);
47 print(' AddLibrary(FilePath(FILE_PATH_LITERAL("' + jsFileBase + '")));'); 47 print(' AddLibrary(FilePath(FILE_PATH_LITERAL("' +
48 jsFileBase.replace(/\\/g, '/') + '")));');
48 if (browsePreload) { 49 if (browsePreload) {
49 print(' BrowsePreload(GURL("' + browsePreload + '"), "' + testFixture + 50 print(' BrowsePreload(GURL("' + browsePreload + '"), "' + testFixture +
50 '", "' + testFunction + '");'); 51 '", "' + testFunction + '");');
51 } 52 }
52 if (browsePrintPreload) { 53 if (browsePrintPreload) {
53 print(' BrowsePrintPreload(GURL(WebUITestDataPathToURL(\n' + 54 print(' BrowsePrintPreload(GURL(WebUITestDataPathToURL(\n' +
54 ' FILE_PATH_LITERAL("' + browsePrintPreload + '"))),\n' + 55 ' FILE_PATH_LITERAL("' + browsePrintPreload + '"))),\n' +
55 ' "' + testFixture + '", "' + testFunction + '");'); 56 ' "' + testFixture + '", "' + testFunction + '");');
56 } 57 }
57 print(' ' + testPredicate + '(RunJavascriptTestF(' + isAsync + ', ' + 58 print(' ' + testPredicate + '(RunJavascriptTestF(' + isAsync + ', ' +
58 '"' + testFixture + '", ' + 59 '"' + testFixture + '", ' +
59 '"' + testFunction + '"));'); 60 '"' + testFunction + '"));');
60 if (testGenPostamble) 61 if (testGenPostamble)
61 testGenPostamble(testFixture, testFunction); 62 testGenPostamble(testFixture, testFunction);
62 print('}'); 63 print('}');
63 print(); 64 print();
64 } 65 }
65 66
66 var js = read(jsFile); 67 var js = read(jsFile);
67 eval(js); 68 eval(js);
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/options_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698