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

Unified Diff: tracing/tracing/base/unittest/test_suite.html

Issue 2776653002: [ESLint] Fix violations when enabling curly rule in eslint. (Closed)
Patch Set: rebase Created 3 years, 9 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: tracing/tracing/base/unittest/test_suite.html
diff --git a/tracing/tracing/base/unittest/test_suite.html b/tracing/tracing/base/unittest/test_suite.html
index 42cd5dd2469388525639ffb4d6cb24091250ea5a..456878ba210639a122347a6af3043820494d4480 100644
--- a/tracing/tracing/base/unittest/test_suite.html
+++ b/tracing/tracing/base/unittest/test_suite.html
@@ -38,10 +38,12 @@ tr.exportTo('tr.b.unittest', function() {
global.test = function(testCaseOrName, opt_testFn, opt_options) {
if (testCaseOrName instanceof TestCase) {
- if (opt_testFn !== undefined)
+ if (opt_testFn !== undefined) {
throw new Error('opt_testFn cannot be given when giving a TestCase');
- if (opt_options !== undefined)
+ }
+ if (opt_options !== undefined) {
throw new Error('opt_options cannot be given when giving a TestCase');
+ }
this.addTest(testCaseOrName);
return;
}
@@ -49,8 +51,9 @@ tr.exportTo('tr.b.unittest', function() {
var testName = testCaseOrName;
var testFn = opt_testFn;
var options = opt_options || {};
- if (testFn === undefined)
+ if (testFn === undefined) {
throw new Error('Must provide opt_testFn');
+ }
// If the test cares about DPI settings then we first push a test
// that fakes the DPI as the low or hi Dpi version, depending on what
@@ -86,8 +89,9 @@ tr.exportTo('tr.b.unittest', function() {
}.bind(this);
global.timedPerfTest = function(name, testFn, options) {
- if (options === undefined || options.iterations === undefined)
+ if (options === undefined || options.iterations === undefined) {
throw new Error('timedPerfTest must have iteration option provided.');
+ }
this.addTest(new PerfTestCase(name, testFn, options));
}.bind(this);
@@ -107,10 +111,12 @@ tr.exportTo('tr.b.unittest', function() {
},
addTest: function(test) {
- if (test.suite !== undefined)
+ if (test.suite !== undefined) {
throw new Error('Test suite is already assigned');
- if (this.testNames_[test.name] !== undefined)
+ }
+ if (this.testNames_[test.name] !== undefined) {
throw new Error('Test name already used');
+ }
test.suite = this;
this.testNames_[test.name] = true;
this.tests_.push(test);
@@ -122,8 +128,9 @@ tr.exportTo('tr.b.unittest', function() {
};
function testSuite(suiteConstructor) {
- if (!global._currentSuiteLoader)
+ if (!global._currentSuiteLoader) {
throw new Error('testSuites can only be defined during suite loading');
+ }
global._currentSuiteLoader.constructAndRegisterTestSuite(suiteConstructor);
}
« no previous file with comments | « tracing/tracing/base/unittest/test_runner.html ('k') | tracing/tracing/base/unittest/text_test_results.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698