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

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

Issue 1546143002: Switch to standard integer types in components/, part 1 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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/core/browser/data_reduction_proxy_sett ings_test_utils.h" 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings_test_utils.h"
6 6
7 #include <stdint.h>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/command_line.h" 10 #include "base/command_line.h"
9 #include "base/prefs/pref_registry_simple.h" 11 #include "base/prefs/pref_registry_simple.h"
10 #include "base/prefs/scoped_user_pref_update.h" 12 #include "base/prefs/scoped_user_pref_update.h"
11 #include "base/prefs/testing_pref_service.h" 13 #include "base/prefs/testing_pref_service.h"
12 #include "base/strings/string_number_conversions.h" 14 #include "base/strings/string_number_conversions.h"
13 #include "base/time/time.h" 15 #include "base/time/time.h"
14 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp ression_stats.h" 16 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp ression_stats.h"
15 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf ig_test_utils.h" 17 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf ig_test_utils.h"
16 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_test _utils.h" 18 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_test _utils.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 pref_service->registry()->RegisterDictionaryPref(kProxy); 54 pref_service->registry()->RegisterDictionaryPref(kProxy);
53 pref_service->SetBoolean(prefs::kDataReductionProxyWasEnabledBefore, false); 55 pref_service->SetBoolean(prefs::kDataReductionProxyWasEnabledBefore, false);
54 56
55 //AddProxyToCommandLine(); 57 //AddProxyToCommandLine();
56 ResetSettings(true, true, true, false); 58 ResetSettings(true, true, true, false);
57 59
58 ListPrefUpdate original_update(test_context_->pref_service(), 60 ListPrefUpdate original_update(test_context_->pref_service(),
59 prefs::kDailyHttpOriginalContentLength); 61 prefs::kDailyHttpOriginalContentLength);
60 ListPrefUpdate received_update(test_context_->pref_service(), 62 ListPrefUpdate received_update(test_context_->pref_service(),
61 prefs::kDailyHttpReceivedContentLength); 63 prefs::kDailyHttpReceivedContentLength);
62 for (int64 i = 0; i < kNumDaysInHistory; i++) { 64 for (int64_t i = 0; i < kNumDaysInHistory; i++) {
63 original_update->Insert(0, 65 original_update->Insert(0,
64 new base::StringValue(base::Int64ToString(2 * i))); 66 new base::StringValue(base::Int64ToString(2 * i)));
65 received_update->Insert(0, new base::StringValue(base::Int64ToString(i))); 67 received_update->Insert(0, new base::StringValue(base::Int64ToString(i)));
66 } 68 }
67 last_update_time_ = base::Time::Now().LocalMidnight(); 69 last_update_time_ = base::Time::Now().LocalMidnight();
68 pref_service->SetInt64(prefs::kDailyHttpContentLengthLastUpdateDate, 70 pref_service->SetInt64(prefs::kDailyHttpContentLengthLastUpdateDate,
69 last_update_time_.ToInternalValue()); 71 last_update_time_.ToInternalValue());
70 } 72 }
71 73
72 template <class C> 74 template <class C>
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 synthetic_field_trials_["SyntheticDataReductionProxySetting"]); 158 synthetic_field_trials_["SyntheticDataReductionProxySetting"]);
157 } 159 }
158 160
159 void DataReductionProxySettingsTestBase:: 161 void DataReductionProxySettingsTestBase::
160 CheckDataReductionProxyLoFiSyntheticTrial(bool enabled) { 162 CheckDataReductionProxyLoFiSyntheticTrial(bool enabled) {
161 EXPECT_EQ(enabled ? "Enabled" : "Disabled", 163 EXPECT_EQ(enabled ? "Enabled" : "Disabled",
162 synthetic_field_trials_["SyntheticDataReductionProxyLoFiSetting"]); 164 synthetic_field_trials_["SyntheticDataReductionProxyLoFiSetting"]);
163 } 165 }
164 166
165 } // namespace data_reduction_proxy 167 } // namespace data_reduction_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698