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

Unified Diff: chrome_test/chrome_test.js

Issue 1415743013: Run jshint over all JavaScript files (Closed) Base URL: https://chromium.googlesource.com/external/naclports.git@repo_conf
Patch Set: Created 5 years, 1 month 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 | « build_tools/pipeserver.js ('k') | chrome_test/tcpapp/tcp.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_test/chrome_test.js
diff --git a/chrome_test/chrome_test.js b/chrome_test/chrome_test.js
index dc51ce221656e2fa93d965187a13bcbf3e88580f..06fbd9a33ef0532f8939583e5d2926beb3f8f9b6 100644
--- a/chrome_test/chrome_test.js
+++ b/chrome_test/chrome_test.js
@@ -87,7 +87,7 @@ chrometest.resetExtension = function() {
port.disconnect();
return msg.count;
});
-}
+};
/**
* Get a list of all loaded extensions.
@@ -232,7 +232,7 @@ chrometest.httpGet = function(url) {
reject(r.status);
}
}
- }
+ };
r.send();
});
};
@@ -280,7 +280,7 @@ chrometest.reportTestCount_ = function(testCount) {
*/
chrometest.beginTest_ = function(name) {
return chrometest.resetExtension().then(function(count) {
- if (count != 0) {
+ if (count !== 0) {
throw new Error(
'Test extension connections from the last test remain active!');
}
@@ -307,12 +307,14 @@ chrometest.endTest_ = function() {
var duration = endTime.getTime() - chrometest.startTime_.getTime();
duration = chrometest.formatDuration(duration);
var name = chrometest.currentTestName_;
+ var resultMsg;
+ var result;
if (chrometest.passed_) {
- var resultMsg = ' OK';
- var result = 1;
+ resultMsg = ' OK';
+ result = 1;
} else {
- var resultMsg = ' FAILED ';
- var result = 0;
+ resultMsg = ' FAILED ';
+ result = 0;
}
console.log('[ ' + resultMsg + ' ] ' + name + ' (' + duration + ')');
chrometest.startTime_ = null;
@@ -436,20 +438,22 @@ chrometest.wildcardMatch = function(filter, s) {
*/
chrometest.filterMatch = function(filter, s) {
var parts = filter.split('-');
+ var positive;
+ var negative;
if (parts.length == 1) {
- var positive = parts[0].split(':');
- var negative = [];
+ positive = parts[0].split(':');
+ negative = [];
} else if (parts.length == 2) {
- var positive = parts[0].split(':');
- var negative = parts[1].split(':');
+ positive = parts[0].split(':');
+ negative = parts[1].split(':');
} else {
// Treat ill-formated filters as non-matches.
return false;
}
- if (positive.length == 1 && positive[0] == '') {
+ if (positive.length == 1 && positive[0] === '') {
positive = ['*'];
}
- if (negative.length == 1 && negative[0] == '') {
+ if (negative.length == 1 && negative[0] === '') {
negative = [];
}
for (var i = 0; i < positive.length; i++) {
@@ -713,16 +717,16 @@ chrometest.Test.prototype.tearDown = function() {
/**
* Register a test case using a fixture class.
- * @param {string} fixtureClass The test fixture class object.
+ * @param {string} FixtureClass The test fixture class object.
* @param {string} testName The name of the test.
* @param {function()} testFunc Called to run the test, may return
* a Promise.
* @param {string} opt_caseName Optional name for the case, otherwise the
- * fixtureClass class name is used.
+ * FixtureClass class name is used.
*/
-function TEST_F(fixtureClass, testName, testFunc, opt_caseName) {
- if (opt_caseName == undefined) {
- opt_caseName = fixtureClass.name;
+function TEST_F(FixtureClass, testName, testFunc, opt_caseName) {
+ if (opt_caseName === undefined) {
+ opt_caseName = FixtureClass.name;
}
var fullName = opt_caseName + '.' + testName;
chrometest.tests_.push({
@@ -731,7 +735,7 @@ function TEST_F(fixtureClass, testName, testFunc, opt_caseName) {
return Promise.resolve().then(function() {
return chrometest.beginTest_(fullName);
}).then(function() {
- chrometest.currentTest_ = new fixtureClass();
+ chrometest.currentTest_ = new FixtureClass();
return Promise.resolve().then(function() {
return chrometest.currentTest_.setUp();
}).then(function() {
« no previous file with comments | « build_tools/pipeserver.js ('k') | chrome_test/tcpapp/tcp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698