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

Side by Side Diff: chrome/test/chromedriver/chrome_launcher.cc

Issue 858353002: [chromedriver] Fixed window SendKeys (single quote missing) problem (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor change on variable name Created 5 years, 10 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
« no previous file with comments | « no previous file | chrome/test/chromedriver/keycode_text_conversion.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/test/chromedriver/chrome_launcher.h" 5 #include "chrome/test/chromedriver/chrome_launcher.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "crypto/rsa_private_key.h" 46 #include "crypto/rsa_private_key.h"
47 #include "crypto/sha2.h" 47 #include "crypto/sha2.h"
48 #include "third_party/zlib/google/zip.h" 48 #include "third_party/zlib/google/zip.h"
49 49
50 #if defined(OS_POSIX) 50 #if defined(OS_POSIX)
51 #include <fcntl.h> 51 #include <fcntl.h>
52 #include <sys/stat.h> 52 #include <sys/stat.h>
53 #include <sys/types.h> 53 #include <sys/types.h>
54 #elif defined(OS_WIN) 54 #elif defined(OS_WIN)
55 #include "base/win/scoped_handle.h" 55 #include "base/win/scoped_handle.h"
56 #include "chrome/test/chromedriver/keycode_text_conversion.h"
56 #endif 57 #endif
57 58
58 namespace { 59 namespace {
59 60
60 const char* const kCommonSwitches[] = { 61 const char* const kCommonSwitches[] = {
61 "ignore-certificate-errors", "metrics-recording-only"}; 62 "ignore-certificate-errors", "metrics-recording-only"};
62 63
63 #if defined(OS_LINUX) 64 #if defined(OS_LINUX)
64 const char kEnableCrashReport[] = "enable-crash-reporter-for-testing"; 65 const char kEnableCrashReport[] = "enable-crash-reporter-for-testing";
65 #endif 66 #endif
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 if (!CreatePipe(&out_read, &out_write, &sa_attr, 0)) 338 if (!CreatePipe(&out_read, &out_write, &sa_attr, 0))
338 return Status(kUnknownError, "CreatePipe() - Pipe creation failed"); 339 return Status(kUnknownError, "CreatePipe() - Pipe creation failed");
339 // Prevent handle leak. 340 // Prevent handle leak.
340 base::win::ScopedHandle scoped_out_read(out_read); 341 base::win::ScopedHandle scoped_out_read(out_read);
341 base::win::ScopedHandle scoped_out_write(out_write); 342 base::win::ScopedHandle scoped_out_write(out_write);
342 343
343 options.stdout_handle = out_write; 344 options.stdout_handle = out_write;
344 options.stderr_handle = out_write; 345 options.stderr_handle = out_write;
345 options.stdin_handle = GetStdHandle(STD_INPUT_HANDLE); 346 options.stdin_handle = GetStdHandle(STD_INPUT_HANDLE);
346 options.inherit_handles = true; 347 options.inherit_handles = true;
348
349 if (!SwitchToUSKeyboardLayout())
350 VLOG(0) << "Can not set to US keyboard layout - Some keycodes may be"
351 "interpreted incorrectly";
347 #endif 352 #endif
348 353
349 #if defined(OS_WIN) 354 #if defined(OS_WIN)
350 std::string command_string = base::WideToUTF8(command.GetCommandLineString()); 355 std::string command_string = base::WideToUTF8(command.GetCommandLineString());
351 #else 356 #else
352 std::string command_string = command.GetCommandLineString(); 357 std::string command_string = command.GetCommandLineString();
353 #endif 358 #endif
354 VLOG(0) << "Launching chrome: " << command_string; 359 VLOG(0) << "Launching chrome: " << command_string;
355 base::Process process = base::LaunchProcess(command, options); 360 base::Process process = base::LaunchProcess(command, options);
356 if (!process.IsValid()) 361 if (!process.IsValid())
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 // Write empty "First Run" file, otherwise Chrome will wipe the default 840 // Write empty "First Run" file, otherwise Chrome will wipe the default
836 // profile that was written. 841 // profile that was written.
837 if (base::WriteFile( 842 if (base::WriteFile(
838 user_data_dir.Append(chrome::kFirstRunSentinel), "", 0) != 0) { 843 user_data_dir.Append(chrome::kFirstRunSentinel), "", 0) != 0) {
839 return Status(kUnknownError, "failed to write first run file"); 844 return Status(kUnknownError, "failed to write first run file");
840 } 845 }
841 return Status(kOk); 846 return Status(kOk);
842 } 847 }
843 848
844 } // namespace internal 849 } // namespace internal
OLDNEW
« no previous file with comments | « no previous file | chrome/test/chromedriver/keycode_text_conversion.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698