diff options
author | gwilson@google.com <gwilson@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-05 23:39:07 +0000 |
---|---|---|
committer | gwilson@google.com <gwilson@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-05 23:39:07 +0000 |
commit | 4eb868df77e40a01c9e560017099a3d6319076ee (patch) | |
tree | b387f0ddf6313f19bc594b82cf6abf1bbb44e779 /chrome/installer/gcapi/gcapi_test.cc | |
parent | 63ada1fcf8019142460a52dd88312f6783f591e5 (diff) | |
download | chromium_src-4eb868df77e40a01c9e560017099a3d6319076ee.zip chromium_src-4eb868df77e40a01c9e560017099a3d6319076ee.tar.gz chromium_src-4eb868df77e40a01c9e560017099a3d6319076ee.tar.bz2 |
Adds the 6-month flag functionality back into the criteria checker,
along with adding support for a boolean parameter that indicates whether
the flag should be set or not.
BUG=6802
Review URL: http://codereview.chromium.org/18490
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9278 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/gcapi/gcapi_test.cc')
-rwxr-xr-x | chrome/installer/gcapi/gcapi_test.cc | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/chrome/installer/gcapi/gcapi_test.cc b/chrome/installer/gcapi/gcapi_test.cc index 8d3608c..268033d 100755 --- a/chrome/installer/gcapi/gcapi_test.cc +++ b/chrome/installer/gcapi/gcapi_test.cc @@ -8,11 +8,20 @@ void call_statically() { DWORD reason = 0; - BOOL result = FALSE; + BOOL result_flag_on = FALSE; + BOOL result_flag_off = FALSE; + + // running this twice verifies that the first call does not set + // a flag that would make the second fail. Thus, the results + // of the two calls should be the same (no state should have changed) + result_flag_off = GoogleChromeCompatibilityCheck(FALSE, &reason); + result_flag_on = GoogleChromeCompatibilityCheck(TRUE, &reason); - result = GoogleChromeCompatibilityCheck(&reason); + if (result_flag_off != result_flag_on) + printf("Registry key flag is not being set properly."); + printf("Static call returned result as %d and reason as %d.\n", - result, reason); + result_flag_on, reason); } void call_dynamically() { @@ -26,9 +35,18 @@ void call_dynamically() { module, "GoogleChromeCompatibilityCheck"); if (gccfn != NULL) { DWORD reason = 0; - BOOL result = gccfn(&reason); + + // running this twice verifies that the first call does not set + // a flag that would make the second fail. Thus, the results + // of the two calls should be the same (no state should have changed) + BOOL result_flag_off = gccfn(FALSE, &reason); + BOOL result_flag_on = gccfn(TRUE, &reason); + + if (result_flag_off != result_flag_on) + printf("Registry key flag is not being set properly."); + printf("Dynamic call returned result as %d and reason as %d.\n", - result, reason); + result_flag_on, reason); } else { printf("Couldn't find GoogleChromeCompatibilityCheck() in gcapi_dll.\n"); } |