OLD | NEW |
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/core/browser/data_reduction_proxy_conf
ig.h" | 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
ig.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <cstdlib> | 10 #include <cstdlib> |
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 EXPECT_CALL(*config(), IsNetworkQualityProhibitivelySlow(_)) | 938 EXPECT_CALL(*config(), IsNetworkQualityProhibitivelySlow(_)) |
939 .WillRepeatedly(testing::Return(tests[i].network_prohibitively_slow)); | 939 .WillRepeatedly(testing::Return(tests[i].network_prohibitively_slow)); |
940 | 940 |
941 base::HistogramTester histogram_tester; | 941 base::HistogramTester histogram_tester; |
942 net::TestURLRequestContext context_; | 942 net::TestURLRequestContext context_; |
943 net::TestDelegate delegate_; | 943 net::TestDelegate delegate_; |
944 std::unique_ptr<net::URLRequest> request = | 944 std::unique_ptr<net::URLRequest> request = |
945 context_.CreateRequest(GURL(), net::IDLE, &delegate_); | 945 context_.CreateRequest(GURL(), net::IDLE, &delegate_); |
946 request->SetLoadFlags(request->load_flags() | | 946 request->SetLoadFlags(request->load_flags() | |
947 net::LOAD_MAIN_FRAME_DEPRECATED); | 947 net::LOAD_MAIN_FRAME_DEPRECATED); |
948 bool should_enable_lofi = config()->ShouldEnableLoFiMode(*request.get()); | 948 bool should_enable_lofi = config()->ShouldEnableLoFi(*request.get()); |
949 if (tests[i].expect_bucket_count != 0) { | 949 if (tests[i].expect_bucket_count != 0) { |
950 histogram_tester.ExpectBucketCount( | 950 histogram_tester.ExpectBucketCount( |
951 "DataReductionProxy.AutoLoFiRequestHeaderState.Unknown", | 951 "DataReductionProxy.AutoLoFiRequestHeaderState.Unknown", |
952 tests[i].bucket_to_check_for_auto_lofi_uma, | 952 tests[i].bucket_to_check_for_auto_lofi_uma, |
953 tests[i].expect_bucket_count); | 953 tests[i].expect_bucket_count); |
954 } | 954 } |
955 | 955 |
956 EXPECT_EQ(tests[i].expect_lofi_header, should_enable_lofi) << i; | 956 EXPECT_EQ(tests[i].expect_lofi_header, should_enable_lofi) << i; |
957 } | 957 } |
958 } | 958 } |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1281 // Sleep to ensure that the delayed task is posted. | 1281 // Sleep to ensure that the delayed task is posted. |
1282 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(1)); | 1282 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(1)); |
1283 RunUntilIdle(); | 1283 RunUntilIdle(); |
1284 histogram_tester.ExpectTotalCount( | 1284 histogram_tester.ExpectTotalCount( |
1285 "DataReductionProxy.LoFi.Accuracy.1.Unknown", 1); | 1285 "DataReductionProxy.LoFi.Accuracy.1.Unknown", 1); |
1286 histogram_tester.ExpectBucketCount( | 1286 histogram_tester.ExpectBucketCount( |
1287 "DataReductionProxy.LoFi.Accuracy.1.Unknown", 0, 1); | 1287 "DataReductionProxy.LoFi.Accuracy.1.Unknown", 0, 1); |
1288 } | 1288 } |
1289 | 1289 |
1290 } // namespace data_reduction_proxy | 1290 } // namespace data_reduction_proxy |
OLD | NEW |