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/bind.h" |
8 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
9 #include "base/win/scoped_comptr.h" | 10 #include "base/win/scoped_comptr.h" |
10 #include "base/win/scoped_handle.h" | 11 #include "base/win/scoped_handle.h" |
11 #include "chrome_frame/bho.h" | 12 #include "chrome_frame/bho.h" |
12 //#include "chrome_frame/urlmon_moniker.h" | 13 //#include "chrome_frame/urlmon_moniker.h" |
13 #include "chrome_frame/test/chrome_frame_test_utils.h" | 14 #include "chrome_frame/test/chrome_frame_test_utils.h" |
14 #include "chrome_frame/test/test_server.h" | 15 #include "chrome_frame/test/test_server.h" |
15 #include "chrome_frame/test/urlmon_moniker_tests.h" | 16 #include "chrome_frame/test/urlmon_moniker_tests.h" |
16 #include "gmock/gmock.h" | 17 #include "gmock/gmock.h" |
17 #include "gtest/gtest.h" | 18 #include "gtest/gtest.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 } | 61 } |
61 | 62 |
62 ~RunTestServer() { | 63 ~RunTestServer() { |
63 Stop(); | 64 Stop(); |
64 } | 65 } |
65 | 66 |
66 bool Start() { | 67 bool Start() { |
67 bool ret = StartWithOptions(Options(MessageLoop::TYPE_UI, 0)); | 68 bool ret = StartWithOptions(Options(MessageLoop::TYPE_UI, 0)); |
68 if (ret) { | 69 if (ret) { |
69 message_loop()->PostTask(FROM_HERE, | 70 message_loop()->PostTask(FROM_HERE, |
70 NewRunnableFunction(&RunTestServer::StartServer, this)); | 71 base::Bind(&RunTestServer::StartServer, this)); |
71 wait_until_ready(); | 72 wait_until_ready(); |
72 } | 73 } |
73 return ret; | 74 return ret; |
74 } | 75 } |
75 | 76 |
76 static void StartServer(RunTestServer* me) { | 77 static void StartServer(RunTestServer* me) { |
77 me->server_.reset(new test_server::SimpleWebServer(43210)); | 78 me->server_.reset(new test_server::SimpleWebServer(43210)); |
78 me->server_->AddResponse(&me->default_response_); | 79 me->server_->AddResponse(&me->default_response_); |
79 ::SetEvent(me->ready_); | 80 ::SetEvent(me->ready_); |
80 } | 81 } |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 callback2.SetCallbackExpectations( | 344 callback2.SetCallbackExpectations( |
344 UrlmonMonikerTestCallback::EXPECT_NO_CALL, S_OK, false); | 345 UrlmonMonikerTestCallback::EXPECT_NO_CALL, S_OK, false); |
345 hr = callback2.CreateUrlMonikerAndBindToStorage(test_url, NULL); | 346 hr = callback2.CreateUrlMonikerAndBindToStorage(test_url, NULL); |
346 // S_OK means that the operation completed synchronously. | 347 // S_OK means that the operation completed synchronously. |
347 // Otherwise we'd get MK_S_ASYNCHRONOUS. | 348 // Otherwise we'd get MK_S_ASYNCHRONOUS. |
348 EXPECT_EQ(S_OK, hr); | 349 EXPECT_EQ(S_OK, hr); |
349 } | 350 } |
350 } | 351 } |
351 | 352 |
352 */ | 353 */ |
OLD | NEW |