OLD | NEW |
1 // Copyright (c) 2012 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/test/automation/proxy_launcher.h" | 5 #include "chrome/test/automation/proxy_launcher.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 } | 317 } |
318 | 318 |
319 void ProxyLauncher::TerminateBrowser() { | 319 void ProxyLauncher::TerminateBrowser() { |
320 // If we have already finished waiting for the browser to exit | 320 // If we have already finished waiting for the browser to exit |
321 // (or it hasn't launched at all), there's nothing to do here. | 321 // (or it hasn't launched at all), there's nothing to do here. |
322 if (process_ == base::kNullProcessHandle || !automation_proxy_.get()) | 322 if (process_ == base::kNullProcessHandle || !automation_proxy_.get()) |
323 return; | 323 return; |
324 | 324 |
325 base::TimeTicks quit_start = base::TimeTicks::Now(); | 325 base::TimeTicks quit_start = base::TimeTicks::Now(); |
326 | 326 |
327 #if defined(OS_WIN) && !defined(USE_AURA) | |
328 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); | |
329 ASSERT_TRUE(browser.get()); | |
330 ASSERT_TRUE(browser->TerminateSession()); | |
331 #endif // defined(OS_WIN) | |
332 | |
333 ChromeProcessList processes = GetRunningChromeProcesses(process_id_); | 327 ChromeProcessList processes = GetRunningChromeProcesses(process_id_); |
334 | 328 |
335 // Now, drop the automation IPC channel so that the automation provider in | 329 // Now, drop the automation IPC channel so that the automation provider in |
336 // the browser notices and drops its reference to the browser process. | 330 // the browser notices and drops its reference to the browser process. |
337 if (automation_proxy_.get()) | 331 if (automation_proxy_.get()) |
338 automation_proxy_->Disconnect(); | 332 automation_proxy_->Disconnect(); |
339 | 333 |
340 #if defined(OS_POSIX) | 334 #if defined(OS_POSIX) |
341 EXPECT_EQ(kill(process_, SIGTERM), 0); | 335 EXPECT_EQ(kill(process_, SIGTERM), 0); |
342 #endif // OS_POSIX | 336 #endif // OS_POSIX |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 return LaunchBrowserAndServer(state, wait_for_initial_loads); | 626 return LaunchBrowserAndServer(state, wait_for_initial_loads); |
633 } | 627 } |
634 | 628 |
635 void AnonymousProxyLauncher::TerminateConnection() { | 629 void AnonymousProxyLauncher::TerminateConnection() { |
636 CloseBrowserAndServer(); | 630 CloseBrowserAndServer(); |
637 } | 631 } |
638 | 632 |
639 std::string AnonymousProxyLauncher::PrefixedChannelID() const { | 633 std::string AnonymousProxyLauncher::PrefixedChannelID() const { |
640 return channel_id_; | 634 return channel_id_; |
641 } | 635 } |
OLD | NEW |