| 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 "chrome/browser/supervised_user/experimental/supervised_user_async_url_
checker.h" |
| 6 |
| 5 #include <stddef.h> | 7 #include <stddef.h> |
| 6 | 8 |
| 9 #include <memory> |
| 7 #include <string> | 10 #include <string> |
| 8 | 11 |
| 9 #include "base/callback.h" | 12 #include "base/callback.h" |
| 10 #include "base/json/json_writer.h" | 13 #include "base/json/json_writer.h" |
| 11 #include "base/macros.h" | 14 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 14 #include "base/thread_task_runner_handle.h" | 16 #include "base/thread_task_runner_handle.h" |
| 15 #include "base/values.h" | 17 #include "base/values.h" |
| 16 #include "chrome/browser/supervised_user/experimental/supervised_user_async_url_
checker.h" | |
| 17 #include "net/base/net_errors.h" | 18 #include "net/base/net_errors.h" |
| 18 #include "net/url_request/test_url_fetcher_factory.h" | 19 #include "net/url_request/test_url_fetcher_factory.h" |
| 19 #include "net/url_request/url_request_test_util.h" | 20 #include "net/url_request/url_request_test_util.h" |
| 20 #include "testing/gmock/include/gmock/gmock.h" | 21 #include "testing/gmock/include/gmock/gmock.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 22 #include "url/gurl.h" | 23 #include "url/gurl.h" |
| 23 | 24 |
| 24 using testing::_; | 25 using testing::_; |
| 25 | 26 |
| 26 namespace { | 27 namespace { |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 ASSERT_FALSE(CheckURL(url)); | 212 ASSERT_FALSE(CheckURL(url)); |
| 212 EXPECT_CALL(*this, OnCheckDone(url, SupervisedUserURLFilter::ALLOW, false)); | 213 EXPECT_CALL(*this, OnCheckDone(url, SupervisedUserURLFilter::ALLOW, false)); |
| 213 SendValidResponse(false); | 214 SendValidResponse(false); |
| 214 | 215 |
| 215 // Since the cache timeout is zero, the cache entry should be invalidated | 216 // Since the cache timeout is zero, the cache entry should be invalidated |
| 216 // immediately. | 217 // immediately. |
| 217 ASSERT_FALSE(CheckURL(url)); | 218 ASSERT_FALSE(CheckURL(url)); |
| 218 EXPECT_CALL(*this, OnCheckDone(url, SupervisedUserURLFilter::BLOCK, false)); | 219 EXPECT_CALL(*this, OnCheckDone(url, SupervisedUserURLFilter::BLOCK, false)); |
| 219 SendValidResponse(true); | 220 SendValidResponse(true); |
| 220 } | 221 } |
| OLD | NEW |