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

Side by Side Diff: chrome/test/data/webui/assertions.js

Issue 8416049: Expect should still fail for non-asynchronous tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/test/data/webui/test_api.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 function WebUIAssertionsTest() {} 5 function WebUIAssertionsTest() {}
6 6
7 WebUIAssertionsTest.prototype = { 7 WebUIAssertionsTest.prototype = {
8 __proto__: testing.Test.prototype, 8 __proto__: testing.Test.prototype,
9 browsePreload: DUMMY_URL, 9 browsePreload: DUMMY_URL,
10 }; 10 };
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 TEST_F('WebUIAssertionsTest', 'testConstructedMessage', function() { 52 TEST_F('WebUIAssertionsTest', 'testConstructedMessage', function() {
53 var result = runTestFunction( 53 var result = runTestFunction(
54 'testConstructMessage', testConstructMessage, []); 54 'testConstructMessage', testConstructMessage, []);
55 resetTestState(); 55 resetTestState();
56 56
57 expectEquals( 57 expectEquals(
58 1, result[1].match(/assertTrue\(false, message\): 1 2: false/g).length); 58 1, result[1].match(/assertTrue\(false, message\): 1 2: false/g).length);
59 }); 59 });
60 60
61 /** 61 /**
62 * Async version of WebUIAssertionsTest. 62 * Failing version of WebUIAssertionsTest.
63 * @extends WebUIAssertionsTest
64 * @constructor
65 */
66 function WebUIAssertionsTestFail() {}
67
68 WebUIAssertionsTestFail.prototype = {
69 __proto__: WebUIAssertionsTest.prototype,
70
71 /** @inheritDoc */
72 testShouldFail: true,
73 };
74
75 // Test that an assertion failure fails test.
76 TEST_F('WebUIAssertionsTestFail', 'testAssertFailFails', function() {
77 assertNotReached();
78 });
79
80 // Test that an expect failure fails test.
Sheridan Rawlins 2011/10/28 20:51:20 FYI, this is the <new> test, which failed before t
81 TEST_F('WebUIAssertionsTestFail', 'testExpectFailFails', function() {
82 expectNotReached();
83 });
84
85 /**
86 * Async version of WebUIAssertionsTestFail.
63 * @extends WebUIAssertionsTest 87 * @extends WebUIAssertionsTest
64 * @constructor 88 * @constructor
65 */ 89 */
66 function WebUIAssertionsTestAsyncFail() {} 90 function WebUIAssertionsTestAsyncFail() {}
67 91
68 WebUIAssertionsTestAsyncFail.prototype = { 92 WebUIAssertionsTestAsyncFail.prototype = {
69 __proto__: WebUIAssertionsTest.prototype, 93 __proto__: WebUIAssertionsTestFail.prototype,
70 94
71 /** @inheritDoc */ 95 /** @inheritDoc */
72 isAsync: true, 96 isAsync: true,
73
74 /** @inheritDoc */
75 testShouldFail: true,
76 }; 97 };
77 98
78 // Test that an assertion failure doesn't hang forever. 99 // Test that an assertion failure doesn't hang forever.
79 TEST_F('WebUIAssertionsTestAsyncFail', 'testAsyncFailCallsDone', function() { 100 TEST_F('WebUIAssertionsTestAsyncFail', 'testAsyncFailCallsDone', function() {
80 assertNotReached(); 101 assertNotReached();
81 }); 102 });
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/webui/test_api.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698