Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/chrome_desktop_impl.h" | 5 #include "chrome/test/chromedriver/chrome/chrome_desktop_impl.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/posix/eintr_wrapper.h" | 9 #include "base/posix/eintr_wrapper.h" |
| 10 #include "base/process/kill.h" | 10 #include "base/process/kill.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 if (user_data_dir->IsValid()) | 79 if (user_data_dir->IsValid()) |
| 80 CHECK(user_data_dir_.Set(user_data_dir->Take())); | 80 CHECK(user_data_dir_.Set(user_data_dir->Take())); |
| 81 if (extension_dir->IsValid()) | 81 if (extension_dir->IsValid()) |
| 82 CHECK(extension_dir_.Set(extension_dir->Take())); | 82 CHECK(extension_dir_.Set(extension_dir->Take())); |
| 83 } | 83 } |
| 84 | 84 |
| 85 ChromeDesktopImpl::~ChromeDesktopImpl() { | 85 ChromeDesktopImpl::~ChromeDesktopImpl() { |
| 86 if (!quit_) { | 86 if (!quit_) { |
| 87 base::FilePath user_data_dir = user_data_dir_.Take(); | 87 base::FilePath user_data_dir = user_data_dir_.Take(); |
| 88 base::FilePath extension_dir = extension_dir_.Take(); | 88 base::FilePath extension_dir = extension_dir_.Take(); |
| 89 LOG(WARNING) << "chrome detaches, user should take care of directory:" | 89 // |
|
samuong
2014/10/17 21:52:25
can you please make sure to delete these comments?
andrewcheng
2014/10/17 22:59:56
Done.
| |
| 90 << user_data_dir.value() << " and " << extension_dir.value(); | 90 LOG(WARNING) << "chrome quit unexpectedly, leaving behind temporary " |
| 91 "directories for debugging:"; | |
| 92 if (user_data_dir_.IsValid()) | |
| 93 LOG(WARNING) << "chrome user data directory: " << user_data_dir.value(); | |
| 94 if (extension_dir_.IsValid()) | |
| 95 LOG(WARNING) << "chromedriver automation extension directory: " | |
| 96 << extension_dir.value(); | |
| 91 } | 97 } |
| 92 base::CloseProcessHandle(process_); | 98 base::CloseProcessHandle(process_); |
| 93 } | 99 } |
| 94 | 100 |
| 95 Status ChromeDesktopImpl::WaitForPageToLoad(const std::string& url, | 101 Status ChromeDesktopImpl::WaitForPageToLoad(const std::string& url, |
| 96 const base::TimeDelta& timeout, | 102 const base::TimeDelta& timeout, |
| 97 scoped_ptr<WebView>* web_view) { | 103 scoped_ptr<WebView>* web_view) { |
| 98 base::TimeTicks deadline = base::TimeTicks::Now() + timeout; | 104 base::TimeTicks deadline = base::TimeTicks::Now() + timeout; |
| 99 std::string id; | 105 std::string id; |
| 100 while (base::TimeTicks::Now() < deadline) { | 106 while (base::TimeTicks::Now() < deadline) { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 | 170 |
| 165 Status ChromeDesktopImpl::QuitImpl() { | 171 Status ChromeDesktopImpl::QuitImpl() { |
| 166 if (!KillProcess(process_)) | 172 if (!KillProcess(process_)) |
| 167 return Status(kUnknownError, "cannot kill Chrome"); | 173 return Status(kUnknownError, "cannot kill Chrome"); |
| 168 return Status(kOk); | 174 return Status(kOk); |
| 169 } | 175 } |
| 170 | 176 |
| 171 const CommandLine& ChromeDesktopImpl::command() const { | 177 const CommandLine& ChromeDesktopImpl::command() const { |
| 172 return command_; | 178 return command_; |
| 173 } | 179 } |
| OLD | NEW |