Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <windows.h> | 5 #include <windows.h> |
| 6 #include <wininet.h> | 6 #include <wininet.h> |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 56 return h_; | 56 return h_; |
| 57 } | 57 } |
| 58 | 58 |
| 59 protected: | 59 protected: |
| 60 HINTERNET h_; | 60 HINTERNET h_; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 class TestURLRequest : public net::URLRequest { | 63 class TestURLRequest : public net::URLRequest { |
| 64 public: | 64 public: |
| 65 TestURLRequest(const GURL& url, Delegate* delegate) | 65 TestURLRequest(const GURL& url, Delegate* delegate) |
| 66 : net::URLRequest(url, delegate) { | 66 : net::URLRequest(url, delegate, new TestURLRequestContext()) { |
|
erikwright (departed)
2012/06/19 21:06:22
Looks like this previously leaked. Let's fix it to
shalev
2012/06/20 20:13:12
Done.
| |
| 67 set_context(new TestURLRequestContext()); | |
| 68 } | 67 } |
| 69 }; | 68 }; |
| 70 | 69 |
| 71 class UrlTaskChain { | 70 class UrlTaskChain { |
| 72 public: | 71 public: |
| 73 UrlTaskChain(const char* url, UrlTaskChain* next) | 72 UrlTaskChain(const char* url, UrlTaskChain* next) |
| 74 : url_(url), next_(next) { | 73 : url_(url), next_(next) { |
| 75 } | 74 } |
| 76 | 75 |
| 77 void Run() { | 76 void Run() { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 EXPECT_EQ(file.accessed(), 1); | 171 EXPECT_EQ(file.accessed(), 1); |
| 173 EXPECT_EQ(redir.accessed(), 1); | 172 EXPECT_EQ(redir.accessed(), 1); |
| 174 | 173 |
| 175 EXPECT_TRUE(person_task.response().find("Guthrie") != std::string::npos); | 174 EXPECT_TRUE(person_task.response().find("Guthrie") != std::string::npos); |
| 176 EXPECT_TRUE(file_task.response().find("function") != std::string::npos); | 175 EXPECT_TRUE(file_task.response().find("function") != std::string::npos); |
| 177 EXPECT_TRUE(redir_task.response().find("Destination") != std::string::npos); | 176 EXPECT_TRUE(redir_task.response().find("Destination") != std::string::npos); |
| 178 } else { | 177 } else { |
| 179 ::TerminateThread(worker, ~0); | 178 ::TerminateThread(worker, ~0); |
| 180 } | 179 } |
| 181 } | 180 } |
| OLD | NEW |