| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 struct QuitMessageHit { | 117 struct QuitMessageHit { |
| 118 explicit QuitMessageHit(MessageLoopForUI* loop) : loop_(loop), hit_(false) { | 118 explicit QuitMessageHit(MessageLoopForUI* loop) : loop_(loop), hit_(false) { |
| 119 } | 119 } |
| 120 | 120 |
| 121 MessageLoopForUI* loop_; | 121 MessageLoopForUI* loop_; |
| 122 bool hit_; | 122 bool hit_; |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 void QuitMessageLoop(QuitMessageHit* msg) { | 125 void QuitMessageLoop(QuitMessageHit* msg) { |
| 126 msg->hit_ = true; | 126 msg->hit_ = true; |
| 127 msg->loop_->PostTask(FROM_HERE, new MessageLoop::QuitTask); | 127 msg->loop_->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // end namespace | 130 } // end namespace |
| 131 | 131 |
| 132 TEST_F(TestServerTest, TestServer) { | 132 TEST_F(TestServerTest, TestServer) { |
| 133 // The web server needs a loop to exist on this thread during construction | 133 // The web server needs a loop to exist on this thread during construction |
| 134 // the loop must be created before we construct the server. | 134 // the loop must be created before we construct the server. |
| 135 MessageLoopForUI loop; | 135 MessageLoopForUI loop; |
| 136 | 136 |
| 137 test_server::SimpleWebServer server(1337); | 137 test_server::SimpleWebServer server(1337); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 168 EXPECT_EQ(file.accessed(), 1); | 168 EXPECT_EQ(file.accessed(), 1); |
| 169 EXPECT_EQ(redir.accessed(), 1); | 169 EXPECT_EQ(redir.accessed(), 1); |
| 170 | 170 |
| 171 EXPECT_TRUE(person_task.response().find("Guthrie") != std::string::npos); | 171 EXPECT_TRUE(person_task.response().find("Guthrie") != std::string::npos); |
| 172 EXPECT_TRUE(file_task.response().find("function") != std::string::npos); | 172 EXPECT_TRUE(file_task.response().find("function") != std::string::npos); |
| 173 EXPECT_TRUE(goog_task.response().find("<title>") != std::string::npos); | 173 EXPECT_TRUE(goog_task.response().find("<title>") != std::string::npos); |
| 174 } else { | 174 } else { |
| 175 ::TerminateThread(worker, ~0); | 175 ::TerminateThread(worker, ~0); |
| 176 } | 176 } |
| 177 } | 177 } |
| OLD | NEW |