summaryrefslogtreecommitdiffstats
path: root/chrome/third_party
diff options
context:
space:
mode:
authorplundblad@chromium.org <plundblad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-26 18:25:48 +0000
committerplundblad@chromium.org <plundblad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-26 18:25:48 +0000
commitbc330ea7b30265b6d2e3e37b31f69b64fe3d329f (patch)
treed0c8fcf8a2a385298918990d2c6acc4ffde8bb50 /chrome/third_party
parent6b9f2c3bf4f353e428b5ac1917795fd9c8b13dbc (diff)
downloadchromium_src-bc330ea7b30265b6d2e3e37b31f69b64fe3d329f.zip
chromium_src-bc330ea7b30265b6d2e3e37b31f69b64fe3d329f.tar.gz
chromium_src-bc330ea7b30265b6d2e3e37b31f69b64fe3d329f.tar.bz2
Fix failure handling in mock4js to throw instead of calling an undefined function.
This makes the expectation failures appear in the log instead of a useless stack trace about an undefined fail method. R=jochen@chromium.org BUG=None Review URL: https://codereview.chromium.org/330423005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@280056 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/third_party')
-rw-r--r--chrome/third_party/mock4js/README.chromium3
-rw-r--r--chrome/third_party/mock4js/mock4js.js4
2 files changed, 5 insertions, 2 deletions
diff --git a/chrome/third_party/mock4js/README.chromium b/chrome/third_party/mock4js/README.chromium
index 99a8a605..bed119c 100644
--- a/chrome/third_party/mock4js/README.chromium
+++ b/chrome/third_party/mock4js/README.chromium
@@ -7,3 +7,6 @@ License: MIT
Mock4JS is a dynamic-mock library for Javascript. It enables developers to write
tests that exercise and verify the interactions between the objects in the
application. Its syntax is very expressive and is closely based on jMock 1.
+
+Local Modifications:
+* Replace a fail() call with throwing Mock4JSException.
diff --git a/chrome/third_party/mock4js/mock4js.js b/chrome/third_party/mock4js/mock4js.js
index 98e5aa0..5cd02d5 100644
--- a/chrome/third_party/mock4js/mock4js.js
+++ b/chrome/third_party/mock4js/mock4js.js
@@ -122,7 +122,7 @@ Mock4JSException.prototype = {
*/
assertThat = function(expected, argumentMatcher) {
if(!argumentMatcher.argumentMatches(expected)) {
- fail("Expected '"+expected+"' to be "+argumentMatcher.describe());
+ throw new Mock4JSException("Expected '"+expected+"' to be "+argumentMatcher.describe());
}
}
@@ -622,4 +622,4 @@ Mock.prototype = {
}
return msg;
}
-} \ No newline at end of file
+}