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

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

Issue 10692158: Refactor URLBlacklistManager to use URLMatcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/io_thread.cc » ('j') | chrome/browser/managed_mode.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <queue> 5 #include <queue>
6 #include <map> 6 #include <map>
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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 ExtensionWebRequestTest() 119 ExtensionWebRequestTest()
120 : ui_thread_(content::BrowserThread::UI, &message_loop_), 120 : ui_thread_(content::BrowserThread::UI, &message_loop_),
121 io_thread_(content::BrowserThread::IO, &message_loop_) {} 121 io_thread_(content::BrowserThread::IO, &message_loop_) {}
122 122
123 protected: 123 protected:
124 virtual void SetUp() OVERRIDE { 124 virtual void SetUp() OVERRIDE {
125 event_router_ = new ExtensionEventRouterForwarder(); 125 event_router_ = new ExtensionEventRouterForwarder();
126 enable_referrers_.Init( 126 enable_referrers_.Init(
127 prefs::kEnableReferrers, profile_.GetTestingPrefService(), NULL); 127 prefs::kEnableReferrers, profile_.GetTestingPrefService(), NULL);
128 network_delegate_.reset(new ChromeNetworkDelegate( 128 network_delegate_.reset(new ChromeNetworkDelegate(
129 event_router_.get(), NULL, NULL, &profile_, 129 event_router_.get(), NULL, NULL, NULL, &profile_,
130 CookieSettings::Factory::GetForProfile(&profile_), &enable_referrers_)); 130 CookieSettings::Factory::GetForProfile(&profile_), &enable_referrers_));
131 context_.reset(new TestURLRequestContext(true)); 131 context_.reset(new TestURLRequestContext(true));
132 context_->set_network_delegate(network_delegate_.get()); 132 context_->set_network_delegate(network_delegate_.get());
133 context_->Init(); 133 context_->Init();
134 } 134 }
135 135
136 MessageLoopForIO message_loop_; 136 MessageLoopForIO message_loop_;
137 content::TestBrowserThread ui_thread_; 137 content::TestBrowserThread ui_thread_;
138 content::TestBrowserThread io_thread_; 138 content::TestBrowserThread io_thread_;
139 TestingProfile profile_; 139 TestingProfile profile_;
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 ExtensionWebRequestHeaderModificationTest() 433 ExtensionWebRequestHeaderModificationTest()
434 : ui_thread_(content::BrowserThread::UI, &message_loop_), 434 : ui_thread_(content::BrowserThread::UI, &message_loop_),
435 io_thread_(content::BrowserThread::IO, &message_loop_) {} 435 io_thread_(content::BrowserThread::IO, &message_loop_) {}
436 436
437 protected: 437 protected:
438 virtual void SetUp() { 438 virtual void SetUp() {
439 event_router_ = new ExtensionEventRouterForwarder(); 439 event_router_ = new ExtensionEventRouterForwarder();
440 enable_referrers_.Init( 440 enable_referrers_.Init(
441 prefs::kEnableReferrers, profile_.GetTestingPrefService(), NULL); 441 prefs::kEnableReferrers, profile_.GetTestingPrefService(), NULL);
442 network_delegate_.reset(new ChromeNetworkDelegate( 442 network_delegate_.reset(new ChromeNetworkDelegate(
443 event_router_.get(), NULL, NULL, &profile_, 443 event_router_.get(), NULL, NULL, NULL, &profile_,
444 CookieSettings::Factory::GetForProfile(&profile_), &enable_referrers_)); 444 CookieSettings::Factory::GetForProfile(&profile_), &enable_referrers_));
445 context_.reset(new TestURLRequestContext(true)); 445 context_.reset(new TestURLRequestContext(true));
446 host_resolver_.reset(new net::MockHostResolver()); 446 host_resolver_.reset(new net::MockHostResolver());
447 host_resolver_->rules()->AddSimulatedFailure("doesnotexist"); 447 host_resolver_->rules()->AddSimulatedFailure("doesnotexist");
448 context_->set_host_resolver(host_resolver_.get()); 448 context_->set_host_resolver(host_resolver_.get());
449 context_->set_network_delegate(network_delegate_.get()); 449 context_->set_network_delegate(network_delegate_.get());
450 context_->Init(); 450 context_->Init();
451 } 451 }
452 452
453 MessageLoopForIO message_loop_; 453 MessageLoopForIO message_loop_;
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after
1525 // Check that requests are rejected if their first party url is sensitive. 1525 // Check that requests are rejected if their first party url is sensitive.
1526 ASSERT_GE(arraysize(non_sensitive_urls), 1u); 1526 ASSERT_GE(arraysize(non_sensitive_urls), 1u);
1527 GURL non_sensitive_url(non_sensitive_urls[0]); 1527 GURL non_sensitive_url(non_sensitive_urls[0]);
1528 for (size_t i = 0; i < arraysize(sensitive_urls); ++i) { 1528 for (size_t i = 0; i < arraysize(sensitive_urls); ++i) {
1529 TestURLRequest request(non_sensitive_url, NULL, &context); 1529 TestURLRequest request(non_sensitive_url, NULL, &context);
1530 GURL sensitive_url(sensitive_urls[i]); 1530 GURL sensitive_url(sensitive_urls[i]);
1531 request.set_first_party_for_cookies(sensitive_url); 1531 request.set_first_party_for_cookies(sensitive_url);
1532 EXPECT_TRUE(helpers::HideRequest(&request)) << sensitive_urls[i]; 1532 EXPECT_TRUE(helpers::HideRequest(&request)) << sensitive_urls[i];
1533 } 1533 }
1534 } 1534 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/io_thread.cc » ('j') | chrome/browser/managed_mode.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698