Bug 1098700 - Mochitests that are annotated fails-if don't output a useful error if they unexpectedly pass. r=jmaher
☠☠ backed out by 8850aa0f5332 ☠ ☠
authorKaustabh Datta Choudhury <kaustabh93@gmail.com>
Tue, 23 Dec 2014 23:58:00 -0500
changeset 238118 9e126e97e3470194832c2c799307e331aeaafe8c
parent 238117 cbfba445b09eb452e8fa9ea7ad6eac64017647cf
child 238119 a0315fb0c4f91e2611fd5f9993bba246ac8cc791
push id7472
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 20:36:27 +0000
treeherdermozilla-aurora@300ca104f8fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1098700
milestone37.0a1
Bug 1098700 - Mochitests that are annotated fails-if don't output a useful error if they unexpectedly pass. r=jmaher
testing/mochitest/tests/SimpleTest/SimpleTest.js
--- a/testing/mochitest/tests/SimpleTest/SimpleTest.js
+++ b/testing/mochitest/tests/SimpleTest/SimpleTest.js
@@ -254,17 +254,17 @@ SimpleTest.setExpected();
 SimpleTest.ok = function (condition, name, diag) {
 
     var test = {'result': !!condition, 'name': name, 'diag': diag};
     if (SimpleTest.expected == 'fail') {
       if (!test.result) {
         SimpleTest.num_failed++;
         test.result = !test.result;
       }
-      var successInfo = {status:"PASS", expected:"PASS", message:"TEST-PASS"};
+      var successInfo = {status:"PASS", expected:"FAIL", message:"TEST-UNEXPECTED-PASS"};
       var failureInfo = {status:"FAIL", expected:"FAIL", message:"TEST-KNOWN-FAIL"};
     } else {
       var successInfo = {status:"PASS", expected:"PASS", message:"TEST-PASS"};
       var failureInfo = {status:"FAIL", expected:"PASS", message:"TEST-UNEXPECTED-FAIL"};
     }
     SimpleTest._logResult(test, successInfo, failureInfo);
     SimpleTest._tests.push(test);
 };