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

Side by Side Diff: components/data_reduction_proxy/content/browser/data_reduction_proxy_message_filter_unittest.cc

Issue 1086733002: Ensure tests have an active task runner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 7 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "components/data_reduction_proxy/content/browser/data_reduction_proxy_m essage_filter.h" 5 #include "components/data_reduction_proxy/content/browser/data_reduction_proxy_m essage_filter.h"
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf ig_test_utils.h" 9 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf ig_test_utils.h"
10 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_test _utils.h" 10 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_test _utils.h"
(...skipping 20 matching lines...) Expand all
31 protected: 31 protected:
32 DataReductionProxyMessageFilter* message_filter() const { 32 DataReductionProxyMessageFilter* message_filter() const {
33 return message_filter_.get(); 33 return message_filter_.get();
34 } 34 }
35 35
36 MockDataReductionProxyConfig* config() const { 36 MockDataReductionProxyConfig* config() const {
37 return test_context_->mock_config(); 37 return test_context_->mock_config();
38 } 38 }
39 39
40 private: 40 private:
41 base::MessageLoopForIO message_loop_;
41 scoped_ptr<DataReductionProxyTestContext> test_context_; 42 scoped_ptr<DataReductionProxyTestContext> test_context_;
42 scoped_refptr<DataReductionProxyMessageFilter> message_filter_; 43 scoped_refptr<DataReductionProxyMessageFilter> message_filter_;
43 }; 44 };
44 45
45 TEST_F(DataReductionProxyMessageFilterTest, TestOnIsDataReductionProxy) { 46 TEST_F(DataReductionProxyMessageFilterTest, TestOnIsDataReductionProxy) {
46 net::HostPortPair proxy_server = 47 net::HostPortPair proxy_server =
47 net::HostPortPair::FromString("www.google.com:443"); 48 net::HostPortPair::FromString("www.google.com:443");
48 bool is_data_reduction_proxy = false; 49 bool is_data_reduction_proxy = false;
49 EXPECT_CALL(*config(), IsDataReductionProxy(testing::_, nullptr)) 50 EXPECT_CALL(*config(), IsDataReductionProxy(testing::_, nullptr))
50 .Times(1) 51 .Times(1)
51 .WillOnce(testing::Return(true)); 52 .WillOnce(testing::Return(true));
52 message_filter()->OnIsDataReductionProxy(proxy_server, 53 message_filter()->OnIsDataReductionProxy(proxy_server,
53 &is_data_reduction_proxy); 54 &is_data_reduction_proxy);
54 EXPECT_TRUE(is_data_reduction_proxy); 55 EXPECT_TRUE(is_data_reduction_proxy);
55 56
56 EXPECT_CALL(*config(), IsDataReductionProxy(testing::_, nullptr)) 57 EXPECT_CALL(*config(), IsDataReductionProxy(testing::_, nullptr))
57 .Times(1) 58 .Times(1)
58 .WillOnce(testing::Return(false)); 59 .WillOnce(testing::Return(false));
59 message_filter()->OnIsDataReductionProxy(proxy_server, 60 message_filter()->OnIsDataReductionProxy(proxy_server,
60 &is_data_reduction_proxy); 61 &is_data_reduction_proxy);
61 EXPECT_FALSE(is_data_reduction_proxy); 62 EXPECT_FALSE(is_data_reduction_proxy);
62 } 63 }
63 64
64 } // namespace data_reduction_proxy 65 } // namespace data_reduction_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698