| 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_frame/test/net/test_automation_provider.h" | 5 #include "chrome_frame/test/net/test_automation_provider.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_version_info.h" | 8 #include "base/file_version_info.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "chrome/common/automation_messages.h" | 10 #include "chrome/common/automation_messages.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 if (automation_resource_message_filter_->OnMessageReceived(msg)) | 52 if (automation_resource_message_filter_->OnMessageReceived(msg)) |
| 53 return true; // Message handled by the filter. | 53 return true; // Message handled by the filter. |
| 54 | 54 |
| 55 return __super::OnMessageReceived(msg); | 55 return __super::OnMessageReceived(msg); |
| 56 } | 56 } |
| 57 | 57 |
| 58 // IPC override to grab the tab handle. | 58 // IPC override to grab the tab handle. |
| 59 bool TestAutomationProvider::Send(IPC::Message* msg) { | 59 bool TestAutomationProvider::Send(IPC::Message* msg) { |
| 60 if (msg->type() == AutomationMsg_TabLoaded::ID) { | 60 if (msg->type() == AutomationMsg_TabLoaded::ID) { |
| 61 DCHECK(tab_handle_ == -1) << "Currently only support one tab"; | 61 DCHECK(tab_handle_ == -1) << "Currently only support one tab"; |
| 62 void* iter = NULL; | 62 tab_handle_ = msg->routing_id(); |
| 63 CHECK(msg->ReadInt(&iter, &tab_handle_)); | |
| 64 DVLOG(1) << "Got tab handle: " << tab_handle_; | 63 DVLOG(1) << "Got tab handle: " << tab_handle_; |
| 65 DCHECK(tab_handle_ != -1 && tab_handle_ != 0); | 64 DCHECK(tab_handle_ != -1 && tab_handle_ != 0); |
| 66 delegate_->OnInitialTabLoaded(); | 65 delegate_->OnInitialTabLoaded(); |
| 67 } | 66 } |
| 68 | 67 |
| 69 return AutomationProvider::Send(msg); | 68 return AutomationProvider::Send(msg); |
| 70 } | 69 } |
| 71 | 70 |
| 72 net::URLRequestJob* TestAutomationProvider::Factory(net::URLRequest* request, | 71 net::URLRequestJob* TestAutomationProvider::Factory(net::URLRequest* request, |
| 73 const std::string& scheme) { | 72 const std::string& scheme) { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 115 |
| 117 // static | 116 // static |
| 118 TestAutomationProvider* TestAutomationProvider::NewAutomationProvider( | 117 TestAutomationProvider* TestAutomationProvider::NewAutomationProvider( |
| 119 Profile* p, const std::string& channel, | 118 Profile* p, const std::string& channel, |
| 120 TestAutomationProviderDelegate* delegate) { | 119 TestAutomationProviderDelegate* delegate) { |
| 121 TestAutomationProvider* automation = new TestAutomationProvider(p, delegate); | 120 TestAutomationProvider* automation = new TestAutomationProvider(p, delegate); |
| 122 automation->InitializeChannel(channel); | 121 automation->InitializeChannel(channel); |
| 123 automation->SetExpectedTabCount(1); | 122 automation->SetExpectedTabCount(1); |
| 124 return automation; | 123 return automation; |
| 125 } | 124 } |
| OLD | NEW |