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

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

Issue 12502017: signin: pull basic SigninManager functionality into new SigninManagerBase class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix override Created 7 years, 8 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 "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.h" 10 #include "base/message_loop.h"
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 net::TestURLRequestContext context; 456 net::TestURLRequestContext context;
457 net::URLRequest request(GURL("http://google.com"), NULL, &context); 457 net::URLRequest request(GURL("http://google.com"), NULL, &context);
458 458
459 // Background requests aren't filtered. 459 // Background requests aren't filtered.
460 EXPECT_FALSE(blacklist_manager_->IsRequestBlocked(request)); 460 EXPECT_FALSE(blacklist_manager_->IsRequestBlocked(request));
461 461
462 // Main frames are filtered. 462 // Main frames are filtered.
463 request.set_load_flags(net::LOAD_MAIN_FRAME); 463 request.set_load_flags(net::LOAD_MAIN_FRAME);
464 EXPECT_TRUE(blacklist_manager_->IsRequestBlocked(request)); 464 EXPECT_TRUE(blacklist_manager_->IsRequestBlocked(request));
465 465
466 // Sync gets a free pass. 466 // On most platforms, sync gets a free pass due to signin flows.
467 bool block_signin_urls = false;
468 #if defined(OS_CHROMEOS)
469 // There are no sync specific signin flows on Chrome OS, so no special
470 // treatment.
471 block_signin_urls = true;
472 #endif
473
467 GURL sync_url( 474 GURL sync_url(
468 GaiaUrls::GetInstance()->service_login_url() + "?service=chromiumsync"); 475 GaiaUrls::GetInstance()->service_login_url() + "?service=chromiumsync");
469 net::URLRequest sync_request(sync_url, NULL, &context); 476 net::URLRequest sync_request(sync_url, NULL, &context);
470 sync_request.set_load_flags(net::LOAD_MAIN_FRAME); 477 sync_request.set_load_flags(net::LOAD_MAIN_FRAME);
471 EXPECT_FALSE(blacklist_manager_->IsRequestBlocked(sync_request)); 478 EXPECT_EQ(block_signin_urls,
479 blacklist_manager_->IsRequestBlocked(sync_request));
472 } 480 }
473 481
474 } // namespace policy 482 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698