| 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 "chrome/browser/android/offline_pages/offline_page_request_job.h" | 5 #include "chrome/browser/android/offline_pages/offline_page_request_job.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/feature_list.h" | 8 #include "base/feature_list.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 const GURL kTestUrl3WithFragment("http://test.org/page3#ref1"); | 49 const GURL kTestUrl3WithFragment("http://test.org/page3#ref1"); |
| 50 const ClientId kTestClientId = ClientId(kBookmarkNamespace, "1234"); | 50 const ClientId kTestClientId = ClientId(kBookmarkNamespace, "1234"); |
| 51 const ClientId kTestClientId2 = ClientId(kDownloadNamespace, "1a2b3c4d"); | 51 const ClientId kTestClientId2 = ClientId(kDownloadNamespace, "1a2b3c4d"); |
| 52 const ClientId kTestClientId3 = ClientId(kDownloadNamespace, "3456abcd"); | 52 const ClientId kTestClientId3 = ClientId(kDownloadNamespace, "3456abcd"); |
| 53 const int kTestFileSize = 444; | 53 const int kTestFileSize = 444; |
| 54 const int kTestFileSize2 = 450; | 54 const int kTestFileSize2 = 450; |
| 55 const int kTestFileSize3 = 450; | 55 const int kTestFileSize3 = 450; |
| 56 const int kTabId = 1; | 56 const int kTabId = 1; |
| 57 const int kBufSize = 1024; | 57 const int kBufSize = 1024; |
| 58 const char kAggregatedRequestResultHistogram[] = | 58 const char kAggregatedRequestResultHistogram[] = |
| 59 "OfflinePages.AggregatedRequestResult"; | 59 "OfflinePages.AggregatedRequestResult2"; |
| 60 | 60 |
| 61 class OfflinePageRequestJobTestDelegate : | 61 class OfflinePageRequestJobTestDelegate : |
| 62 public OfflinePageRequestJob::Delegate { | 62 public OfflinePageRequestJob::Delegate { |
| 63 public: | 63 public: |
| 64 OfflinePageRequestJobTestDelegate(content::WebContents* web_content, | 64 OfflinePageRequestJobTestDelegate(content::WebContents* web_content, |
| 65 int tab_id) | 65 int tab_id) |
| 66 : web_content_(web_content), | 66 : web_content_(web_content), |
| 67 tab_id_(tab_id) {} | 67 tab_id_(tab_id) {} |
| 68 | 68 |
| 69 content::ResourceRequestInfo::WebContentsGetter | 69 content::ResourceRequestInfo::WebContentsGetter |
| (...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 ASSERT_TRUE(offline_page_tab_helper()->GetOfflinePageForTest()); | 810 ASSERT_TRUE(offline_page_tab_helper()->GetOfflinePageForTest()); |
| 811 EXPECT_EQ(offline_id3(), | 811 EXPECT_EQ(offline_id3(), |
| 812 offline_page_tab_helper()->GetOfflinePageForTest()->offline_id); | 812 offline_page_tab_helper()->GetOfflinePageForTest()->offline_id); |
| 813 ExpectAggregatedRequestResultHistogramWithCount( | 813 ExpectAggregatedRequestResultHistogramWithCount( |
| 814 OfflinePageRequestJob::AggregatedRequestResult:: | 814 OfflinePageRequestJob::AggregatedRequestResult:: |
| 815 SHOW_OFFLINE_ON_DISCONNECTED_NETWORK, 3); | 815 SHOW_OFFLINE_ON_DISCONNECTED_NETWORK, 3); |
| 816 | 816 |
| 817 } | 817 } |
| 818 | 818 |
| 819 } // namespace offline_pages | 819 } // namespace offline_pages |
| OLD | NEW |