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

Unified Diff: chrome/test/base/js2gtest.js

Issue 320753002: Support javascript gtests in an extension background page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: WS Created 6 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/test/base/js2gtest.js
diff --git a/chrome/test/base/js2gtest.js b/chrome/test/base/js2gtest.js
index 9cf8fef1ffd7970a453bcb7fd841aae2f5c2b199..5c9df0881b8b33a4e52fcfbc6c65f9e33cc2d31b 100644
--- a/chrome/test/base/js2gtest.js
+++ b/chrome/test/base/js2gtest.js
@@ -76,7 +76,8 @@ var genIncludes = [];
/**
* When true, add calls to set_preload_test_(fixture|name). This is needed when
* |testType| === 'browser' to send an injection message before the page loads,
- * but is not required or supported for |testType| === 'unit'.
+ * but is not required or supported for |testType| === 'chromevox' or
+ * |testType| === 'unit'.
* @type {boolean}
*/
var addSetPreloadInfo;
@@ -90,9 +91,17 @@ print();
// Output some C++ headers based upon the |testType|.
//
// Currently supports:
+// 'chromevox' - browser_tests harness, js2chromevox rule, ChromeVoxBrowserTest
+// superclass.
// 'unit' - unit_tests harness, js2unit rule, V8UnitTest superclass.
// 'webui' - browser_tests harness, js2webui rule, WebUIBrowserTest superclass.
-if (testType === 'unit') {
+if (testType === 'chromevox') {
+ print('#include "chrome/browser/resources/chromeos/chromevox/' +
+ 'chromevox_browsertest.h"');
+ testing.Test.prototype.typedefCppFixture = 'ChromeVoxBrowserTest';
+ addSetPreloadInfo = false;
+ testF = 'IN_PROC_BROWSER_TEST_F';
+} else if (testType === 'unit') {
print('#include "chrome/test/base/v8_unit_test.h"');
testing.Test.prototype.typedefCppFixture = 'V8UnitTest';
testF = 'TEST_F';

Powered by Google App Engine
This is Rietveld 408576698