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

Side by Side Diff: content/browser/appcache/appcache_storage_impl_unittest.cc

Issue 2799133005: Network traffic annotation added to appcache_update_job. (Closed)
Patch Set: Comments addressed. Created 3 years, 7 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 "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 17 matching lines...) Expand all
28 #include "content/browser/appcache/appcache_database.h" 28 #include "content/browser/appcache/appcache_database.h"
29 #include "content/browser/appcache/appcache_entry.h" 29 #include "content/browser/appcache/appcache_entry.h"
30 #include "content/browser/appcache/appcache_group.h" 30 #include "content/browser/appcache/appcache_group.h"
31 #include "content/browser/appcache/appcache_host.h" 31 #include "content/browser/appcache/appcache_host.h"
32 #include "content/browser/appcache/appcache_interceptor.h" 32 #include "content/browser/appcache/appcache_interceptor.h"
33 #include "content/browser/appcache/appcache_request_handler.h" 33 #include "content/browser/appcache/appcache_request_handler.h"
34 #include "content/browser/appcache/appcache_service_impl.h" 34 #include "content/browser/appcache/appcache_service_impl.h"
35 #include "net/base/net_errors.h" 35 #include "net/base/net_errors.h"
36 #include "net/base/request_priority.h" 36 #include "net/base/request_priority.h"
37 #include "net/http/http_response_headers.h" 37 #include "net/http/http_response_headers.h"
38 #include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
38 #include "net/url_request/url_request_error_job.h" 39 #include "net/url_request/url_request_error_job.h"
39 #include "net/url_request/url_request_job_factory_impl.h" 40 #include "net/url_request/url_request_job_factory_impl.h"
40 #include "net/url_request/url_request_test_job.h" 41 #include "net/url_request/url_request_test_job.h"
41 #include "net/url_request/url_request_test_util.h" 42 #include "net/url_request/url_request_test_util.h"
42 #include "sql/test/test_helpers.h" 43 #include "sql/test/test_helpers.h"
43 #include "storage/browser/quota/quota_manager.h" 44 #include "storage/browser/quota/quota_manager.h"
44 #include "testing/gtest/include/gtest/gtest.h" 45 #include "testing/gtest/include/gtest/gtest.h"
45 46
46 namespace content { 47 namespace content {
47 48
(...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after
1766 MockHttpServer::GetMockUrl("manifest")); 1767 MockHttpServer::GetMockUrl("manifest"));
1767 } else { 1768 } else {
1768 ASSERT_EQ(CORRUPT_CACHE_ON_LOAD_EXISTING, test_case); 1769 ASSERT_EQ(CORRUPT_CACHE_ON_LOAD_EXISTING, test_case);
1769 // Try to access the existing cache manifest. 1770 // Try to access the existing cache manifest.
1770 // The URLRequestJob will eventually fail when it gets to disk 1771 // The URLRequestJob will eventually fail when it gets to disk
1771 // cache initialization. 1772 // cache initialization.
1772 backend_->RegisterHost(2); 1773 backend_->RegisterHost(2);
1773 AppCacheHost* host2 = backend_->GetHost(2); 1774 AppCacheHost* host2 = backend_->GetHost(2);
1774 GURL manifest_url = MockHttpServer::GetMockUrl("manifest"); 1775 GURL manifest_url = MockHttpServer::GetMockUrl("manifest");
1775 request_ = service()->request_context()->CreateRequest( 1776 request_ = service()->request_context()->CreateRequest(
1776 manifest_url, net::DEFAULT_PRIORITY, &request_delegate_); 1777 manifest_url, net::DEFAULT_PRIORITY, &request_delegate_,
1778 TRAFFIC_ANNOTATION_FOR_TESTS);
1777 AppCacheInterceptor::SetExtraRequestInfo( 1779 AppCacheInterceptor::SetExtraRequestInfo(
1778 request_.get(), service_.get(), backend_->process_id(), 1780 request_.get(), service_.get(), backend_->process_id(),
1779 host2->host_id(), RESOURCE_TYPE_MAIN_FRAME, false); 1781 host2->host_id(), RESOURCE_TYPE_MAIN_FRAME, false);
1780 request_->Start(); 1782 request_->Start();
1781 } 1783 }
1782 1784
1783 PushNextTask(base::Bind( 1785 PushNextTask(base::Bind(
1784 &AppCacheStorageImplTest::Verify_Reinitialized, 1786 &AppCacheStorageImplTest::Verify_Reinitialized,
1785 base::Unretained(this), 1787 base::Unretained(this),
1786 test_case)); 1788 test_case));
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
2027 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize2); 2029 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize2);
2028 } 2030 }
2029 2031
2030 TEST_F(AppCacheStorageImplTest, Reinitialize3) { 2032 TEST_F(AppCacheStorageImplTest, Reinitialize3) {
2031 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize3); 2033 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize3);
2032 } 2034 }
2033 2035
2034 // That's all folks! 2036 // That's all folks!
2035 2037
2036 } // namespace content 2038 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/appcache/appcache_request_handler_unittest.cc ('k') | content/browser/appcache/appcache_update_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698