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

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

Issue 2481923002: [WIP] make GURL::path() return a StringPiece (Closed)
Patch Set: thanks asan Created 4 years, 1 month 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 static GURL GetMockUrl(const std::string& path) { 89 static GURL GetMockUrl(const std::string& path) {
90 return GURL("http://mockhost/" + path); 90 return GURL("http://mockhost/" + path);
91 } 91 }
92 92
93 static net::URLRequestJob* CreateJob( 93 static net::URLRequestJob* CreateJob(
94 net::URLRequest* request, net::NetworkDelegate* network_delegate) { 94 net::URLRequest* request, net::NetworkDelegate* network_delegate) {
95 if (request->url().host() != "mockhost") 95 if (request->url().host() != "mockhost")
96 return new net::URLRequestErrorJob(request, network_delegate, -100); 96 return new net::URLRequestErrorJob(request, network_delegate, -100);
97 97
98 std::string headers, body; 98 std::string headers, body;
99 GetMockResponse(request->url().path(), &headers, &body); 99 GetMockResponse(request->url().path().as_string(), &headers, &body);
100 return new net::URLRequestTestJob( 100 return new net::URLRequestTestJob(
101 request, network_delegate, headers, body, true); 101 request, network_delegate, headers, body, true);
102 } 102 }
103 103
104 private: 104 private:
105 static void GetMockResponse(const std::string& path, 105 static void GetMockResponse(const std::string& path,
106 std::string* headers, 106 std::string* headers,
107 std::string* body) { 107 std::string* body) {
108 const char manifest_headers[] = 108 const char manifest_headers[] =
109 "HTTP/1.1 200 OK\n" 109 "HTTP/1.1 200 OK\n"
(...skipping 1917 matching lines...) Expand 10 before | Expand all | Expand 10 after
2027 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize2); 2027 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize2);
2028 } 2028 }
2029 2029
2030 TEST_F(AppCacheStorageImplTest, Reinitialize3) { 2030 TEST_F(AppCacheStorageImplTest, Reinitialize3) {
2031 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize3); 2031 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize3);
2032 } 2032 }
2033 2033
2034 // That's all folks! 2034 // That's all folks!
2035 2035
2036 } // namespace content 2036 } // namespace content
OLDNEW
« no previous file with comments | « components/url_matcher/url_matcher.cc ('k') | content/browser/appcache/appcache_update_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698