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 <atlbase.h> | 5 #include <atlbase.h> |
6 #include <atlcom.h> | 6 #include <atlcom.h> |
7 | 7 |
8 #include "base/threading/thread.h" | 8 #include "base/threading/thread.h" |
9 #include "base/win/scoped_comptr.h" | 9 #include "base/win/scoped_comptr.h" |
10 #include "base/win/scoped_handle.h" | 10 #include "base/win/scoped_handle.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 // Runs an HTTP server on a worker thread that has a message loop. | 53 // Runs an HTTP server on a worker thread that has a message loop. |
54 class RunTestServer : public base::Thread { | 54 class RunTestServer : public base::Thread { |
55 public: | 55 public: |
56 RunTestServer() | 56 RunTestServer() |
57 : base::Thread("TestServer"), | 57 : base::Thread("TestServer"), |
58 default_response_("/", kTestContent), | 58 default_response_("/", kTestContent), |
59 ready_(::CreateEvent(NULL, TRUE, FALSE, NULL)) { | 59 ready_(::CreateEvent(NULL, TRUE, FALSE, NULL)) { |
60 } | 60 } |
61 | 61 |
| 62 ~RunTestServer() { |
| 63 Stop(); |
| 64 } |
| 65 |
62 bool Start() { | 66 bool Start() { |
63 bool ret = StartWithOptions(Options(MessageLoop::TYPE_UI, 0)); | 67 bool ret = StartWithOptions(Options(MessageLoop::TYPE_UI, 0)); |
64 if (ret) { | 68 if (ret) { |
65 message_loop()->PostTask(FROM_HERE, | 69 message_loop()->PostTask(FROM_HERE, |
66 NewRunnableFunction(&RunTestServer::StartServer, this)); | 70 NewRunnableFunction(&RunTestServer::StartServer, this)); |
67 wait_until_ready(); | 71 wait_until_ready(); |
68 } | 72 } |
69 return ret; | 73 return ret; |
70 } | 74 } |
71 | 75 |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 callback2.SetCallbackExpectations( | 343 callback2.SetCallbackExpectations( |
340 UrlmonMonikerTestCallback::EXPECT_NO_CALL, S_OK, false); | 344 UrlmonMonikerTestCallback::EXPECT_NO_CALL, S_OK, false); |
341 hr = callback2.CreateUrlMonikerAndBindToStorage(test_url, NULL); | 345 hr = callback2.CreateUrlMonikerAndBindToStorage(test_url, NULL); |
342 // S_OK means that the operation completed synchronously. | 346 // S_OK means that the operation completed synchronously. |
343 // Otherwise we'd get MK_S_ASYNCHRONOUS. | 347 // Otherwise we'd get MK_S_ASYNCHRONOUS. |
344 EXPECT_EQ(S_OK, hr); | 348 EXPECT_EQ(S_OK, hr); |
345 } | 349 } |
346 } | 350 } |
347 | 351 |
348 */ | 352 */ |
OLD | NEW |