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

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

Issue 7250009: Added guts to pull call signatures when assertions & expectations fail. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clang Created 9 years, 5 months 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 | « chrome/chrome_tests.gypi ('k') | chrome/test/data/webui/assertions-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 function WebUIAssertionsTest() {}
6
7 WebUIAssertionsTest.prototype = {
8 __proto__: testing.Test.prototype,
9 browsePreload: 'chrome://DummyURL',
10 typedefCppFixture: null,
11 };
12
13 GEN('#include "chrome/test/data//webui/assertions-inl.h"');
14 GEN('');
15 GEN('WebUIAssertionsTest::WebUIAssertionsTest() {}');
16 GEN('WebUIAssertionsTest::~WebUIAssertionsTest() {}');
17 GEN('MockWebUIProvider::MockWebUIProvider() {}');
18 GEN('MockWebUIProvider::~MockWebUIProvider() {}');
19
20 function testTwoExpects() {
21 expectTrue(false);
22 expectTrue(0);
23 }
24
25 TEST_F('WebUIAssertionsTest', 'testTwoExpects', function() {
26 var result = runTest(testTwoExpects, []);
27
28 expectFalse(result[0]);
29 expectTrue(!!result[1].match(/expectTrue\(false\): false/));
30 expectTrue(!!result[1].match(/expectTrue\(0\): 0/));
31 });
32
33 function twoExpects() {
34 expectTrue(false, 'message1');
35 expectTrue(false, 'message2');
36 }
37
38 function testCallTestTwice() {
39 twoExpects();
40 twoExpects();
41 }
42
43 TEST_F('WebUIAssertionsTest', 'testCallTestTwice', function() {
44 var result = runTest(testCallTestTwice, []);
45 expectFalse(result[0]);
46 expectEquals(2, result[1].match(
47 /expectTrue\(false, 'message1'\): message1: false/g).length);
48 expectEquals(2, result[1].match(
49 /expectTrue\(false, 'message2'\): message2: false/g).length);
50 });
51
52 function testConstructMessage() {
53 var message = 1 + ' ' + 2;
54 assertTrue(false, message);
55 }
56
57 TEST_F('WebUIAssertionsTest', 'testConstructedMessage', function() {
58 var result = runTest(testConstructMessage, []);
59 expectEquals(
60 1, result[1].match(/assertTrue\(false, message\): 1 2: false/g).length);
61 });
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/data/webui/assertions-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698