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

Side by Side Diff: components/data_reduction_proxy/browser/data_reduction_proxy_settings_test_utils.cc

Issue 421653005: Adding synthetic field trial for DataReductionProxyEnabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@newPltWithCL
Patch Set: indent fixed Created 6 years, 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/data_reduction_proxy_settings_ test_utils.h" 5 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings_ test_utils.h"
6 6
7 #include "base/bind.h"
7 #include "base/command_line.h" 8 #include "base/command_line.h"
8 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
9 #include "base/prefs/pref_registry_simple.h" 10 #include "base/prefs/pref_registry_simple.h"
10 #include "base/prefs/scoped_user_pref_update.h" 11 #include "base/prefs/scoped_user_pref_update.h"
11 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
12 #include "components/data_reduction_proxy/common/data_reduction_proxy_pref_names .h" 13 #include "components/data_reduction_proxy/common/data_reduction_proxy_pref_names .h"
13 #include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h " 14 #include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h "
14 15
15 using testing::_; 16 using testing::_;
16 using testing::AnyNumber; 17 using testing::AnyNumber;
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 kWarmupURLWithNoContentResponse, 293 kWarmupURLWithNoContentResponse,
293 "OK", 294 "OK",
294 FetchResult(enabled_at_startup, true), 295 FetchResult(enabled_at_startup, true),
295 true, 296 true,
296 enabled_at_startup ? 1 : 0); 297 enabled_at_startup ? 1 : 0);
297 scoped_ptr<DataReductionProxyConfigurator> configurator( 298 scoped_ptr<DataReductionProxyConfigurator> configurator(
298 new TestDataReductionProxyConfig()); 299 new TestDataReductionProxyConfig());
299 settings_->SetProxyConfigurator(configurator.Pass()); 300 settings_->SetProxyConfigurator(configurator.Pass());
300 scoped_refptr<net::TestURLRequestContextGetter> request_context = 301 scoped_refptr<net::TestURLRequestContextGetter> request_context =
301 new net::TestURLRequestContextGetter(base::MessageLoopProxy::current()); 302 new net::TestURLRequestContextGetter(base::MessageLoopProxy::current());
302 settings_->InitDataReductionProxySettings(&pref_service_, 303
303 &pref_service_, 304 settings_->InitDataReductionProxySettings(
304 request_context.get()); 305 &pref_service_,
306 &pref_service_,
307 request_context.get());
308 settings_->SetOnDataReductionEnabledCallback(
309 base::Bind(&DataReductionProxySettingsTestBase::
310 RegisterSyntheticFieldTrialCallback,
311 base::Unretained(this)));
305 312
306 base::MessageLoop::current()->RunUntilIdle(); 313 base::MessageLoop::current()->RunUntilIdle();
307 CheckProxyConfigs(enabled_at_startup, false, false); 314 CheckProxyConfigs(enabled_at_startup, false, false);
315 EXPECT_EQ(enabled_at_startup, proxy_enabled_);
308 } 316 }
309 317
310 } // namespace data_reduction_proxy 318 } // namespace data_reduction_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698