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

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

Issue 10736066: Adding histograms showing fraction of page load times (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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.h » ('j') | no next file with comments »
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 extensions::EventRouterForwarder(); 125 event_router_ = new extensions::EventRouterForwarder();
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, &profile_,
130 CookieSettings::Factory::GetForProfile(&profile_), &enable_referrers_)); 130 CookieSettings::Factory::GetForProfile(&profile_), &enable_referrers_,
131 NULL));
131 context_.reset(new TestURLRequestContext(true)); 132 context_.reset(new TestURLRequestContext(true));
132 context_->set_network_delegate(network_delegate_.get()); 133 context_->set_network_delegate(network_delegate_.get());
133 context_->Init(); 134 context_->Init();
134 } 135 }
135 136
136 MessageLoopForIO message_loop_; 137 MessageLoopForIO message_loop_;
137 content::TestBrowserThread ui_thread_; 138 content::TestBrowserThread ui_thread_;
138 content::TestBrowserThread io_thread_; 139 content::TestBrowserThread io_thread_;
139 TestingProfile profile_; 140 TestingProfile profile_;
140 TestDelegate delegate_; 141 TestDelegate delegate_;
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 : ui_thread_(content::BrowserThread::UI, &message_loop_), 435 : ui_thread_(content::BrowserThread::UI, &message_loop_),
435 io_thread_(content::BrowserThread::IO, &message_loop_) {} 436 io_thread_(content::BrowserThread::IO, &message_loop_) {}
436 437
437 protected: 438 protected:
438 virtual void SetUp() { 439 virtual void SetUp() {
439 event_router_ = new extensions::EventRouterForwarder(); 440 event_router_ = new extensions::EventRouterForwarder();
440 enable_referrers_.Init( 441 enable_referrers_.Init(
441 prefs::kEnableReferrers, profile_.GetTestingPrefService(), NULL); 442 prefs::kEnableReferrers, profile_.GetTestingPrefService(), NULL);
442 network_delegate_.reset(new ChromeNetworkDelegate( 443 network_delegate_.reset(new ChromeNetworkDelegate(
443 event_router_.get(), NULL, NULL, &profile_, 444 event_router_.get(), NULL, NULL, &profile_,
444 CookieSettings::Factory::GetForProfile(&profile_), &enable_referrers_)); 445 CookieSettings::Factory::GetForProfile(&profile_), &enable_referrers_,
446 NULL));
445 context_.reset(new TestURLRequestContext(true)); 447 context_.reset(new TestURLRequestContext(true));
446 host_resolver_.reset(new net::MockHostResolver()); 448 host_resolver_.reset(new net::MockHostResolver());
447 host_resolver_->rules()->AddSimulatedFailure("doesnotexist"); 449 host_resolver_->rules()->AddSimulatedFailure("doesnotexist");
448 context_->set_host_resolver(host_resolver_.get()); 450 context_->set_host_resolver(host_resolver_.get());
449 context_->set_network_delegate(network_delegate_.get()); 451 context_->set_network_delegate(network_delegate_.get());
450 context_->Init(); 452 context_->Init();
451 } 453 }
452 454
453 MessageLoopForIO message_loop_; 455 MessageLoopForIO message_loop_;
454 content::TestBrowserThread ui_thread_; 456 content::TestBrowserThread ui_thread_;
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
1525 // Check that requests are rejected if their first party url is sensitive. 1527 // Check that requests are rejected if their first party url is sensitive.
1526 ASSERT_GE(arraysize(non_sensitive_urls), 1u); 1528 ASSERT_GE(arraysize(non_sensitive_urls), 1u);
1527 GURL non_sensitive_url(non_sensitive_urls[0]); 1529 GURL non_sensitive_url(non_sensitive_urls[0]);
1528 for (size_t i = 0; i < arraysize(sensitive_urls); ++i) { 1530 for (size_t i = 0; i < arraysize(sensitive_urls); ++i) {
1529 TestURLRequest request(non_sensitive_url, NULL, &context); 1531 TestURLRequest request(non_sensitive_url, NULL, &context);
1530 GURL sensitive_url(sensitive_urls[i]); 1532 GURL sensitive_url(sensitive_urls[i]);
1531 request.set_first_party_for_cookies(sensitive_url); 1533 request.set_first_party_for_cookies(sensitive_url);
1532 EXPECT_TRUE(helpers::HideRequest(&request)) << sensitive_urls[i]; 1534 EXPECT_TRUE(helpers::HideRequest(&request)) << sensitive_urls[i];
1533 } 1535 }
1534 } 1536 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/io_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698