Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: chrome/browser/printing/print_dialog_cloud_uitest.cc

Issue 6037013: net: Add namespace net to URLRequestFilter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/browser/printing/print_dialog_cloud.h" 5 #include "chrome/browser/printing/print_dialog_cloud.h"
6 #include "chrome/browser/printing/print_dialog_cloud_internal.h" 6 #include "chrome/browser/printing/print_dialog_cloud_internal.h"
7 7
8 #include <functional> 8 #include <functional>
9 9
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 } 152 }
153 }; 153 };
154 154
155 virtual void SetUp() { 155 virtual void SetUp() {
156 TestController::GetInstance()->set_result(false); 156 TestController::GetInstance()->set_result(false);
157 InProcessBrowserTest::SetUp(); 157 InProcessBrowserTest::SetUp();
158 } 158 }
159 159
160 virtual void TearDown() { 160 virtual void TearDown() {
161 if (handler_added_) { 161 if (handler_added_) {
162 URLRequestFilter* filter = URLRequestFilter::GetInstance(); 162 net::URLRequestFilter* filter = net::URLRequestFilter::GetInstance();
163 filter->RemoveHostnameHandler(scheme_, host_name_); 163 filter->RemoveHostnameHandler(scheme_, host_name_);
164 handler_added_ = false; 164 handler_added_ = false;
165 TestController::GetInstance()->set_delegate(NULL); 165 TestController::GetInstance()->set_delegate(NULL);
166 } 166 }
167 InProcessBrowserTest::TearDown(); 167 InProcessBrowserTest::TearDown();
168 } 168 }
169 169
170 // Normally this is something I would expect could go into SetUp(), 170 // Normally this is something I would expect could go into SetUp(),
171 // but there seems to be some timing or ordering related issue with 171 // but there seems to be some timing or ordering related issue with
172 // the test harness that made that flaky. Calling this from the 172 // the test harness that made that flaky. Calling this from the
173 // individual test functions seems to fix that. 173 // individual test functions seems to fix that.
174 void AddTestHandlers() { 174 void AddTestHandlers() {
175 if (!handler_added_) { 175 if (!handler_added_) {
176 URLRequestFilter* filter = URLRequestFilter::GetInstance(); 176 net::URLRequestFilter* filter = net::URLRequestFilter::GetInstance();
177 GURL cloud_print_service_url = 177 GURL cloud_print_service_url =
178 CloudPrintURL(browser()->profile()). 178 CloudPrintURL(browser()->profile()).
179 GetCloudPrintServiceURL(); 179 GetCloudPrintServiceURL();
180 scheme_ = cloud_print_service_url.scheme(); 180 scheme_ = cloud_print_service_url.scheme();
181 host_name_ = cloud_print_service_url.host(); 181 host_name_ = cloud_print_service_url.host();
182 filter->AddHostnameHandler(scheme_, host_name_, 182 filter->AddHostnameHandler(scheme_, host_name_,
183 &PrintDialogCloudTest::Factory); 183 &PrintDialogCloudTest::Factory);
184 handler_added_ = true; 184 handler_added_ = true;
185 185
186 GURL cloud_print_dialog_url = 186 GURL cloud_print_dialog_url =
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 248
249 std::wstring window_print(L"window.print()"); 249 std::wstring window_print(L"window.print()");
250 browser()->GetSelectedTabContents()->render_view_host()-> 250 browser()->GetSelectedTabContents()->render_view_host()->
251 ExecuteJavascriptInWebFrame(std::wstring(), window_print); 251 ExecuteJavascriptInWebFrame(std::wstring(), window_print);
252 252
253 ui_test_utils::RunMessageLoop(); 253 ui_test_utils::RunMessageLoop();
254 254
255 ASSERT_TRUE(TestController::GetInstance()->result()); 255 ASSERT_TRUE(TestController::GetInstance()->result());
256 } 256 }
257 #endif 257 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698