OLD | NEW |
(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 // Show an example of helper functions which are not, themselves, included as |
| 6 // tests, but are available to help write tests. |
| 7 var helpers = { |
| 8 helpAssertTrue: function(test) { |
| 9 assertTrue(test); |
| 10 }, |
| 11 helpAssertFalse: function(test) { |
| 12 assertFalse(test); |
| 13 } |
| 14 }; |
| 15 |
| 16 // Sample tests that exercise the test JS library and show how this framework |
| 17 // could be used to test the downloads page. |
| 18 function testAssertFalse() { |
| 19 assertFalse(false); |
| 20 } |
| 21 |
| 22 function testInitialFocus() { |
| 23 assertTrue(document.activeElement.id == 'term', ''); |
| 24 } |
| 25 |
| 26 function testHelpers() { |
| 27 helpers.helpAssertTrue(true); |
| 28 helpers.helpAssertFalse(false); |
| 29 } |
OLD | NEW |