| OLD | NEW |
| 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/autofill/core/browser/autofill_download_manager.h" | 5 #include "components/autofill/core/browser/autofill_download_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "base/test/histogram_tester.h" | 15 #include "base/test/histogram_tester.h" |
| 16 #include "base/test/test_timeouts.h" | 16 #include "base/test/test_timeouts.h" |
| 17 #include "base/thread_task_runner_handle.h" | 17 #include "base/thread_task_runner_handle.h" |
| 18 #include "components/autofill/core/browser/autofill_field.h" | 18 #include "components/autofill/core/browser/autofill_field.h" |
| 19 #include "components/autofill/core/browser/autofill_metrics.h" | 19 #include "components/autofill/core/browser/autofill_metrics.h" |
| 20 #include "components/autofill/core/browser/autofill_type.h" | 20 #include "components/autofill/core/browser/autofill_type.h" |
| 21 #include "components/autofill/core/browser/form_structure.h" | 21 #include "components/autofill/core/browser/form_structure.h" |
| 22 #include "components/autofill/core/browser/test_autofill_driver.h" | 22 #include "components/autofill/core/browser/test_autofill_driver.h" |
| 23 #include "components/autofill/core/common/form_data.h" | 23 #include "components/autofill/core/common/form_data.h" |
| 24 #include "components/compression/compression_utils.h" | |
| 25 #include "net/http/http_request_headers.h" | 24 #include "net/http/http_request_headers.h" |
| 26 #include "net/http/http_status_code.h" | 25 #include "net/http/http_status_code.h" |
| 27 #include "net/url_request/test_url_fetcher_factory.h" | 26 #include "net/url_request/test_url_fetcher_factory.h" |
| 28 #include "net/url_request/url_request_status.h" | 27 #include "net/url_request/url_request_status.h" |
| 29 #include "net/url_request/url_request_test_util.h" | 28 #include "net/url_request/url_request_test_util.h" |
| 30 #include "testing/gmock/include/gmock/gmock.h" | 29 #include "testing/gmock/include/gmock/gmock.h" |
| 31 #include "testing/gtest/include/gtest/gtest.h" | 30 #include "testing/gtest/include/gtest/gtest.h" |
| 31 #include "third_party/zlib/google/compression_utils.h" |
| 32 | 32 |
| 33 using base::ASCIIToUTF16; | 33 using base::ASCIIToUTF16; |
| 34 | 34 |
| 35 namespace autofill { | 35 namespace autofill { |
| 36 | 36 |
| 37 namespace { | 37 namespace { |
| 38 | 38 |
| 39 // Call |fetcher->OnURLFetchComplete()| as the URLFetcher would when | 39 // Call |fetcher->OnURLFetchComplete()| as the URLFetcher would when |
| 40 // a response is received. Params allow caller to set fake status. | 40 // a response is received. Params allow caller to set fake status. |
| 41 void FakeOnURLFetchComplete(net::TestURLFetcher* fetcher, | 41 void FakeOnURLFetchComplete(net::TestURLFetcher* fetcher, |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 EXPECT_EQ("gzip", header); | 759 EXPECT_EQ("gzip", header); |
| 760 | 760 |
| 761 // Expect that the compression is logged. | 761 // Expect that the compression is logged. |
| 762 // NOTE: To get the expected value, run tests with --vmodule=autofill*=1 and | 762 // NOTE: To get the expected value, run tests with --vmodule=autofill*=1 and |
| 763 // watch for the VLOG which indicates compression. | 763 // watch for the VLOG which indicates compression. |
| 764 histogram.ExpectUniqueSample("Autofill.PayloadCompressionRatio.Upload", 90, | 764 histogram.ExpectUniqueSample("Autofill.PayloadCompressionRatio.Upload", 90, |
| 765 1); | 765 1); |
| 766 } | 766 } |
| 767 | 767 |
| 768 } // namespace autofill | 768 } // namespace autofill |
| OLD | NEW |