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

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

Issue 2822016: [chrome_frame] Refactor/merge IE no interference tests with other mock event ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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/simulate_input.h ('k') | chrome_frame/test/test_mock_with_web_server.h » ('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) 2010 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"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 237
238 POINT cursor_position = {x, y}; 238 POINT cursor_position = {x, y};
239 ClientToScreen(window, &cursor_position); 239 ClientToScreen(window, &cursor_position);
240 SendMouseClick(cursor_position.x, cursor_position.y, button); 240 SendMouseClick(cursor_position.x, cursor_position.y, button);
241 } 241 }
242 242
243 void SendExtendedKey(WORD key, Modifier modifiers) { 243 void SendExtendedKey(WORD key, Modifier modifiers) {
244 SendMnemonic(key, modifiers, true, false); 244 SendMnemonic(key, modifiers, true, false);
245 } 245 }
246 246
247 void SendStringW(const wchar_t* s) { 247 void SendStringW(const std::wstring& s) {
248 while (*s) { 248 for (size_t i = 0; i < s.length(); i++) {
249 wchar_t ch = *s; 249 SendCharW(s[i], NONE);
250 SendCharW(ch, NONE);
251 Sleep(10); 250 Sleep(10);
252 s++;
253 } 251 }
254 } 252 }
255 253
256 void SendStringA(const char* s) { 254 void SendStringA(const std::string& s) {
257 while (*s) { 255 for (size_t i = 0; i < s.length(); i++) {
258 char ch = *s; 256 SendCharA(s[i], NONE);
259 SendCharA(ch, NONE);
260 Sleep(10); 257 Sleep(10);
261 s++;
262 } 258 }
263 } 259 }
264 260
265 } // namespace simulate_input 261 } // namespace simulate_input
266 262
OLDNEW
« no previous file with comments | « chrome_frame/test/simulate_input.h ('k') | chrome_frame/test/test_mock_with_web_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698