OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | |
8 #include "chrome/installer/gcapi/gcapi.h" | 7 #include "chrome/installer/gcapi/gcapi.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
10 | 9 |
11 void call_statically() { | 10 void call_statically() { |
12 DWORD reason = 0; | 11 DWORD reason = 0; |
13 BOOL result_flag_on = FALSE; | 12 BOOL result_flag_on = FALSE; |
14 BOOL result_flag_off = FALSE; | 13 BOOL result_flag_off = FALSE; |
15 | 14 |
16 // running this twice verifies that the first call does not set | 15 // running this twice verifies that the first call does not set |
17 // a flag that would make the second fail. Thus, the results | 16 // a flag that would make the second fail. Thus, the results |
(...skipping 30 matching lines...) Expand all Loading... |
48 printf("Registry key flag is not being set properly."); | 47 printf("Registry key flag is not being set properly."); |
49 | 48 |
50 printf("Dynamic call returned result as %d and reason as %d.\n", | 49 printf("Dynamic call returned result as %d and reason as %d.\n", |
51 result_flag_on, reason); | 50 result_flag_on, reason); |
52 } else { | 51 } else { |
53 printf("Couldn't find GoogleChromeCompatibilityCheck() in gcapi_dll.\n"); | 52 printf("Couldn't find GoogleChromeCompatibilityCheck() in gcapi_dll.\n"); |
54 } | 53 } |
55 FreeLibrary(module); | 54 FreeLibrary(module); |
56 } | 55 } |
57 | 56 |
58 const char kManualLaunchTests[] = "launch-chrome"; | |
59 | |
60 int main(int argc, char* argv[]) { | 57 int main(int argc, char* argv[]) { |
61 CommandLine::Init(argc, argv); | |
62 | |
63 testing::InitGoogleTest(&argc, argv); | 58 testing::InitGoogleTest(&argc, argv); |
64 RUN_ALL_TESTS(); | 59 RUN_ALL_TESTS(); |
65 | 60 |
66 if (CommandLine::ForCurrentProcess()->HasSwitch(kManualLaunchTests)) { | 61 call_dynamically(); |
67 call_dynamically(); | 62 call_statically(); |
68 call_statically(); | 63 printf("LaunchChrome returned %d.\n", LaunchGoogleChrome()); |
69 printf("LaunchChrome returned %d.\n", LaunchGoogleChrome()); | |
70 } | |
71 } | 64 } |
OLD | NEW |