OLD | NEW |
1 // Copyright (c) 2006-2008 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> |
| 6 |
5 #include "chrome/installer/gcapi/gcapi.h" | 7 #include "chrome/installer/gcapi/gcapi.h" |
6 | 8 #include "testing/gtest/include/gtest/gtest.h" |
7 #include <stdio.h> | |
8 | 9 |
9 void call_statically() { | 10 void call_statically() { |
10 DWORD reason = 0; | 11 DWORD reason = 0; |
11 BOOL result_flag_on = FALSE; | 12 BOOL result_flag_on = FALSE; |
12 BOOL result_flag_off = FALSE; | 13 BOOL result_flag_off = FALSE; |
13 | 14 |
14 // running this twice verifies that the first call does not set | 15 // running this twice verifies that the first call does not set |
15 // a flag that would make the second fail. Thus, the results | 16 // a flag that would make the second fail. Thus, the results |
16 // of the two calls should be the same (no state should have changed) | 17 // of the two calls should be the same (no state should have changed) |
17 result_flag_off = GoogleChromeCompatibilityCheck(FALSE, &reason); | 18 result_flag_off = GoogleChromeCompatibilityCheck(FALSE, &reason); |
(...skipping 29 matching lines...) Expand all Loading... |
47 | 48 |
48 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", |
49 result_flag_on, reason); | 50 result_flag_on, reason); |
50 } else { | 51 } else { |
51 printf("Couldn't find GoogleChromeCompatibilityCheck() in gcapi_dll.\n"); | 52 printf("Couldn't find GoogleChromeCompatibilityCheck() in gcapi_dll.\n"); |
52 } | 53 } |
53 FreeLibrary(module); | 54 FreeLibrary(module); |
54 } | 55 } |
55 | 56 |
56 int main(int argc, char* argv[]) { | 57 int main(int argc, char* argv[]) { |
| 58 testing::InitGoogleTest(&argc, argv); |
| 59 RUN_ALL_TESTS(); |
| 60 |
57 call_dynamically(); | 61 call_dynamically(); |
58 call_statically(); | 62 call_statically(); |
59 printf("LaunchChrome returned %d.\n", LaunchGoogleChrome()); | 63 printf("LaunchChrome returned %d.\n", LaunchGoogleChrome()); |
60 } | 64 } |
OLD | NEW |