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