Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: webkit/tools/test_shell/run_all_tests.cc

Issue 1606: hodgepodge for test_shell.cc (Closed)
Patch Set: update some comments Created 12 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webkit/tools/test_shell/SConscript ('k') | webkit/tools/test_shell/test_shell.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 // Run all of our test shell tests. This is just an entry point 5 // Run all of our test shell tests. This is just an entry point
6 // to kick off gTest's RUN_ALL_TESTS(). 6 // to kick off gTest's RUN_ALL_TESTS().
7 7
8 #if defined(OS_WIN)
8 #include <windows.h> 9 #include <windows.h>
9 #include <commctrl.h> 10 #include <commctrl.h>
11 #endif
10 12
11 #include "base/at_exit.h" 13 #include "base/at_exit.h"
12 #include "base/icu_util.h" 14 #include "base/icu_util.h"
13 #include "base/message_loop.h" 15 #include "base/message_loop.h"
14 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" 16 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h"
15 #include "webkit/tools/test_shell/test_shell.h" 17 #include "webkit/tools/test_shell/test_shell.h"
16 #include "webkit/tools/test_shell/test_shell_test.h" 18 #include "webkit/tools/test_shell/test_shell_test.h"
17 #include "testing/gtest/include/gtest/gtest.h" 19 #include "testing/gtest/include/gtest/gtest.h"
18 20
19 const char* TestShellTest::kJavascriptDelayExitScript = 21 const char* TestShellTest::kJavascriptDelayExitScript =
20 "<script>" 22 "<script>"
21 "window.layoutTestController.waitUntilDone();" 23 "window.layoutTestController.waitUntilDone();"
22 "window.addEventListener('load', function() {" 24 "window.addEventListener('load', function() {"
23 " var x = document.body.clientWidth;" // Force a document layout 25 " var x = document.body.clientWidth;" // Force a document layout
24 " window.layoutTestController.notifyDone();" 26 " window.layoutTestController.notifyDone();"
25 "});" 27 "});"
26 "</script>"; 28 "</script>";
27 29
28 int main(int argc, char* argv[]) { 30 int main(int argc, char* argv[]) {
29 // Some unittests may use base::Singleton<>, thus we need to instanciate 31 // Some unittests may use base::Singleton<>, thus we need to instanciate
30 // the AtExitManager or else we will leak objects. 32 // the AtExitManager or else we will leak objects.
31 base::AtExitManager at_exit_manager; 33 base::AtExitManager at_exit_manager;
32 34
35 #if defined(OS_WIN)
33 TestShell::InitLogging(true); // suppress error dialogs 36 TestShell::InitLogging(true); // suppress error dialogs
34 37
35 // Initialize test shell in non-interactive mode, which will let us load one 38 // Initialize test shell in non-interactive mode, which will let us load one
36 // request than automatically quit. 39 // request than automatically quit.
37 TestShell::InitializeTestShell(false); 40 TestShell::InitializeTestShell(false);
38 41
39 // Some of the individual tests wind up calling TestShell::WaitTestFinished 42 // Some of the individual tests wind up calling TestShell::WaitTestFinished
40 // which has a timeout in it. For these tests, we don't care about a timeout 43 // which has a timeout in it. For these tests, we don't care about a timeout
41 // so just set it to be a really large number. This is necessary because 44 // so just set it to be a really large number. This is necessary because
42 // when running under Purify, we were hitting those timeouts. 45 // when running under Purify, we were hitting those timeouts.
43 TestShell::SetFileTestTimeout(USER_TIMER_MAXIMUM); 46 TestShell::SetFileTestTimeout(USER_TIMER_MAXIMUM);
47 #endif
44 48
45 // Allocate a message loop for this thread. Although it is not used 49 // Allocate a message loop for this thread. Although it is not used
46 // directly, its constructor sets up some necessary state. 50 // directly, its constructor sets up some necessary state.
47 MessageLoop main_message_loop; 51 MessageLoop main_message_loop;
48 52
49 // Load ICU data tables 53 // Load ICU data tables
50 icu_util::Initialize(); 54 icu_util::Initialize();
51 55
56 #if defined(OS_WIN)
52 INITCOMMONCONTROLSEX InitCtrlEx; 57 INITCOMMONCONTROLSEX InitCtrlEx;
53 58
54 InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX); 59 InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX);
55 InitCtrlEx.dwICC = ICC_STANDARD_CLASSES; 60 InitCtrlEx.dwICC = ICC_STANDARD_CLASSES;
56 InitCommonControlsEx(&InitCtrlEx); 61 InitCommonControlsEx(&InitCtrlEx);
62 #endif
57 63
58 // Run the actual tests 64 // Run the actual tests
59 testing::InitGoogleTest(&argc, argv); 65 testing::InitGoogleTest(&argc, argv);
60 int result = RUN_ALL_TESTS(); 66 int result = RUN_ALL_TESTS();
61 67
68 #if defined(OS_WIN)
62 TestShell::ShutdownTestShell(); 69 TestShell::ShutdownTestShell();
63 TestShell::CleanupLogging(); 70 TestShell::CleanupLogging();
71 #endif
72
64 return result; 73 return result;
65 } 74 }
66 75
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/SConscript ('k') | webkit/tools/test_shell/test_shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698