OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 The Native Client Authors. All Rights Reserved. | |
2 // Use of thjis source code is governed by a BSD-style license that can be found | |
3 // in the LICENSE file. | |
4 | |
5 /** | |
6 * @fileoverview This file contains the JavaScript required for testing the | |
7 * WebGTT application using the nacltest.js browser testing framework. | |
8 * | |
9 * @author ragad@google.com (Raga Gopalakrishnan) | |
10 */ | |
11 | |
12 /** | |
13 * This function is triggered when the page has finished loading, and creates a | |
14 * new Tester() object, sets up the tests, and runs them after the NaCl module | |
15 * has finished loading. | |
16 */ | |
17 function main() { | |
18 var tester = new Tester(); | |
19 var naclModule1 = document.getElementById('webgtt_test'); | |
20 setupTests(tester, naclModule1); | |
21 tester.waitFor(naclModule1); | |
22 tester.run(); | |
23 } | |
24 | |
25 /** | |
26 * This function sets up the tests that need to be run. | |
27 * | |
28 * @param {Tester} tester The Tester object wrapper for the tests | |
29 * @param {Element} plugin The reference to the NaCl module DOM object | |
30 */ | |
31 function setupTests(tester, plugin) { | |
32 // TEST 1: Test coloring on a complete graph on three vertices. | |
33 tester.addAsyncTest('Complete Graph', function(status) { | |
34 status.expectMessageSequence(plugin, ['0,1,2']); | |
35 plugin.postMessage('::0,1,1,1,0,1,1,1,0::0::'); | |
36 }); | |
37 // TODO(ragad): Add more tests. | |
38 } | |
OLD | NEW |