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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 managed_user_service_->GetManualBehaviorForHost("www.new-example.com")); | 217 managed_user_service_->GetManualBehaviorForHost("www.new-example.com")); |
218 | 218 |
219 // Query the history entry. | 219 // Query the history entry. |
220 HistoryService* history_service = HistoryServiceFactory::GetForProfile( | 220 HistoryService* history_service = HistoryServiceFactory::GetForProfile( |
221 browser()->profile(), Profile::EXPLICIT_ACCESS); | 221 browser()->profile(), Profile::EXPLICIT_ACCESS); |
222 history::QueryOptions options; | 222 history::QueryOptions options; |
223 history::QueryResults results; | 223 history::QueryResults results; |
224 QueryHistory(history_service, "", options, &results); | 224 QueryHistory(history_service, "", options, &results); |
225 | 225 |
226 // Check that the entries have the correct blocked_visit value. | 226 // Check that the entries have the correct blocked_visit value. |
227 EXPECT_EQ(2u, results.size()); | 227 ASSERT_EQ(2u, results.size()); |
228 EXPECT_EQ(blocked_url.spec(), results[0].url().spec()); | 228 EXPECT_EQ(blocked_url.spec(), results[0].url().spec()); |
229 EXPECT_TRUE(results[0].blocked_visit()); | 229 EXPECT_TRUE(results[0].blocked_visit()); |
230 EXPECT_EQ(allowed_url.spec(), results[1].url().spec()); | 230 EXPECT_EQ(allowed_url.spec(), results[1].url().spec()); |
231 EXPECT_FALSE(results[1].blocked_visit()); | 231 EXPECT_FALSE(results[1].blocked_visit()); |
232 } | 232 } |
233 | 233 |
234 IN_PROC_BROWSER_TEST_F(ManagedModeBlockModeTest, Unblock) { | 234 IN_PROC_BROWSER_TEST_F(ManagedModeBlockModeTest, Unblock) { |
235 GURL test_url("http://www.example.com/files/simple.html"); | 235 GURL test_url("http://www.example.com/files/simple.html"); |
236 ui_test_utils::NavigateToURL(browser(), test_url); | 236 ui_test_utils::NavigateToURL(browser(), test_url); |
237 | 237 |
(...skipping 16 matching lines...) Expand all Loading... |
254 managed_users::kContentPackManualBehaviorHosts, dict.PassAs<Value>()); | 254 managed_users::kContentPackManualBehaviorHosts, dict.PassAs<Value>()); |
255 EXPECT_EQ( | 255 EXPECT_EQ( |
256 ManagedUserService::MANUAL_ALLOW, | 256 ManagedUserService::MANUAL_ALLOW, |
257 managed_user_service_->GetManualBehaviorForHost(test_url.host())); | 257 managed_user_service_->GetManualBehaviorForHost(test_url.host())); |
258 | 258 |
259 observer.Wait(); | 259 observer.Wait(); |
260 EXPECT_EQ(test_url, web_contents->GetURL()); | 260 EXPECT_EQ(test_url, web_contents->GetURL()); |
261 } | 261 } |
262 | 262 |
263 } // namespace | 263 } // namespace |
OLD | NEW |