| OLD | NEW |
| 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: 'chrome://DummyURL', | 9 browsePreload: DUMMY_URL, |
| 10 typedefCppFixture: null, | |
| 11 }; | 10 }; |
| 12 | 11 |
| 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() { | 12 function testTwoExpects() { |
| 21 expectTrue(false); | 13 expectTrue(false); |
| 22 expectTrue(0); | 14 expectTrue(0); |
| 23 } | 15 } |
| 24 | 16 |
| 25 TEST_F('WebUIAssertionsTest', 'testTwoExpects', function() { | 17 TEST_F('WebUIAssertionsTest', 'testTwoExpects', function() { |
| 26 var result = runTestFunction('testTwoExpects', testTwoExpects, []); | 18 var result = runTestFunction('testTwoExpects', testTwoExpects, []); |
| 27 resetTestState(); | 19 resetTestState(); |
| 28 | 20 |
| 29 expectFalse(result[0]); | 21 expectFalse(result[0]); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 58 } | 50 } |
| 59 | 51 |
| 60 TEST_F('WebUIAssertionsTest', 'testConstructedMessage', function() { | 52 TEST_F('WebUIAssertionsTest', 'testConstructedMessage', function() { |
| 61 var result = runTestFunction( | 53 var result = runTestFunction( |
| 62 'testConstructMessage', testConstructMessage, []); | 54 'testConstructMessage', testConstructMessage, []); |
| 63 resetTestState(); | 55 resetTestState(); |
| 64 | 56 |
| 65 expectEquals( | 57 expectEquals( |
| 66 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); |
| 67 }); | 59 }); |
| OLD | NEW |