[app] Use system locale
[abstract.git] / xpunit / nsTestRunner.h
blobe635f111b01b7a29ace373b2efd3980366d2e2b3
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent tw=79 ft=cpp: */
3 /*
4 * Copyright (C) 2007 Sergey Yanovich <ynvich@gmail.com>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public
17 * License along with this program; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
22 #ifndef NSTESTRUNNER_H
23 #define NSTESTRUNNER_H 1
25 #define NS_TESTRUNNER_CID \
26 {0xda0c516d, 0x0531, 0x4429, {0xb8, 0x28, 0xa7, 0xaf, 0xbf, 0xfc, 0x6e, 0x35}}
27 #define NS_TESTRUNNER_CONTRACT_ID "@aasii.org/cxxunit/testrunner"
29 class nsITestResult;
30 class nsIDOMWindow;
31 class nsITimer;
32 class nsIRDFDataSource;
33 class nsIThreadJSContextStack;
35 class nsTestRunner: public nsITestRunner,
36 public nsIConsoleListener,
37 public nsIWebProgressListener,
38 public nsSupportsWeakReference,
39 public nsITimerCallback,
40 public nsICommandLineHandler
42 public:
43 virtual ~nsTestRunner();
44 NS_DECL_ISUPPORTS
45 NS_DECL_NSITESTRUNNER
46 NS_DECL_NSICONSOLELISTENER
47 NS_DECL_NSIWEBPROGRESSLISTENER
48 NS_DECL_NSITIMERCALLBACK
49 NS_DECL_NSICOMMANDLINEHANDLER
51 static nsTestRunner* GetTestRunner();
52 nsresult resolve(nsACString &aURL, const PRUnichar* *result);
53 private:
54 nsTestRunner();
55 static nsTestRunner* gTestRunner;
57 nsresult openMainWindow();
58 void run();
59 nsresult init();
60 nsresult pushTest(const char *aContractID);
61 nsresult runCurrentTest();
62 nsresult getNextTest(nsACString &aContractID);
63 void traverse();
64 nsresult closeMainWindow();
65 static void done(nsITimer *aTimer, void *aClosure);
67 nsCOMPtr<nsITestResult> mTestResult;
68 nsEmbedCString mTestID;
69 nsDeque mTestTree;
70 nsCOMPtr<nsIDOMWindow> mTestWindow;
71 nsCOMPtr<nsIDOMWindow> mWatchWindow;
72 nsCOMPtr<nsITimer> mTimer;
73 nsCOMPtr<nsITimer> mTimerStop;
74 PRBool mArmed;
75 PRBool mRunning;
76 nsCOMPtr<nsIRDFDataSource> mFileMap;
77 nsCOMPtr<nsIThreadJSContextStack> mJSStack;
80 #endif /* ! NSTESTRUNNER_H */