OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <memory> | 5 #include <memory> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 web_resource_server, | 66 web_resource_server, |
67 application_locale, | 67 application_locale, |
68 last_update_time_pref_name, | 68 last_update_time_pref_name, |
69 start_fetch_delay_ms, | 69 start_fetch_delay_ms, |
70 cache_update_delay_ms, | 70 cache_update_delay_ms, |
71 request_context, | 71 request_context, |
72 disable_network_switch, | 72 disable_network_switch, |
73 parse_json_callback, | 73 parse_json_callback, |
74 TRAFFIC_ANNOTATION_FOR_TESTS){}; | 74 TRAFFIC_ANNOTATION_FOR_TESTS){}; |
75 | 75 |
76 void Unpack(const base::DictionaryValue& parsed_json) override{}; | 76 void Unpack(const base::DictionaryValue& parsed_json) override {} |
77 }; | 77 }; |
78 | 78 |
79 class WebResourceServiceTest : public testing::Test { | 79 class WebResourceServiceTest : public testing::Test { |
80 public: | 80 public: |
81 WebResourceServiceTest() {} | 81 WebResourceServiceTest() {} |
82 | 82 |
83 void SetUp() override { | 83 void SetUp() override { |
84 request_context_getter_ = new net::TestURLRequestContextGetter( | 84 request_context_getter_ = new net::TestURLRequestContextGetter( |
85 base::ThreadTaskRunnerHandle::Get()); | 85 base::ThreadTaskRunnerHandle::Get()); |
86 local_state_.reset(new TestingPrefServiceSimple()); | 86 local_state_.reset(new TestingPrefServiceSimple()); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 TEST_F(WebResourceServiceTest, FetchScheduledOnStartFetchTest) { | 147 TEST_F(WebResourceServiceTest, FetchScheduledOnStartFetchTest) { |
148 resource_notifier()->NotifyState( | 148 resource_notifier()->NotifyState( |
149 ResourceRequestAllowedNotifier::DISALLOWED_NETWORK_DOWN); | 149 ResourceRequestAllowedNotifier::DISALLOWED_NETWORK_DOWN); |
150 CallStartFetch(); | 150 CallStartFetch(); |
151 EXPECT_FALSE(GetFetchScheduled()); | 151 EXPECT_FALSE(GetFetchScheduled()); |
152 resource_notifier()->NotifyState(ResourceRequestAllowedNotifier::ALLOWED); | 152 resource_notifier()->NotifyState(ResourceRequestAllowedNotifier::ALLOWED); |
153 EXPECT_TRUE(GetFetchScheduled()); | 153 EXPECT_TRUE(GetFetchScheduled()); |
154 } | 154 } |
155 | 155 |
156 } // namespace web_resource | 156 } // namespace web_resource |
OLD | NEW |