OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef COMPONENTS_TEST_RUNNER_MOCK_WEB_DOCUMENT_SUBRESOURCE_FILTER_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_MOCK_WEB_DOCUMENT_SUBRESOURCE_FILTER_H_ |
6 #define COMPONENTS_TEST_RUNNER_MOCK_WEB_DOCUMENT_SUBRESOURCE_FILTER_H_ | 6 #define COMPONENTS_TEST_RUNNER_MOCK_WEB_DOCUMENT_SUBRESOURCE_FILTER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "third_party/WebKit/public/platform/WebDocumentSubresourceFilter.h" | 12 #include "third_party/WebKit/public/platform/WebDocumentSubresourceFilter.h" |
| 13 #include "third_party/WebKit/public/platform/WebDocumentSubresourceFilterLoadPol
icy.h" |
13 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 14 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
14 | 15 |
15 namespace blink { | 16 namespace blink { |
16 class WebURL; | 17 class WebURL; |
17 } // namespace blink | 18 } // namespace blink |
18 | 19 |
19 namespace test_runner { | 20 namespace test_runner { |
20 | 21 |
21 class MockWebDocumentSubresourceFilter | 22 class MockWebDocumentSubresourceFilter |
22 : public blink::WebDocumentSubresourceFilter { | 23 : public blink::WebDocumentSubresourceFilter { |
23 public: | 24 public: |
24 explicit MockWebDocumentSubresourceFilter( | 25 explicit MockWebDocumentSubresourceFilter( |
25 const std::vector<std::string>& disallowed_path_suffixes); | 26 const std::vector<std::string>& disallowed_path_suffixes); |
26 ~MockWebDocumentSubresourceFilter() override; | 27 ~MockWebDocumentSubresourceFilter() override; |
27 | 28 |
28 // blink::WebDocumentSubresourceFilter: | 29 // blink::WebDocumentSubresourceFilter: |
29 LoadPolicy getLoadPolicy(const blink::WebURL& resource_url, | 30 blink::WebDocumentSubresourceFilterLoadPolicy getLoadPolicy( |
30 blink::WebURLRequest::RequestContext) override; | 31 const blink::WebURL& resource_url, |
| 32 blink::WebURLRequest::RequestContext) override; |
31 void reportDisallowedLoad() override; | 33 void reportDisallowedLoad() override; |
32 | 34 |
33 private: | 35 private: |
34 std::vector<std::string> disallowed_path_suffixes_; | 36 std::vector<std::string> disallowed_path_suffixes_; |
35 | 37 |
36 DISALLOW_COPY_AND_ASSIGN(MockWebDocumentSubresourceFilter); | 38 DISALLOW_COPY_AND_ASSIGN(MockWebDocumentSubresourceFilter); |
37 }; | 39 }; |
38 | 40 |
39 } // namespace test_runner | 41 } // namespace test_runner |
40 | 42 |
41 #endif // COMPONENTS_TEST_RUNNER_MOCK_WEB_DOCUMENT_SUBRESOURCE_FILTER_H_ | 43 #endif // COMPONENTS_TEST_RUNNER_MOCK_WEB_DOCUMENT_SUBRESOURCE_FILTER_H_ |
OLD | NEW |