summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscr@chromium.org <scr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-31 20:32:01 +0000
committerscr@chromium.org <scr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-31 20:32:01 +0000
commit6328bea86571399d38c86e21e941632abb17843d (patch)
tree6527b68aa29bd94fea2d7c9d012de8e221259e21
parent4573fbd30d7ed70f959efb69b32ad9547465f0ce (diff)
downloadchromium_src-6328bea86571399d38c86e21e941632abb17843d.zip
chromium_src-6328bea86571399d38c86e21e941632abb17843d.tar.gz
chromium_src-6328bea86571399d38c86e21e941632abb17843d.tar.bz2
Expect should still fail for non-asynchronous tests.
R=flackr@chromium.org BUG=99970 TEST=browser_tests --gtest_filter=WebUIAssertions*.* Review URL: http://codereview.chromium.org/8416049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108005 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/test/data/webui/assertions.js31
-rw-r--r--chrome/test/data/webui/test_api.js5
2 files changed, 30 insertions, 6 deletions
diff --git a/chrome/test/data/webui/assertions.js b/chrome/test/data/webui/assertions.js
index f3e13f4..f8d7f19 100644
--- a/chrome/test/data/webui/assertions.js
+++ b/chrome/test/data/webui/assertions.js
@@ -59,20 +59,41 @@ TEST_F('WebUIAssertionsTest', 'testConstructedMessage', function() {
});
/**
- * Async version of WebUIAssertionsTest.
+ * Failing version of WebUIAssertionsTest.
* @extends WebUIAssertionsTest
* @constructor
*/
-function WebUIAssertionsTestAsyncFail() {}
+function WebUIAssertionsTestFail() {}
-WebUIAssertionsTestAsyncFail.prototype = {
+WebUIAssertionsTestFail.prototype = {
__proto__: WebUIAssertionsTest.prototype,
/** @inheritDoc */
- isAsync: true,
+ testShouldFail: true,
+};
+
+// Test that an assertion failure fails test.
+TEST_F('WebUIAssertionsTestFail', 'testAssertFailFails', function() {
+ assertNotReached();
+});
+
+// Test that an expect failure fails test.
+TEST_F('WebUIAssertionsTestFail', 'testExpectFailFails', function() {
+ expectNotReached();
+});
+
+/**
+ * Async version of WebUIAssertionsTestFail.
+ * @extends WebUIAssertionsTest
+ * @constructor
+ */
+function WebUIAssertionsTestAsyncFail() {}
+
+WebUIAssertionsTestAsyncFail.prototype = {
+ __proto__: WebUIAssertionsTestFail.prototype,
/** @inheritDoc */
- testShouldFail: true,
+ isAsync: true,
};
// Test that an assertion failure doesn't hang forever.
diff --git a/chrome/test/data/webui/test_api.js b/chrome/test/data/webui/test_api.js
index 24f0adb..140efe7 100644
--- a/chrome/test/data/webui/test_api.js
+++ b/chrome/test/data/webui/test_api.js
@@ -767,7 +767,10 @@ var testing = {};
if (testBody != RUN_TEST_F) {
console.log('Running test ' + testName);
}
- var result = runTestFunction(testFunction, testBody, testArguments, true);
+
+ // Async allow expect errors, but not assert errors.
+ var result = runTestFunction(testFunction, testBody, testArguments,
+ isAsync);
if (!isAsync || !result[0])
testDone(result);
return true;