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 "content/browser/appcache/appcache_storage_impl.h" | 5 #include "content/browser/appcache/appcache_storage_impl.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <stack> | 10 #include <stack> |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "content/browser/appcache/appcache_database.h" | 27 #include "content/browser/appcache/appcache_database.h" |
28 #include "content/browser/appcache/appcache_entry.h" | 28 #include "content/browser/appcache/appcache_entry.h" |
29 #include "content/browser/appcache/appcache_group.h" | 29 #include "content/browser/appcache/appcache_group.h" |
30 #include "content/browser/appcache/appcache_host.h" | 30 #include "content/browser/appcache/appcache_host.h" |
31 #include "content/browser/appcache/appcache_interceptor.h" | 31 #include "content/browser/appcache/appcache_interceptor.h" |
32 #include "content/browser/appcache/appcache_request_handler.h" | 32 #include "content/browser/appcache/appcache_request_handler.h" |
33 #include "content/browser/appcache/appcache_service_impl.h" | 33 #include "content/browser/appcache/appcache_service_impl.h" |
34 #include "net/base/net_errors.h" | 34 #include "net/base/net_errors.h" |
35 #include "net/base/request_priority.h" | 35 #include "net/base/request_priority.h" |
36 #include "net/http/http_response_headers.h" | 36 #include "net/http/http_response_headers.h" |
| 37 #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" |
37 #include "net/url_request/url_request_error_job.h" | 38 #include "net/url_request/url_request_error_job.h" |
38 #include "net/url_request/url_request_job_factory_impl.h" | 39 #include "net/url_request/url_request_job_factory_impl.h" |
39 #include "net/url_request/url_request_test_job.h" | 40 #include "net/url_request/url_request_test_job.h" |
40 #include "net/url_request/url_request_test_util.h" | 41 #include "net/url_request/url_request_test_util.h" |
41 #include "sql/test/test_helpers.h" | 42 #include "sql/test/test_helpers.h" |
42 #include "storage/browser/quota/quota_manager.h" | 43 #include "storage/browser/quota/quota_manager.h" |
43 #include "testing/gtest/include/gtest/gtest.h" | 44 #include "testing/gtest/include/gtest/gtest.h" |
44 | 45 |
45 namespace content { | 46 namespace content { |
46 | 47 |
(...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1765 MockHttpServer::GetMockUrl("manifest")); | 1766 MockHttpServer::GetMockUrl("manifest")); |
1766 } else { | 1767 } else { |
1767 ASSERT_EQ(CORRUPT_CACHE_ON_LOAD_EXISTING, test_case); | 1768 ASSERT_EQ(CORRUPT_CACHE_ON_LOAD_EXISTING, test_case); |
1768 // Try to access the existing cache manifest. | 1769 // Try to access the existing cache manifest. |
1769 // The URLRequestJob will eventually fail when it gets to disk | 1770 // The URLRequestJob will eventually fail when it gets to disk |
1770 // cache initialization. | 1771 // cache initialization. |
1771 backend_->RegisterHost(2); | 1772 backend_->RegisterHost(2); |
1772 AppCacheHost* host2 = backend_->GetHost(2); | 1773 AppCacheHost* host2 = backend_->GetHost(2); |
1773 GURL manifest_url = MockHttpServer::GetMockUrl("manifest"); | 1774 GURL manifest_url = MockHttpServer::GetMockUrl("manifest"); |
1774 request_ = service()->request_context()->CreateRequest( | 1775 request_ = service()->request_context()->CreateRequest( |
1775 manifest_url, net::DEFAULT_PRIORITY, &request_delegate_); | 1776 manifest_url, net::DEFAULT_PRIORITY, &request_delegate_, |
| 1777 TRAFFIC_ANNOTATION_FOR_TESTS); |
1776 AppCacheInterceptor::SetExtraRequestInfo( | 1778 AppCacheInterceptor::SetExtraRequestInfo( |
1777 request_.get(), service_.get(), backend_->process_id(), | 1779 request_.get(), service_.get(), backend_->process_id(), |
1778 host2->host_id(), RESOURCE_TYPE_MAIN_FRAME, false); | 1780 host2->host_id(), RESOURCE_TYPE_MAIN_FRAME, false); |
1779 request_->Start(); | 1781 request_->Start(); |
1780 } | 1782 } |
1781 | 1783 |
1782 PushNextTask(base::Bind( | 1784 PushNextTask(base::Bind( |
1783 &AppCacheStorageImplTest::Verify_Reinitialized, | 1785 &AppCacheStorageImplTest::Verify_Reinitialized, |
1784 base::Unretained(this), | 1786 base::Unretained(this), |
1785 test_case)); | 1787 test_case)); |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2026 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize2); | 2028 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize2); |
2027 } | 2029 } |
2028 | 2030 |
2029 TEST_F(AppCacheStorageImplTest, Reinitialize3) { | 2031 TEST_F(AppCacheStorageImplTest, Reinitialize3) { |
2030 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize3); | 2032 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize3); |
2031 } | 2033 } |
2032 | 2034 |
2033 // That's all folks! | 2035 // That's all folks! |
2034 | 2036 |
2035 } // namespace content | 2037 } // namespace content |
OLD | NEW |