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 "testing/gtest/include/gtest/gtest.h" | |
engedy
2017/03/10 10:56:57
nit: Also #include base/bind.h and bind_helpers.h
Charlie Harrison
2017/03/10 17:12:47
Done.
| |
8 | |
9 namespace subresource_filter { | |
10 namespace testing { | |
11 | |
12 base::Callback<void(ActivationState)> | |
13 TestActivationStateCallbackReceiver::GetCallback() { | |
14 return base::Bind(&TestActivationStateCallbackReceiver::Callback, | |
15 base::Unretained(this)); | |
16 } | |
17 | |
18 void TestActivationStateCallbackReceiver::ExpectReceivedOnce( | |
19 const ActivationState& expected_state) const { | |
20 ASSERT_EQ(1, callback_count_); | |
21 EXPECT_EQ(expected_state, last_activation_state_); | |
22 } | |
23 | |
24 void TestActivationStateCallbackReceiver::Callback( | |
25 ActivationState activation_state) { | |
26 ++callback_count_; | |
27 last_activation_state_ = activation_state; | |
28 } | |
29 | |
30 } // namespace testing | |
31 } // namespace subresource_filter | |
OLD | NEW |