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

Unified Diff: chrome/browser/ui/webui/javascript2webui.js

Issue 7304014: Made Print Preview tests autogenerated from print_preview.js. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Made test_add_library a defaulted parameter with more clear logic. Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/javascript2webui.js
diff --git a/chrome/browser/ui/webui/javascript2webui.js b/chrome/browser/ui/webui/javascript2webui.js
index a61a4adc746ba0d3848434aa530f4e972db64175..3f748cf6bb349c5dfbf835323915be9b9d7d4f96 100644
--- a/chrome/browser/ui/webui/javascript2webui.js
+++ b/chrome/browser/ui/webui/javascript2webui.js
@@ -19,6 +19,9 @@ if (!('test_fixture' in this)) {
print(js_file + ' did not define test_fixture.');
quit(-1);
}
+if (!('test_add_library' in this)) {
+ this['test_add_library'] = true;
+}
print('// GENERATED FILE');
print('// ' + arguments.join(' '));
print('// PLEASE DO NOT HAND EDIT!');
@@ -26,7 +29,9 @@ print();
for (var func in this) {
if (!prevfuncs[func] && this[func] instanceof Function) {
print('IN_PROC_BROWSER_TEST_F(' + test_fixture + ', ' + func + ') {');
- print(' AddLibrary(FilePath(FILE_PATH_LITERAL("' + js_file_base + '")));');
+ if (test_add_library)
+ print(' AddLibrary(FilePath(FILE_PATH_LITERAL("' + js_file_base +
+ '")));');
print(' ASSERT_TRUE(RunJavascriptTest("' + func + '"));');
print('}');
print();

Powered by Google App Engine
This is Rietveld 408576698