OLD | NEW |
| 1 |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 4 // found in the LICENSE file. |
4 | 5 |
5 #include <string> | 6 #include <string> |
6 #include "base/file_path.h" | 7 #include "base/file_path.h" |
7 #include "base/waitable_event.h" | 8 #include "base/waitable_event.h" |
8 #include "chrome/common/automation_messages.h" | 9 #include "chrome/common/automation_messages.h" |
9 #include "chrome_frame/cfproxy_private.h" | 10 #include "chrome_frame/cfproxy_private.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 using testing::CreateFunctor; | 22 using testing::CreateFunctor; |
22 using testing::StrEq; | 23 using testing::StrEq; |
23 using testing::Eq; | 24 using testing::Eq; |
24 | 25 |
25 // There is not much to test here since CFProxy is pretty dumb. | 26 // There is not much to test here since CFProxy is pretty dumb. |
26 struct MockFactory : public ChromeProxyFactory { | 27 struct MockFactory : public ChromeProxyFactory { |
27 MOCK_METHOD0(CreateProxy, ChromeProxy*()); | 28 MOCK_METHOD0(CreateProxy, ChromeProxy*()); |
28 }; | 29 }; |
29 | 30 |
30 struct MockChromeProxyDelegate : public ChromeProxyDelegate { | 31 struct MockChromeProxyDelegate : public ChromeProxyDelegate { |
31 MOCK_METHOD1(OnMessageReceived, void(const IPC::Message& message)); | 32 MOCK_METHOD1(OnMessageReceived, bool(const IPC::Message& message)); |
32 MOCK_METHOD1(Connected, void(ChromeProxy* proxy)); | 33 MOCK_METHOD1(Connected, void(ChromeProxy* proxy)); |
33 MOCK_METHOD2(PeerLost, void(ChromeProxy*, enum DisconnectReason reason)); | 34 MOCK_METHOD2(PeerLost, void(ChromeProxy*, enum DisconnectReason reason)); |
34 MOCK_METHOD0(Disconnected, void()); | 35 MOCK_METHOD0(Disconnected, void()); |
35 MOCK_METHOD0(tab_handle, int()); | 36 MOCK_METHOD0(tab_handle, int()); |
36 | 37 |
37 MOCK_METHOD5(Completed_CreateTab, void(bool success, HWND chrome_wnd, | 38 MOCK_METHOD5(Completed_CreateTab, void(bool success, HWND chrome_wnd, |
38 HWND tab_window, int tab_handle, int session_id)); | 39 HWND tab_window, int tab_handle, int session_id)); |
39 MOCK_METHOD5(Completed_ConnectToTab, void(bool success, HWND chrome_window, | 40 MOCK_METHOD5(Completed_ConnectToTab, void(bool success, HWND chrome_window, |
40 HWND tab_window, int tab_handle, int session_id)); | 41 HWND tab_window, int tab_handle, int session_id)); |
41 MOCK_METHOD2(Completed_Navigate, void(bool success, | 42 MOCK_METHOD2(Completed_Navigate, void(bool success, |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 &SyncMsgSender::OnReplyReceived, r2.get())); | 366 &SyncMsgSender::OnReplyReceived, r2.get())); |
366 ipc.Stop(); | 367 ipc.Stop(); |
367 | 368 |
368 // Expect that tab 6 has been associated with the delegate. | 369 // Expect that tab 6 has been associated with the delegate. |
369 EXPECT_EQ(&d1, tab2delegate[6]); | 370 EXPECT_EQ(&d1, tab2delegate[6]); |
370 } | 371 } |
371 | 372 |
372 TEST(SyncMsgSender, OnChannelClosed) { | 373 TEST(SyncMsgSender, OnChannelClosed) { |
373 // TODO(stoyan): implement. | 374 // TODO(stoyan): implement. |
374 } | 375 } |
OLD | NEW |