OLD | NEW |
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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/prefs/pref_service.h" | 6 #include "base/prefs/pref_service.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/common/cancelable_request.h" | 10 #include "chrome/browser/common/cancelable_request.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 119 |
120 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 120 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
121 // Enable the test server and remap all URLs to it. | 121 // Enable the test server and remap all URLs to it. |
122 ASSERT_TRUE(test_server()->Start()); | 122 ASSERT_TRUE(test_server()->Start()); |
123 std::string host_port = test_server()->host_port_pair().ToString(); | 123 std::string host_port = test_server()->host_port_pair().ToString(); |
124 command_line->AppendSwitchASCII(switches::kHostResolverRules, | 124 command_line->AppendSwitchASCII(switches::kHostResolverRules, |
125 "MAP *.example.com " + host_port + "," + | 125 "MAP *.example.com " + host_port + "," + |
126 "MAP *.new-example.com " + host_port + "," + | 126 "MAP *.new-example.com " + host_port + "," + |
127 "MAP *.a.com " + host_port); | 127 "MAP *.a.com " + host_port); |
128 | 128 |
129 command_line->AppendSwitchASCII(switches::kManagedUserId, "asdf"); | 129 command_line->AppendSwitchASCII(switches::kSupervisedUserId, "asdf"); |
130 } | 130 } |
131 | 131 |
132 // Acts like a synchronous call to history's QueryHistory. Modified from | 132 // Acts like a synchronous call to history's QueryHistory. Modified from |
133 // history_querying_unittest.cc. | 133 // history_querying_unittest.cc. |
134 void QueryHistory(HistoryService* history_service, | 134 void QueryHistory(HistoryService* history_service, |
135 const std::string& text_query, | 135 const std::string& text_query, |
136 const history::QueryOptions& options, | 136 const history::QueryOptions& options, |
137 history::QueryResults* results) { | 137 history::QueryResults* results) { |
138 CancelableRequestConsumer history_request_consumer; | 138 CancelableRequestConsumer history_request_consumer; |
139 base::RunLoop run_loop; | 139 base::RunLoop run_loop; |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 dict.PassAs<base::Value>()); | 304 dict.PassAs<base::Value>()); |
305 EXPECT_EQ( | 305 EXPECT_EQ( |
306 ManagedUserService::MANUAL_ALLOW, | 306 ManagedUserService::MANUAL_ALLOW, |
307 managed_user_service_->GetManualBehaviorForHost(test_url.host())); | 307 managed_user_service_->GetManualBehaviorForHost(test_url.host())); |
308 | 308 |
309 observer.Wait(); | 309 observer.Wait(); |
310 EXPECT_EQ(test_url, web_contents->GetURL()); | 310 EXPECT_EQ(test_url, web_contents->GetURL()); |
311 } | 311 } |
312 | 312 |
313 } // namespace | 313 } // namespace |
OLD | NEW |