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

Unified Diff: tracing/tracing/base/unittest/test_case.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
« no previous file with comments | « tracing/tracing/base/unittest/suite_loader.html ('k') | tracing/tracing/base/unittest/test_runner.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/base/unittest/test_case.html
diff --git a/tracing/tracing/base/unittest/test_case.html b/tracing/tracing/base/unittest/test_case.html
index 154d313260b7787a24fe59d3da4ae9f01a8d32cf..c990b9b3792f0b92fdecba4d002cfa599bd1b994 100644
--- a/tracing/tracing/base/unittest/test_case.html
+++ b/tracing/tracing/base/unittest/test_case.html
@@ -13,24 +13,27 @@ tr.exportTo('tr.b.unittest', function() {
var TestTypes = tr.b.unittest.TestTypes;
function TestCase(name, opt_testFn, opt_options) {
- if (!name)
+ if (!name) {
throw new Error('Name must be provided');
+ }
this.guid_ = tr.b.GUID.allocateSimple();
this.suite_ = undefined; // Set by TestSuite.addTest.
this.name_ = name;
- if (opt_options)
+ if (opt_options) {
this.options_ = opt_options;
- else
+ } else {
this.options_ = {};
+ }
this.testFn_ = opt_testFn;
}
TestCase.parseFullyQualifiedName = function(fqn) {
var i = fqn.lastIndexOf('.');
- if (i === -1)
+ if (i === -1) {
throw new Error('FullyQualifiedNames must have a period in them');
+ }
return {
suiteName: fqn.substr(0, i),
testCaseName: fqn.substr(i + 1)
@@ -49,8 +52,9 @@ tr.exportTo('tr.b.unittest', function() {
},
set suite(suite) {
- if (this.suite_ !== undefined)
+ if (this.suite_ !== undefined) {
throw new Error('Suite can only be assigned once.');
+ }
this.suite_ = suite;
},
@@ -71,8 +75,9 @@ tr.exportTo('tr.b.unittest', function() {
},
setUp: function() {
- if (this.options_.setUp)
+ if (this.options_.setUp) {
this.options_.setUp.call(this);
+ }
},
run: function(htmlHook) {
@@ -80,8 +85,9 @@ tr.exportTo('tr.b.unittest', function() {
},
tearDown: function() {
- if (this.options_.tearDown)
+ if (this.options_.tearDown) {
this.options_.tearDown.call(this);
+ }
},
// TODO(nduca): The routing of this is a bit awkward. Probably better
« no previous file with comments | « tracing/tracing/base/unittest/suite_loader.html ('k') | tracing/tracing/base/unittest/test_runner.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698