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

Side by Side Diff: chrome_frame/test/simulate_input.cc

Issue 9838058: More non-debug logging in Chrome Frame tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: copyright and formatting tweaks Created 8 years, 9 months 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
« no previous file with comments | « chrome_frame/test/mock_ie_event_sink_test.cc ('k') | chrome_frame/test/test_server.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome_frame/test/simulate_input.h" 5 #include "chrome_frame/test/simulate_input.h"
6 6
7 #include <atlbase.h> 7 #include <atlbase.h>
8 #include <atlwin.h> 8 #include <atlwin.h>
9 9
10 #include "chrome_frame/utils.h" 10 #include "chrome_frame/utils.h"
11 11
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 HWND hwnd = GetForegroundWindow(); 94 HWND hwnd = GetForegroundWindow();
95 base::ProcessId current_foreground_pid = 0; 95 base::ProcessId current_foreground_pid = 0;
96 DWORD active_thread_id = GetWindowThreadProcessId(hwnd, 96 DWORD active_thread_id = GetWindowThreadProcessId(hwnd,
97 &current_foreground_pid); 97 &current_foreground_pid);
98 if (current_foreground_pid == process_id) 98 if (current_foreground_pid == process_id)
99 return true; 99 return true;
100 100
101 PidAndWindow paw = { process_id }; 101 PidAndWindow paw = { process_id };
102 EnumWindows(FindWindowInProcessCallback, reinterpret_cast<LPARAM>(&paw)); 102 EnumWindows(FindWindowInProcessCallback, reinterpret_cast<LPARAM>(&paw));
103 if (!IsWindow(paw.hwnd)) { 103 if (!IsWindow(paw.hwnd)) {
104 DLOG(ERROR) << "failed to find process window"; 104 LOG(ERROR) << "failed to find process window";
105 return false; 105 return false;
106 } 106 }
107 107
108 bool ret = ForceSetForegroundWindow(paw.hwnd); 108 bool ret = ForceSetForegroundWindow(paw.hwnd);
109 LOG_IF(ERROR, !ret) << "ForceSetForegroundWindow: " << ret; 109 LOG_IF(ERROR, !ret) << "ForceSetForegroundWindow: " << ret;
110 110
111 return ret; 111 return ret;
112 } 112 }
113 113
114 void SendScanCode(short scan_code, Modifier modifiers) { 114 void SendScanCode(short scan_code, Modifier modifiers) {
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 } 252 }
253 253
254 void SendStringA(const std::string& s) { 254 void SendStringA(const std::string& s) {
255 for (size_t i = 0; i < s.length(); i++) { 255 for (size_t i = 0; i < s.length(); i++) {
256 SendCharA(s[i], NONE); 256 SendCharA(s[i], NONE);
257 Sleep(10); 257 Sleep(10);
258 } 258 }
259 } 259 }
260 260
261 } // namespace simulate_input 261 } // namespace simulate_input
262
OLDNEW
« no previous file with comments | « chrome_frame/test/mock_ie_event_sink_test.cc ('k') | chrome_frame/test/test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698