| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/history/history_service_factory.h" | 10 #include "chrome/browser/history/history_service_factory.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 // Check that we went back to the first URL and that the manual behaviors | 261 // Check that we went back to the first URL and that the manual behaviors |
| 262 // have not changed. | 262 // have not changed. |
| 263 EXPECT_EQ(allowed_url.spec(), tab->GetURL().spec()); | 263 EXPECT_EQ(allowed_url.spec(), tab->GetURL().spec()); |
| 264 EXPECT_EQ(SupervisedUserURLFilter::ALLOW, | 264 EXPECT_EQ(SupervisedUserURLFilter::ALLOW, |
| 265 filter->GetFilteringBehaviorForURL(allowed_url.GetWithEmptyPath())); | 265 filter->GetFilteringBehaviorForURL(allowed_url.GetWithEmptyPath())); |
| 266 EXPECT_EQ(SupervisedUserURLFilter::BLOCK, | 266 EXPECT_EQ(SupervisedUserURLFilter::BLOCK, |
| 267 filter->GetFilteringBehaviorForURL(blocked_url.GetWithEmptyPath())); | 267 filter->GetFilteringBehaviorForURL(blocked_url.GetWithEmptyPath())); |
| 268 | 268 |
| 269 // Query the history entry. | 269 // Query the history entry. |
| 270 HistoryService* history_service = HistoryServiceFactory::GetForProfile( | 270 HistoryService* history_service = HistoryServiceFactory::GetForProfile( |
| 271 browser()->profile(), Profile::EXPLICIT_ACCESS); | 271 browser()->profile(), ServiceAccessType::EXPLICIT_ACCESS); |
| 272 history::QueryOptions options; | 272 history::QueryOptions options; |
| 273 history::QueryResults results; | 273 history::QueryResults results; |
| 274 QueryHistory(history_service, "", options, &results); | 274 QueryHistory(history_service, "", options, &results); |
| 275 | 275 |
| 276 // Check that the entries have the correct blocked_visit value. | 276 // Check that the entries have the correct blocked_visit value. |
| 277 ASSERT_EQ(2u, results.size()); | 277 ASSERT_EQ(2u, results.size()); |
| 278 EXPECT_EQ(blocked_url.spec(), results[0].url().spec()); | 278 EXPECT_EQ(blocked_url.spec(), results[0].url().spec()); |
| 279 EXPECT_TRUE(results[0].blocked_visit()); | 279 EXPECT_TRUE(results[0].blocked_visit()); |
| 280 EXPECT_EQ(allowed_url.spec(), results[1].url().spec()); | 280 EXPECT_EQ(allowed_url.spec(), results[1].url().spec()); |
| 281 EXPECT_FALSE(results[1].blocked_visit()); | 281 EXPECT_FALSE(results[1].blocked_visit()); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 306 scoped_refptr<SupervisedUserURLFilter> filter = | 306 scoped_refptr<SupervisedUserURLFilter> filter = |
| 307 supervised_user_service_->GetURLFilterForUIThread(); | 307 supervised_user_service_->GetURLFilterForUIThread(); |
| 308 EXPECT_EQ(SupervisedUserURLFilter::ALLOW, | 308 EXPECT_EQ(SupervisedUserURLFilter::ALLOW, |
| 309 filter->GetFilteringBehaviorForURL(test_url.GetWithEmptyPath())); | 309 filter->GetFilteringBehaviorForURL(test_url.GetWithEmptyPath())); |
| 310 | 310 |
| 311 observer.Wait(); | 311 observer.Wait(); |
| 312 EXPECT_EQ(test_url, web_contents->GetURL()); | 312 EXPECT_EQ(test_url, web_contents->GetURL()); |
| 313 } | 313 } |
| 314 | 314 |
| 315 } // namespace | 315 } // namespace |
| OLD | NEW |