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

Side by Side Diff: content/browser/service_worker/service_worker_browsertest.cc

Issue 663563002: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/callback.h" 6 #include "base/callback.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/browser/fileapi/chrome_blob_storage_context.h" 10 #include "content/browser/fileapi/chrome_blob_storage_context.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 const net::test_server::HttpRequest& request) { 173 const net::test_server::HttpRequest& request) {
174 EXPECT_EQ(request.relative_url, "/service_worker/generated_sw.js"); 174 EXPECT_EQ(request.relative_url, "/service_worker/generated_sw.js");
175 std::map<std::string, std::string>::const_iterator it = 175 std::map<std::string, std::string>::const_iterator it =
176 request.headers.find("Service-Worker"); 176 request.headers.find("Service-Worker");
177 EXPECT_TRUE(it != request.headers.end()); 177 EXPECT_TRUE(it != request.headers.end());
178 EXPECT_EQ("script", it->second); 178 EXPECT_EQ("script", it->second);
179 179
180 scoped_ptr<net::test_server::BasicHttpResponse> http_response( 180 scoped_ptr<net::test_server::BasicHttpResponse> http_response(
181 new net::test_server::BasicHttpResponse()); 181 new net::test_server::BasicHttpResponse());
182 http_response->set_content_type("text/javascript"); 182 http_response->set_content_type("text/javascript");
183 return http_response.PassAs<net::test_server::HttpResponse>(); 183 return http_response.Pass();
184 } 184 }
185 185
186 // The ImportsBustMemcache test requires that the imported script 186 // The ImportsBustMemcache test requires that the imported script
187 // would naturally be cached in blink's memcache, but the embedded 187 // would naturally be cached in blink's memcache, but the embedded
188 // test server doesn't produce headers that allow the blink's memcache 188 // test server doesn't produce headers that allow the blink's memcache
189 // to do that. This interceptor injects headers that give the import 189 // to do that. This interceptor injects headers that give the import
190 // an experiration far in the future. 190 // an experiration far in the future.
191 class LongLivedResourceInterceptor : public net::URLRequestInterceptor { 191 class LongLivedResourceInterceptor : public net::URLRequestInterceptor {
192 public: 192 public:
193 LongLivedResourceInterceptor(const std::string& body) 193 LongLivedResourceInterceptor(const std::string& body)
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 RunOnIOThread( 946 RunOnIOThread(
947 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO, 947 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO,
948 this, 948 this,
949 embedded_test_server()->GetURL("/service_worker/empty.html"), 949 embedded_test_server()->GetURL("/service_worker/empty.html"),
950 &status)); 950 &status));
951 EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, status); 951 EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, status);
952 } 952 }
953 } 953 }
954 954
955 } // namespace content 955 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698