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 #include "components/subresource_filter/content/browser/async_document_subresour
ce_filter_test_utils.h" |
| 6 |
| 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 |
| 11 namespace subresource_filter { |
| 12 namespace testing { |
| 13 |
| 14 base::Callback<void(ActivationState)> |
| 15 TestActivationStateCallbackReceiver::GetCallback() { |
| 16 return base::Bind(&TestActivationStateCallbackReceiver::Callback, |
| 17 base::Unretained(this)); |
| 18 } |
| 19 |
| 20 void TestActivationStateCallbackReceiver::ExpectReceivedOnce( |
| 21 const ActivationState& expected_state) const { |
| 22 ASSERT_EQ(1, callback_count_); |
| 23 EXPECT_EQ(expected_state, last_activation_state_); |
| 24 } |
| 25 |
| 26 void TestActivationStateCallbackReceiver::Callback( |
| 27 ActivationState activation_state) { |
| 28 ++callback_count_; |
| 29 last_activation_state_ = activation_state; |
| 30 } |
| 31 |
| 32 } // namespace testing |
| 33 } // namespace subresource_filter |
OLD | NEW |