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/scoped_comptr_win.h" | 8 #include "base/scoped_comptr_win.h" |
9 #include "base/win/scoped_handle.h" | 9 #include "base/win/scoped_handle.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 "</head><body>Test HTML content</body></html>"; | 38 "</head><body>Test HTML content</body></html>"; |
39 } // end namespace | 39 } // end namespace |
40 | 40 |
41 class UrlmonMonikerTest : public testing::Test { | 41 class UrlmonMonikerTest : public testing::Test { |
42 protected: | 42 protected: |
43 UrlmonMonikerTest() { | 43 UrlmonMonikerTest() { |
44 } | 44 } |
45 }; | 45 }; |
46 | 46 |
47 TEST_F(UrlmonMonikerTest, MonikerPatch) { | 47 TEST_F(UrlmonMonikerTest, MonikerPatch) { |
48 EXPECT_EQ(true, MonikerPatch::Initialize()); | 48 EXPECT_TRUE(MonikerPatch::Initialize()); |
49 EXPECT_EQ(true, MonikerPatch::Initialize()); // Should be ok to call twice. | 49 EXPECT_TRUE(MonikerPatch::Initialize()); // Should be ok to call twice. |
50 MonikerPatch::Uninitialize(); | 50 MonikerPatch::Uninitialize(); |
51 } | 51 } |
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)) { |
(...skipping 23 matching lines...) Expand all Loading... |
83 protected: | 83 protected: |
84 scoped_ptr<test_server::SimpleWebServer> server_; | 84 scoped_ptr<test_server::SimpleWebServer> server_; |
85 test_server::SimpleResponse default_response_; | 85 test_server::SimpleResponse default_response_; |
86 base::win::ScopedHandle ready_; | 86 base::win::ScopedHandle ready_; |
87 }; | 87 }; |
88 | 88 |
89 // Helper class for running tests that rely on the NavigationManager. | 89 // Helper class for running tests that rely on the NavigationManager. |
90 class UrlmonMonikerTestManager { | 90 class UrlmonMonikerTestManager { |
91 public: | 91 public: |
92 explicit UrlmonMonikerTestManager(const wchar_t* test_url) { | 92 explicit UrlmonMonikerTestManager(const wchar_t* test_url) { |
93 EXPECT_EQ(true, MonikerPatch::Initialize()); | 93 EXPECT_TRUE(MonikerPatch::Initialize()); |
94 } | 94 } |
95 | 95 |
96 ~UrlmonMonikerTestManager() { | 96 ~UrlmonMonikerTestManager() { |
97 MonikerPatch::Uninitialize(); | 97 MonikerPatch::Uninitialize(); |
98 } | 98 } |
99 | 99 |
100 chrome_frame_test::TimedMsgLoop& loop() { | 100 chrome_frame_test::TimedMsgLoop& loop() { |
101 return loop_; | 101 return loop_; |
102 } | 102 } |
103 | 103 |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 callback2.SetCallbackExpectations( | 339 callback2.SetCallbackExpectations( |
340 UrlmonMonikerTestCallback::EXPECT_NO_CALL, S_OK, false); | 340 UrlmonMonikerTestCallback::EXPECT_NO_CALL, S_OK, false); |
341 hr = callback2.CreateUrlMonikerAndBindToStorage(test_url, NULL); | 341 hr = callback2.CreateUrlMonikerAndBindToStorage(test_url, NULL); |
342 // S_OK means that the operation completed synchronously. | 342 // S_OK means that the operation completed synchronously. |
343 // Otherwise we'd get MK_S_ASYNCHRONOUS. | 343 // Otherwise we'd get MK_S_ASYNCHRONOUS. |
344 EXPECT_EQ(S_OK, hr); | 344 EXPECT_EQ(S_OK, hr); |
345 } | 345 } |
346 } | 346 } |
347 | 347 |
348 */ | 348 */ |
OLD | NEW |