Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_ASYNC_DOCUMENT_SUBRESOURCE _FILTER_TEST_UTILS_H_ | |
| 6 #define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_ASYNC_DOCUMENT_SUBRESOURCE _FILTER_TEST_UTILS_H_ | |
| 7 | |
| 8 #include "components/subresource_filter/content/browser/async_document_subresour ce_filter.h" | |
|
engedy
2017/03/10 10:56:57
nit: Include activation_state.h instead and get ri
Charlie Harrison
2017/03/10 17:12:47
Done.
| |
| 9 | |
| 10 #include "base/bind.h" | |
|
engedy
2017/03/10 10:56:58
nit: callback_forward.h
Charlie Harrison
2017/03/10 17:12:47
Done.
| |
| 11 #include "base/macros.h" | |
| 12 | |
| 13 namespace subresource_filter { | |
| 14 namespace testing { | |
| 15 | |
| 16 // This test class is intended to be used in conjunction with an | |
| 17 // AsyncDocumentSubresourceFilter, and can be used to expect a certain | |
| 18 // activation result occured. | |
| 19 class TestActivationStateCallbackReceiver { | |
| 20 public: | |
| 21 TestActivationStateCallbackReceiver() = default; | |
| 22 | |
| 23 base::Callback<void(ActivationState)> GetCallback(); | |
| 24 void ExpectReceivedOnce(const ActivationState& expected_state) const; | |
| 25 | |
| 26 private: | |
| 27 void Callback(ActivationState activation_state); | |
| 28 | |
| 29 ActivationState last_activation_state_; | |
| 30 int callback_count_ = 0; | |
| 31 | |
| 32 DISALLOW_COPY_AND_ASSIGN(TestActivationStateCallbackReceiver); | |
| 33 }; | |
| 34 | |
| 35 } // namespace testing | |
| 36 } // namespace subresource_filter | |
| 37 | |
| 38 #endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_ASYNC_DOCUMENT_SUBRESOU RCE_FILTER_TEST_UTILS_H_ | |
| OLD | NEW |