Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: components/subresource_filter/content/browser/async_document_subresource_filter_test_utils.cc

Issue 2731013002: ActivationStateComputingThrottle unit tests (Closed)
Patch Set: engedy review2 Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698