| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "remoting/host/win/message_window.h" | 5 #include "base/win/message_window.h" |
| 6 #include "testing/gmock/include/gmock/gmock.h" | 6 #include "testing/gmock/include/gmock/gmock.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 namespace remoting { | 9 namespace base { |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 class MessageWindowDelegate : public win::MessageWindow::Delegate { | 13 class MessageWindowDelegate : public win::MessageWindow::Delegate { |
| 14 public: | 14 public: |
| 15 MessageWindowDelegate(); | 15 MessageWindowDelegate(); |
| 16 virtual ~MessageWindowDelegate(); | 16 virtual ~MessageWindowDelegate(); |
| 17 | 17 |
| 18 // MessageWindow::Delegate interface. | 18 // MessageWindow::Delegate interface. |
| 19 virtual bool HandleMessage(HWND hwnd, | 19 virtual bool HandleMessage(HWND hwnd, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 return false; | 40 return false; |
| 41 } | 41 } |
| 42 | 42 |
| 43 } // namespace | 43 } // namespace |
| 44 | 44 |
| 45 // Checks that a window can be created. | 45 // Checks that a window can be created. |
| 46 TEST(MessageWindowTest, Create) { | 46 TEST(MessageWindowTest, Create) { |
| 47 MessageWindowDelegate delegate; | 47 MessageWindowDelegate delegate; |
| 48 win::MessageWindow window; | 48 win::MessageWindow window; |
| 49 EXPECT_TRUE(window.Create(&delegate)); | 49 EXPECT_TRUE(window.Create(&delegate, NULL)); |
| 50 } | 50 } |
| 51 | 51 |
| 52 // Verifies that the created window can receive messages. | 52 // Verifies that the created window can receive messages. |
| 53 TEST(MessageWindowTest, SendMessage) { | 53 TEST(MessageWindowTest, SendMessage) { |
| 54 MessageWindowDelegate delegate; | 54 MessageWindowDelegate delegate; |
| 55 win::MessageWindow window; | 55 win::MessageWindow window; |
| 56 EXPECT_TRUE(window.Create(&delegate)); | 56 EXPECT_TRUE(window.Create(&delegate, NULL)); |
| 57 | 57 |
| 58 EXPECT_EQ(SendMessage(window.hwnd(), WM_USER, 100, 0), 100); | 58 EXPECT_EQ(SendMessage(window.hwnd(), WM_USER, 100, 0), 100); |
| 59 } | 59 } |
| 60 | 60 |
| 61 } // namespace remoting | 61 } // namespace base |
| OLD | NEW |