summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test_utils.cc
diff options
context:
space:
mode:
authoramit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-05 23:34:03 +0000
committeramit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-05 23:34:03 +0000
commit58d58c7b9d95c57f6bd9266c15fe173bb3264cc8 (patch)
treed260fae08ccaebbd32c55900ec632f344c00fe07 /chrome_frame/test_utils.cc
parentdfe11e35a204afa2d0172e649f5c711cbce5158b (diff)
downloadchromium_src-58d58c7b9d95c57f6bd9266c15fe173bb3264cc8.zip
chromium_src-58d58c7b9d95c57f6bd9266c15fe173bb3264cc8.tar.gz
chromium_src-58d58c7b9d95c57f6bd9266c15fe173bb3264cc8.tar.bz2
Some input tests no longer marked flaky
For tests like CtrlW, CtrlN it's better to notice failures when they execute and not run them at all if the workstation is locked i.e. when they will certainly fail. Added a check to do exactly that :) BUG=none TESTS=CtrlR, CtrlW, CtrlN, CtrlF, AltD Review URL: http://codereview.chromium.org/4615001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65279 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test_utils.cc')
-rw-r--r--chrome_frame/test_utils.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome_frame/test_utils.cc b/chrome_frame/test_utils.cc
index a059b35..d146079 100644
--- a/chrome_frame/test_utils.cc
+++ b/chrome_frame/test_utils.cc
@@ -303,3 +303,21 @@ bool KillAllNamedProcessesWithArgument(const std::wstring& process_name,
return result;
}
+
+bool IsWorkstationLocked() {
+ bool is_locked = true;
+ HDESK input_desk = ::OpenInputDesktop(0, 0, GENERIC_READ);
+ if (input_desk) {
+ wchar_t name[256] = {0};
+ DWORD needed = 0;
+ if (::GetUserObjectInformation(input_desk,
+ UOI_NAME,
+ name,
+ sizeof(name),
+ &needed)) {
+ is_locked = lstrcmpi(name, L"default") != 0;
+ }
+ ::CloseDesktop(input_desk);
+ }
+ return is_locked;
+}