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

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

Issue 12235003: Split out policy code from net/tools/testserver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Saving a file, sherlock? ;) Created 7 years, 10 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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after
1439 IN_PROC_BROWSER_TEST_F(PolicyTest, URLBlacklist) { 1439 IN_PROC_BROWSER_TEST_F(PolicyTest, URLBlacklist) {
1440 // Checks that URLs can be blacklisted, and that exceptions can be made to 1440 // Checks that URLs can be blacklisted, and that exceptions can be made to
1441 // the blacklist. 1441 // the blacklist.
1442 1442
1443 // Filter |kURLS| on IO thread, so that requests to those hosts end up 1443 // Filter |kURLS| on IO thread, so that requests to those hosts end up
1444 // as URLRequestMockHTTPJobs. 1444 // as URLRequestMockHTTPJobs.
1445 const char* kURLS[] = { 1445 const char* kURLS[] = {
1446 "http://aaa.com/empty.html", 1446 "http://aaa.com/empty.html",
1447 "http://bbb.com/empty.html", 1447 "http://bbb.com/empty.html",
1448 "http://sub.bbb.com/empty.html", 1448 "http://sub.bbb.com/empty.html",
1449 "http://bbb.com/policy/device_management", 1449 "http://bbb.com/policy/blank.html",
1450 }; 1450 };
1451 BrowserThread::PostTaskAndReply( 1451 BrowserThread::PostTaskAndReply(
1452 BrowserThread::IO, FROM_HERE, 1452 BrowserThread::IO, FROM_HERE,
1453 base::Bind(RedirectHostsToTestData, kURLS, arraysize(kURLS)), 1453 base::Bind(RedirectHostsToTestData, kURLS, arraysize(kURLS)),
1454 MessageLoop::QuitClosure()); 1454 MessageLoop::QuitClosure());
1455 content::RunMessageLoop(); 1455 content::RunMessageLoop();
1456 1456
1457 // Verify that all the URLs can be opened without a blacklist. 1457 // Verify that all the URLs can be opened without a blacklist.
1458 for (size_t i = 0; i < arraysize(kURLS); ++i) 1458 for (size_t i = 0; i < arraysize(kURLS); ++i)
1459 CheckCanOpenURL(browser(), kURLS[i]); 1459 CheckCanOpenURL(browser(), kURLS[i]);
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
1881 this)); 1881 this));
1882 1882
1883 MessageLoop::current()->Run(); 1883 MessageLoop::current()->Run();
1884 } 1884 }
1885 1885
1886 INSTANTIATE_TEST_CASE_P(MediaStreamDevicesControllerBrowserTestInstance, 1886 INSTANTIATE_TEST_CASE_P(MediaStreamDevicesControllerBrowserTestInstance,
1887 MediaStreamDevicesControllerBrowserTest, 1887 MediaStreamDevicesControllerBrowserTest,
1888 testing::Bool()); 1888 testing::Bool());
1889 1889
1890 } // namespace policy 1890 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698