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

Side by Side Diff: net/url_request/url_request_unittest.cc

Issue 9348109: Add extra data to BrowserContext so that content layer and other embedders can stash data with it t… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 10 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <shlobj.h> 8 #include <shlobj.h>
9 #include <windows.h> 9 #include <windows.h>
10 #endif 10 #endif
(...skipping 3253 matching lines...) Expand 10 before | Expand all | Expand 10 after
3264 TestInterceptor interceptor; 3264 TestInterceptor interceptor;
3265 3265
3266 // intercept the main request and respond with a simple response 3266 // intercept the main request and respond with a simple response
3267 interceptor.intercept_main_request_ = true; 3267 interceptor.intercept_main_request_ = true;
3268 interceptor.main_headers_ = TestInterceptor::ok_headers(); 3268 interceptor.main_headers_ = TestInterceptor::ok_headers();
3269 interceptor.main_data_ = TestInterceptor::ok_data(); 3269 interceptor.main_data_ = TestInterceptor::ok_data();
3270 3270
3271 TestDelegate d; 3271 TestDelegate d;
3272 TestURLRequest req(GURL("http://test_intercept/foo"), &d); 3272 TestURLRequest req(GURL("http://test_intercept/foo"), &d);
3273 req.set_context(default_context_); 3273 req.set_context(default_context_);
3274 URLRequest::UserData* user_data0 = new URLRequest::UserData(); 3274 base::SupportsUserData::Data* user_data0 = new base::SupportsUserData::Data();
3275 URLRequest::UserData* user_data1 = new URLRequest::UserData(); 3275 base::SupportsUserData::Data* user_data1 = new base::SupportsUserData::Data();
3276 URLRequest::UserData* user_data2 = new URLRequest::UserData(); 3276 base::SupportsUserData::Data* user_data2 = new base::SupportsUserData::Data();
3277 req.SetUserData(NULL, user_data0); 3277 req.SetUserData(NULL, user_data0);
3278 req.SetUserData(&user_data1, user_data1); 3278 req.SetUserData(&user_data1, user_data1);
3279 req.SetUserData(&user_data2, user_data2); 3279 req.SetUserData(&user_data2, user_data2);
3280 req.set_method("GET"); 3280 req.set_method("GET");
3281 req.Start(); 3281 req.Start();
3282 MessageLoop::current()->Run(); 3282 MessageLoop::current()->Run();
3283 3283
3284 // Make sure we can retrieve our specific user data 3284 // Make sure we can retrieve our specific user data
3285 EXPECT_EQ(user_data0, req.GetUserData(NULL)); 3285 EXPECT_EQ(user_data0, req.GetUserData(NULL));
3286 EXPECT_EQ(user_data1, req.GetUserData(&user_data1)); 3286 EXPECT_EQ(user_data1, req.GetUserData(&user_data1));
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
4125 req.SetExtraRequestHeaders(headers); 4125 req.SetExtraRequestHeaders(headers);
4126 req.Start(); 4126 req.Start();
4127 MessageLoop::current()->Run(); 4127 MessageLoop::current()->Run();
4128 // If the net tests are being run with ChromeFrame then we need to allow for 4128 // If the net tests are being run with ChromeFrame then we need to allow for
4129 // the 'chromeframe' suffix which is added to the user agent before the 4129 // the 'chromeframe' suffix which is added to the user agent before the
4130 // closing parentheses. 4130 // closing parentheses.
4131 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true)); 4131 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true));
4132 } 4132 }
4133 4133
4134 } // namespace net 4134 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698