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

Side by Side Diff: chrome/browser/extensions/api/web_request/web_request_api_unittest.cc

Issue 10911283: Implement 'Do Not Track' header (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 <map> 5 #include <map>
6 #include <queue> 6 #include <queue>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 io_thread_(content::BrowserThread::IO, &message_loop_) {} 123 io_thread_(content::BrowserThread::IO, &message_loop_) {}
124 124
125 protected: 125 protected:
126 virtual void SetUp() OVERRIDE { 126 virtual void SetUp() OVERRIDE {
127 event_router_ = new extensions::EventRouterForwarder(); 127 event_router_ = new extensions::EventRouterForwarder();
128 enable_referrers_.Init( 128 enable_referrers_.Init(
129 prefs::kEnableReferrers, profile_.GetTestingPrefService(), NULL); 129 prefs::kEnableReferrers, profile_.GetTestingPrefService(), NULL);
130 network_delegate_.reset(new ChromeNetworkDelegate( 130 network_delegate_.reset(new ChromeNetworkDelegate(
131 event_router_.get(), NULL, NULL, NULL, &profile_, 131 event_router_.get(), NULL, NULL, NULL, &profile_,
132 CookieSettings::Factory::GetForProfile(&profile_), &enable_referrers_, 132 CookieSettings::Factory::GetForProfile(&profile_), &enable_referrers_,
133 NULL)); 133 NULL, NULL));
134 context_.reset(new TestURLRequestContext(true)); 134 context_.reset(new TestURLRequestContext(true));
135 context_->set_network_delegate(network_delegate_.get()); 135 context_->set_network_delegate(network_delegate_.get());
136 context_->Init(); 136 context_->Init();
137 } 137 }
138 138
139 MessageLoopForIO message_loop_; 139 MessageLoopForIO message_loop_;
140 content::TestBrowserThread ui_thread_; 140 content::TestBrowserThread ui_thread_;
141 content::TestBrowserThread io_thread_; 141 content::TestBrowserThread io_thread_;
142 TestingProfile profile_; 142 TestingProfile profile_;
143 TestDelegate delegate_; 143 TestDelegate delegate_;
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 io_thread_(content::BrowserThread::IO, &message_loop_) {} 438 io_thread_(content::BrowserThread::IO, &message_loop_) {}
439 439
440 protected: 440 protected:
441 virtual void SetUp() { 441 virtual void SetUp() {
442 event_router_ = new extensions::EventRouterForwarder(); 442 event_router_ = new extensions::EventRouterForwarder();
443 enable_referrers_.Init( 443 enable_referrers_.Init(
444 prefs::kEnableReferrers, profile_.GetTestingPrefService(), NULL); 444 prefs::kEnableReferrers, profile_.GetTestingPrefService(), NULL);
445 network_delegate_.reset(new ChromeNetworkDelegate( 445 network_delegate_.reset(new ChromeNetworkDelegate(
446 event_router_.get(), NULL, NULL, NULL, &profile_, 446 event_router_.get(), NULL, NULL, NULL, &profile_,
447 CookieSettings::Factory::GetForProfile(&profile_), &enable_referrers_, 447 CookieSettings::Factory::GetForProfile(&profile_), &enable_referrers_,
448 NULL)); 448 NULL, NULL));
449 context_.reset(new TestURLRequestContext(true)); 449 context_.reset(new TestURLRequestContext(true));
450 host_resolver_.reset(new net::MockHostResolver()); 450 host_resolver_.reset(new net::MockHostResolver());
451 host_resolver_->rules()->AddSimulatedFailure("doesnotexist"); 451 host_resolver_->rules()->AddSimulatedFailure("doesnotexist");
452 context_->set_host_resolver(host_resolver_.get()); 452 context_->set_host_resolver(host_resolver_.get());
453 context_->set_network_delegate(network_delegate_.get()); 453 context_->set_network_delegate(network_delegate_.get());
454 context_->Init(); 454 context_->Init();
455 } 455 }
456 456
457 MessageLoopForIO message_loop_; 457 MessageLoopForIO message_loop_;
458 content::TestBrowserThread ui_thread_; 458 content::TestBrowserThread ui_thread_;
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1632 credentials_set = MergeOnAuthRequiredResponses( 1632 credentials_set = MergeOnAuthRequiredResponses(
1633 deltas, &auth3, &conflicting_extensions, &net_log); 1633 deltas, &auth3, &conflicting_extensions, &net_log);
1634 EXPECT_TRUE(credentials_set); 1634 EXPECT_TRUE(credentials_set);
1635 EXPECT_FALSE(auth3.Empty()); 1635 EXPECT_FALSE(auth3.Empty());
1636 EXPECT_EQ(username, auth1.username()); 1636 EXPECT_EQ(username, auth1.username());
1637 EXPECT_EQ(password, auth1.password()); 1637 EXPECT_EQ(password, auth1.password());
1638 EXPECT_EQ(1u, conflicting_extensions.size()); 1638 EXPECT_EQ(1u, conflicting_extensions.size());
1639 EXPECT_TRUE(ContainsKey(conflicting_extensions, "extid2")); 1639 EXPECT_TRUE(ContainsKey(conflicting_extensions, "extid2"));
1640 EXPECT_EQ(3u, capturing_net_log.GetSize()); 1640 EXPECT_EQ(3u, capturing_net_log.GetSize());
1641 } 1641 }
1642
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698