OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <stdio.h> | 5 #include <stdio.h> |
6 | 6 |
| 7 #include "base/at_exit.h" |
7 #include "base/command_line.h" | 8 #include "base/command_line.h" |
8 #include "chrome/installer/gcapi/gcapi.h" | 9 #include "chrome/installer/gcapi/gcapi.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
10 | 11 |
11 void call_statically() { | 12 void call_statically() { |
12 DWORD reason = 0; | 13 DWORD reason = 0; |
13 BOOL result_flag_on = FALSE; | 14 BOOL result_flag_on = FALSE; |
14 BOOL result_flag_off = FALSE; | 15 BOOL result_flag_off = FALSE; |
15 | 16 |
16 // running this twice verifies that the first call does not set | 17 // running this twice verifies that the first call does not set |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 result_flag_on, reason); | 54 result_flag_on, reason); |
54 } else { | 55 } else { |
55 printf("Couldn't find GoogleChromeCompatibilityCheck() in gcapi_dll.\n"); | 56 printf("Couldn't find GoogleChromeCompatibilityCheck() in gcapi_dll.\n"); |
56 } | 57 } |
57 FreeLibrary(module); | 58 FreeLibrary(module); |
58 } | 59 } |
59 | 60 |
60 const char kManualLaunchTests[] = "launch-chrome"; | 61 const char kManualLaunchTests[] = "launch-chrome"; |
61 | 62 |
62 int main(int argc, char* argv[]) { | 63 int main(int argc, char* argv[]) { |
| 64 base::AtExitManager exit_manager; |
63 CommandLine::Init(argc, argv); | 65 CommandLine::Init(argc, argv); |
64 | 66 |
65 testing::InitGoogleTest(&argc, argv); | 67 testing::InitGoogleTest(&argc, argv); |
66 RUN_ALL_TESTS(); | 68 RUN_ALL_TESTS(); |
67 | 69 |
68 if (CommandLine::ForCurrentProcess()->HasSwitch(kManualLaunchTests)) { | 70 if (CommandLine::ForCurrentProcess()->HasSwitch(kManualLaunchTests)) { |
69 call_dynamically(); | 71 call_dynamically(); |
70 call_statically(); | 72 call_statically(); |
71 printf("LaunchChrome returned %d.\n", LaunchGoogleChrome()); | 73 printf("LaunchChrome returned %d.\n", LaunchGoogleChrome()); |
72 } | 74 } |
73 } | 75 } |
OLD | NEW |