Debian Codegraph @

rhino/testsrc/tests/src/com/netscape/javascript/qa/drivers/LiveNavDrv.java

raw symbols SCIP
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 package com.netscape.javascript.qa.drivers;
6
7 import netscape.security.PrivilegeManager;
8 import netscape.javascript.JSObject;
9
10 import java.util.Vector;
11 import java.util.Date;
12 import java.io.*;
13 import java.applet.Applet;
14
15 /**
16 * LiveNavDrv is a test driver for running the JSObject test applets in Netscape
17 * Navigator.
18 *
19 * The only difference between LiveNavDrv and NavDrv is that it creates a
20 * LiveNavEnv object (rather than a NavEnv) in which the LiveConnect tests
21 * are evaluated.
22 *
23 * @see NavDrv
24 * @see LiveNavEnv
25 *
26 * @author [email protected]
27 */
28 public class LiveNavDrv extends NavDrv {
29 JSObject window;
30 String SUFFIX;
31
32 public LiveNavDrv() {
33 super();
34 setSuffix(".java");
35 }
36
37 public static void main ( String[] args ) {
38 System.out.println( "main" );
39 LiveNavDrv d = new LiveNavDrv();
40 d.start();
41 }
42
43 /**
44 * Iterate through suites. For each file in each suite, create a
45 * LiveNavEnv (in this case a Navigator window) that can load and
46 * evaluate the test result.
47 *
48 * @see LiveNavEnv#parseResult
49 */
50
51 public synchronized void executeSuite( TestSuite suite ) {
52 PrivilegeManager.enablePrivilege( "UniversalFileAccess" );
53 PrivilegeManager.enablePrivilege( "UniversalFileRead" );
54 PrivilegeManager.enablePrivilege( "UniversalFileWrite" );
55 PrivilegeManager.enablePrivilege( "UniversalPropertyRead" );
56
57 LiveNavEnv context;
58 TestFile file;
59
60 for ( int i = 0; i < suite.size(); i++ ) {
61 synchronized ( suite ) {
62 file = (TestFile) suite.elementAt( i );
63 context = new LiveNavEnv( file, suite, this );
64 context.runTest();
65
66 writeFileResult( file, suite, OUTPUT_DIRECTORY );
67 writeCaseResults(file, suite, OUTPUT_DIRECTORY );
68 context.close();
69 context = null;
70
71 if ( ! file.passed ) {
72 suite.passed = false;
73 }
74 }
75 }
76 writeSuiteResult( suite, OUTPUT_DIRECTORY );
77 writeSuiteSummary( suite, OUTPUT_DIRECTORY );
78 }
79 }