OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 "components/browser_watcher/endsession_watcher_window_win.h" | 5 #include "components/browser_watcher/endsession_watcher_window_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <stddef.h> |
8 #include <vector> | 9 #include <vector> |
9 | 10 |
10 #include "base/bind.h" | 11 #include "base/bind.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
12 | 13 |
13 namespace browser_watcher { | 14 namespace browser_watcher { |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
17 class EndSessionWatcherWindowTest : public testing::Test { | 18 class EndSessionWatcherWindowTest : public testing::Test { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 EXPECT_EQ(2u, num_callbacks_); | 59 EXPECT_EQ(2u, num_callbacks_); |
59 EXPECT_EQ(static_cast<UINT>(WM_ENDSESSION), last_message_); | 60 EXPECT_EQ(static_cast<UINT>(WM_ENDSESSION), last_message_); |
60 EXPECT_EQ(0xCAFE, last_lparam_); | 61 EXPECT_EQ(0xCAFE, last_lparam_); |
61 | 62 |
62 // Verify that other messages don't pass through. | 63 // Verify that other messages don't pass through. |
63 ::SendMessage(watcher_window.window(), WM_CLOSE, TRUE, 0xCAFE); | 64 ::SendMessage(watcher_window.window(), WM_CLOSE, TRUE, 0xCAFE); |
64 EXPECT_EQ(2u, num_callbacks_); | 65 EXPECT_EQ(2u, num_callbacks_); |
65 } | 66 } |
66 | 67 |
67 } // namespace browser_watcher | 68 } // namespace browser_watcher |
OLD | NEW |