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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 void* iter = NULL; | 62 void* iter = NULL; |
63 CHECK(msg->ReadInt(&iter, &tab_handle_)); | 63 CHECK(msg->ReadInt(&iter, &tab_handle_)); |
64 DVLOG(1) << "Got tab handle: " << tab_handle_; | 64 DVLOG(1) << "Got tab handle: " << tab_handle_; |
65 DCHECK(tab_handle_ != -1 && tab_handle_ != 0); | 65 DCHECK(tab_handle_ != -1 && tab_handle_ != 0); |
66 delegate_->OnInitialTabLoaded(); | 66 delegate_->OnInitialTabLoaded(); |
67 } | 67 } |
68 | 68 |
69 return AutomationProvider::Send(msg); | 69 return AutomationProvider::Send(msg); |
70 } | 70 } |
71 | 71 |
72 URLRequestJob* TestAutomationProvider::Factory(net::URLRequest* request, | 72 net::URLRequestJob* TestAutomationProvider::Factory(net::URLRequest* request, |
73 const std::string& scheme) { | 73 const std::string& scheme) { |
74 if (CFTestsDisabled()) | 74 if (CFTestsDisabled()) |
75 return NULL; | 75 return NULL; |
76 | 76 |
77 if (request->url().SchemeIs("http") || request->url().SchemeIs("https")) { | 77 if (request->url().SchemeIs("http") || request->url().SchemeIs("https")) { |
78 // Only look at requests that don't have any user data. | 78 // Only look at requests that don't have any user data. |
79 // ResourceDispatcherHost uses the user data for requests that it manages. | 79 // ResourceDispatcherHost uses the user data for requests that it manages. |
80 // We don't want to mess with those. | 80 // We don't want to mess with those. |
81 | 81 |
82 // We could also check if the current thread is our TestUrlRequest thread | 82 // We could also check if the current thread is our TestUrlRequest thread |
83 // and only intercept requests that belong to that thread. | 83 // and only intercept requests that belong to that thread. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 116 |
117 // static | 117 // static |
118 TestAutomationProvider* TestAutomationProvider::NewAutomationProvider( | 118 TestAutomationProvider* TestAutomationProvider::NewAutomationProvider( |
119 Profile* p, const std::string& channel, | 119 Profile* p, const std::string& channel, |
120 TestAutomationProviderDelegate* delegate) { | 120 TestAutomationProviderDelegate* delegate) { |
121 TestAutomationProvider* automation = new TestAutomationProvider(p, delegate); | 121 TestAutomationProvider* automation = new TestAutomationProvider(p, delegate); |
122 automation->InitializeChannel(channel); | 122 automation->InitializeChannel(channel); |
123 automation->SetExpectedTabCount(1); | 123 automation->SetExpectedTabCount(1); |
124 return automation; | 124 return automation; |
125 } | 125 } |
OLD | NEW |