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

Side by Side Diff: content/browser/streams/stream_url_request_job_unittest.cc

Issue 16294003: Update content/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/message_loop.h" 5 #include "base/message_loop.h"
6 #include "base/test/test_simple_task_runner.h" 6 #include "base/test/test_simple_task_runner.h"
7 #include "content/browser/streams/stream.h" 7 #include "content/browser/streams/stream.h"
8 #include "content/browser/streams/stream_registry.h" 8 #include "content/browser/streams/stream_registry.h"
9 #include "content/browser/streams/stream_url_request_job.h" 9 #include "content/browser/streams/stream_url_request_job.h"
10 #include "content/browser/streams/stream_write_observer.h" 10 #include "content/browser/streams/stream_write_observer.h"
(...skipping 22 matching lines...) Expand all
33 class MockProtocolHandler : 33 class MockProtocolHandler :
34 public net::URLRequestJobFactory::ProtocolHandler { 34 public net::URLRequestJobFactory::ProtocolHandler {
35 public: 35 public:
36 MockProtocolHandler(StreamRegistry* registry) : registry_(registry) {} 36 MockProtocolHandler(StreamRegistry* registry) : registry_(registry) {}
37 37
38 // net::URLRequestJobFactory::ProtocolHandler override. 38 // net::URLRequestJobFactory::ProtocolHandler override.
39 virtual net::URLRequestJob* MaybeCreateJob( 39 virtual net::URLRequestJob* MaybeCreateJob(
40 net::URLRequest* request, 40 net::URLRequest* request,
41 net::NetworkDelegate* network_delegate) const OVERRIDE { 41 net::NetworkDelegate* network_delegate) const OVERRIDE {
42 scoped_refptr<Stream> stream = registry_->GetStream(request->url()); 42 scoped_refptr<Stream> stream = registry_->GetStream(request->url());
43 if (stream) 43 if (stream.get())
44 return new StreamURLRequestJob(request, network_delegate, stream); 44 return new StreamURLRequestJob(request, network_delegate, stream);
45 return NULL; 45 return NULL;
46 } 46 }
47 47
48 private: 48 private:
49 StreamRegistry* registry_; 49 StreamRegistry* registry_;
50 }; 50 };
51 51
52 StreamURLRequestJobTest() : message_loop_(base::MessageLoop::TYPE_IO) {} 52 StreamURLRequestJobTest() : message_loop_(base::MessageLoop::TYPE_IO) {}
53 53
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 164
165 stream->AddData(buffer, buffer->size()); 165 stream->AddData(buffer, buffer->size());
166 stream->Finalize(); 166 stream->Finalize();
167 167
168 net::HttpRequestHeaders extra_headers; 168 net::HttpRequestHeaders extra_headers;
169 extra_headers.SetHeader(net::HttpRequestHeaders::kRange, "bytes=1-3"); 169 extra_headers.SetHeader(net::HttpRequestHeaders::kRange, "bytes=1-3");
170 TestRequest("GET", kStreamURL, extra_headers, 405, std::string()); 170 TestRequest("GET", kStreamURL, extra_headers, 405, std::string());
171 } 171 }
172 172
173 } // namespace content 173 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/streams/stream_url_request_job.cc ('k') | content/browser/tracing/tracing_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698