| OLD | NEW |
| 1 // Copyright (c) 2009 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 "chrome/test/automation/automation_messages.h" | 8 #include "chrome/test/automation/automation_messages.h" |
| 9 | 9 |
| 10 #include "chrome_frame/test/net/test_automation_resource_message_filter.h" | 10 #include "chrome_frame/test/net/test_automation_resource_message_filter.h" |
| 11 | 11 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 __super::OnMessageReceived(msg); | 54 __super::OnMessageReceived(msg); |
| 55 } | 55 } |
| 56 | 56 |
| 57 // IPC override to grab the tab handle. | 57 // IPC override to grab the tab handle. |
| 58 bool TestAutomationProvider::Send(IPC::Message* msg) { | 58 bool TestAutomationProvider::Send(IPC::Message* msg) { |
| 59 if (msg->type() == AutomationMsg_TabLoaded::ID) { | 59 if (msg->type() == AutomationMsg_TabLoaded::ID) { |
| 60 DCHECK(tab_handle_ == -1) << "Currently only support one tab"; | 60 DCHECK(tab_handle_ == -1) << "Currently only support one tab"; |
| 61 void* iter = NULL; | 61 void* iter = NULL; |
| 62 CHECK(msg->ReadInt(&iter, &tab_handle_)); | 62 CHECK(msg->ReadInt(&iter, &tab_handle_)); |
| 63 DLOG(INFO) << "Got tab handle: " << tab_handle_; | 63 DVLOG(1) << "Got tab handle: " << tab_handle_; |
| 64 DCHECK(tab_handle_ != -1 && tab_handle_ != 0); | 64 DCHECK(tab_handle_ != -1 && tab_handle_ != 0); |
| 65 delegate_->OnInitialTabLoaded(); | 65 delegate_->OnInitialTabLoaded(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 return AutomationProvider::Send(msg); | 68 return AutomationProvider::Send(msg); |
| 69 } | 69 } |
| 70 | 70 |
| 71 URLRequestJob* TestAutomationProvider::Factory(URLRequest* request, | 71 URLRequestJob* TestAutomationProvider::Factory(URLRequest* request, |
| 72 const std::string& scheme) { | 72 const std::string& scheme) { |
| 73 if (CFTestsDisabled()) | 73 if (CFTestsDisabled()) |
| (...skipping 26 matching lines...) Expand all Loading... |
| 100 | 100 |
| 101 // static | 101 // static |
| 102 TestAutomationProvider* TestAutomationProvider::NewAutomationProvider( | 102 TestAutomationProvider* TestAutomationProvider::NewAutomationProvider( |
| 103 Profile* p, const std::string& channel, | 103 Profile* p, const std::string& channel, |
| 104 TestAutomationProviderDelegate* delegate) { | 104 TestAutomationProviderDelegate* delegate) { |
| 105 TestAutomationProvider* automation = new TestAutomationProvider(p, delegate); | 105 TestAutomationProvider* automation = new TestAutomationProvider(p, delegate); |
| 106 automation->ConnectToChannel(channel); | 106 automation->ConnectToChannel(channel); |
| 107 automation->SetExpectedTabCount(1); | 107 automation->SetExpectedTabCount(1); |
| 108 return automation; | 108 return automation; |
| 109 } | 109 } |
| OLD | NEW |