| OLD | NEW |
| 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/test/automation/automation_proxy.h" | 5 #include "chrome/test/automation/automation_proxy.h" |
| 6 | 6 |
| 7 #include <gtest/gtest.h> | 7 #include <gtest/gtest.h> |
| 8 | 8 |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/platform_thread.h" | 13 #include "base/threading/platform_thread.h" |
| 14 #include "base/process_util.h" | 14 #include "base/process_util.h" |
| 15 #include "base/ref_counted.h" | 15 #include "base/ref_counted.h" |
| 16 #include "base/waitable_event.h" | 16 #include "base/waitable_event.h" |
| 17 #include "chrome/common/automation_constants.h" | 17 #include "chrome/common/automation_constants.h" |
| 18 #include "chrome/common/automation_messages.h" | 18 #include "chrome/common/automation_messages.h" |
| 19 #include "chrome/common/chrome_version_info.h" | 19 #include "chrome/common/chrome_version_info.h" |
| 20 #include "chrome/test/automation/browser_proxy.h" | 20 #include "chrome/test/automation/browser_proxy.h" |
| 21 #include "chrome/test/automation/extension_proxy.h" | 21 #include "chrome/test/automation/extension_proxy.h" |
| 22 #include "chrome/test/automation/tab_proxy.h" | 22 #include "chrome/test/automation/tab_proxy.h" |
| 23 #include "chrome/test/automation/window_proxy.h" | 23 #include "chrome/test/automation/window_proxy.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 app_launch_signaled_(0), | 98 app_launch_signaled_(0), |
| 99 perform_version_check_(false), | 99 perform_version_check_(false), |
| 100 disconnect_on_failure_(disconnect_on_failure), | 100 disconnect_on_failure_(disconnect_on_failure), |
| 101 command_execution_timeout_( | 101 command_execution_timeout_( |
| 102 TimeDelta::FromMilliseconds(command_execution_timeout_ms)), | 102 TimeDelta::FromMilliseconds(command_execution_timeout_ms)), |
| 103 listener_thread_id_(0) { | 103 listener_thread_id_(0) { |
| 104 // base::WaitableEvent::TimedWait() will choke if we give it a negative value. | 104 // base::WaitableEvent::TimedWait() will choke if we give it a negative value. |
| 105 // Zero also seems unreasonable, since we need to wait for IPC, but at | 105 // Zero also seems unreasonable, since we need to wait for IPC, but at |
| 106 // least it is legal... ;-) | 106 // least it is legal... ;-) |
| 107 DCHECK_GE(command_execution_timeout_ms, 0); | 107 DCHECK_GE(command_execution_timeout_ms, 0); |
| 108 listener_thread_id_ = PlatformThread::CurrentId(); | 108 listener_thread_id_ = base::PlatformThread::CurrentId(); |
| 109 InitializeHandleTracker(); | 109 InitializeHandleTracker(); |
| 110 InitializeThread(); | 110 InitializeThread(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 AutomationProxy::~AutomationProxy() { | 113 AutomationProxy::~AutomationProxy() { |
| 114 // Destruction order is important. Thread has to outlive the channel and | 114 // Destruction order is important. Thread has to outlive the channel and |
| 115 // tracker has to outlive the thread since we access the tracker inside | 115 // tracker has to outlive the thread since we access the tracker inside |
| 116 // AutomationMessageFilter::OnMessageReceived. | 116 // AutomationMessageFilter::OnMessageReceived. |
| 117 Disconnect(); | 117 Disconnect(); |
| 118 thread_.reset(); | 118 thread_.reset(); |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 password, | 540 password, |
| 541 &success)); | 541 &success)); |
| 542 // If message sending unsuccessful or test failed, return false. | 542 // If message sending unsuccessful or test failed, return false. |
| 543 return sent && success; | 543 return sent && success; |
| 544 } | 544 } |
| 545 #endif | 545 #endif |
| 546 | 546 |
| 547 bool AutomationProxy::ResetToDefaultTheme() { | 547 bool AutomationProxy::ResetToDefaultTheme() { |
| 548 return Send(new AutomationMsg_ResetToDefaultTheme()); | 548 return Send(new AutomationMsg_ResetToDefaultTheme()); |
| 549 } | 549 } |
| OLD | NEW |