Skip to content

Commit

Permalink
Merge pull request #5109 from timvandermeij/strict-equalities-test
Browse files Browse the repository at this point in the history
Use strict equalities in test/*
  • Loading branch information
Snuffleupagus committed Aug 1, 2014
2 parents ad2ea78 + b0349cd commit c0cbf5f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions test/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ window.load = function load() {
var r = new XMLHttpRequest();
r.open('GET', manifestFile, false);
r.onreadystatechange = function loadOnreadystatechange(e) {
if (r.readyState == 4) {
if (r.readyState === 4) {
log('done\n');
manifest = JSON.parse(r.responseText);
currentTaskIdx = 0;
Expand Down Expand Up @@ -132,7 +132,7 @@ function nextTask() {
}

function continueNextTask() {
if (currentTaskIdx == manifest.length) {
if (currentTaskIdx === manifest.length) {
done();
return;
}
Expand Down Expand Up @@ -291,7 +291,7 @@ function nextPage(task, loadError) {
var initPromise = new Promise(function (resolve) {
resolveInitPromise = resolve;
});
if (task.type == 'text') {
if (task.type === 'text') {
// using dummy canvas for pdf context drawing operations
if (!dummyCanvas) {
dummyCanvas = document.createElement('canvas');
Expand Down Expand Up @@ -354,7 +354,7 @@ function sendQuitRequest(cb) {
var r = new XMLHttpRequest();
r.open('POST', '/tellMeToQuit?path=' + escape(appPath), false);
r.onreadystatechange = function sendQuitRequestOnreadystatechange(e) {
if (r.readyState == 4) {
if (r.readyState === 4) {
if (cb) {
cb();
}
Expand Down Expand Up @@ -409,7 +409,7 @@ function send(url, message, callback) {
r.open('POST', url, true);
r.setRequestHeader('Content-Type', 'application/json');
r.onreadystatechange = function sendTaskResultOnreadystatechange(e) {
if (r.readyState == 4) {
if (r.readyState === 4) {
inFlightRequests--;
// Retry until successful
if (r.status !== 200) {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/function_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ describe('function', function() {
this.addMatchers({
toMatchArray: function(expected) {
var actual = this.actual;
if (actual.length != expected.length) {
if (actual.length !== expected.length) {
return false;
}
for (var i = 0; i < expected.length; i++) {
var a = actual[i], b = expected[i];
if (isArray(b)) {
if (a.length != b.length) {
if (a.length !== b.length) {
return false;
}
for (var j = 0; j < a.length; j++) {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/stream_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('stream', function() {
this.addMatchers({
toMatchTypedArray: function(expected) {
var actual = this.actual;
if (actual.length != expected.length) {
if (actual.length !== expected.length) {
return false;
}
for (var i = 0, ii = expected.length; i < ii; i++) {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/testreporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var TestReporter = function(browser, appPath) {
r.open('POST', action, true);
r.setRequestHeader('Content-Type', 'application/json');
r.onreadystatechange = function sendTaskResultOnreadystatechange(e) {
if (r.readyState == 4) {
if (r.readyState === 4) {
// Retry until successful
if (r.status !== 200) {
send(action, json, cb);
Expand Down

0 comments on commit c0cbf5f

Please sign in to comment.