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

Side by Side Diff: trunk/src/chrome/browser/policy/url_blacklist_manager_unittest.cc

Issue 47563006: Revert 232802 "[Net] Assert that URLRequests with LOAD_IGNORE_LI..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month 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 "chrome/browser/policy/url_blacklist_manager.h" 5 #include "chrome/browser/policy/url_blacklist_manager.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 EXPECT_TRUE(blacklist_manager_->IsURLBlocked(GURL("http://google.com"))); 497 EXPECT_TRUE(blacklist_manager_->IsURLBlocked(GURL("http://google.com")));
498 498
499 net::TestURLRequestContext context; 499 net::TestURLRequestContext context;
500 net::URLRequest request( 500 net::URLRequest request(
501 GURL("http://google.com"), net::DEFAULT_PRIORITY, NULL, &context); 501 GURL("http://google.com"), net::DEFAULT_PRIORITY, NULL, &context);
502 502
503 // Background requests aren't filtered. 503 // Background requests aren't filtered.
504 EXPECT_FALSE(blacklist_manager_->IsRequestBlocked(request)); 504 EXPECT_FALSE(blacklist_manager_->IsRequestBlocked(request));
505 505
506 // Main frames are filtered. 506 // Main frames are filtered.
507 request.SetLoadFlags(net::LOAD_MAIN_FRAME); 507 request.set_load_flags(net::LOAD_MAIN_FRAME);
508 EXPECT_TRUE(blacklist_manager_->IsRequestBlocked(request)); 508 EXPECT_TRUE(blacklist_manager_->IsRequestBlocked(request));
509 509
510 // On most platforms, sync gets a free pass due to signin flows. 510 // On most platforms, sync gets a free pass due to signin flows.
511 bool block_signin_urls = false; 511 bool block_signin_urls = false;
512 #if defined(OS_CHROMEOS) 512 #if defined(OS_CHROMEOS)
513 // There are no sync specific signin flows on Chrome OS, so no special 513 // There are no sync specific signin flows on Chrome OS, so no special
514 // treatment. 514 // treatment.
515 block_signin_urls = true; 515 block_signin_urls = true;
516 #endif 516 #endif
517 517
518 GURL sync_url(GaiaUrls::GetInstance()->service_login_url().Resolve( 518 GURL sync_url(GaiaUrls::GetInstance()->service_login_url().Resolve(
519 "?service=chromiumsync")); 519 "?service=chromiumsync"));
520 net::URLRequest sync_request(sync_url, net::DEFAULT_PRIORITY, NULL, &context); 520 net::URLRequest sync_request(sync_url, net::DEFAULT_PRIORITY, NULL, &context);
521 sync_request.SetLoadFlags(net::LOAD_MAIN_FRAME); 521 sync_request.set_load_flags(net::LOAD_MAIN_FRAME);
522 EXPECT_EQ(block_signin_urls, 522 EXPECT_EQ(block_signin_urls,
523 blacklist_manager_->IsRequestBlocked(sync_request)); 523 blacklist_manager_->IsRequestBlocked(sync_request));
524 } 524 }
525 525
526 } // namespace policy 526 } // namespace policy
OLDNEW
« no previous file with comments | « trunk/src/chrome/browser/net/http_pipelining_compatibility_client.cc ('k') | trunk/src/cloud_print/service/service_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698