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

Side by Side Diff: chrome/installer/gcapi/gcapi_test.cc

Issue 8508060: Add functionality to the GCAPI to detect when Chrome was last run. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698