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 #ifndef CHROME_FRAME_TEST_MOCK_IE_EVENT_SINK_ACTIONS_H_ | 5 #ifndef CHROME_FRAME_TEST_MOCK_IE_EVENT_SINK_ACTIONS_H_ |
6 #define CHROME_FRAME_TEST_MOCK_IE_EVENT_SINK_ACTIONS_H_ | 6 #define CHROME_FRAME_TEST_MOCK_IE_EVENT_SINK_ACTIONS_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
15 #include "base/string16.h" | 15 #include "base/string16.h" |
| 16 #include "base/test/test_process_killer_win.h" |
16 #include "base/threading/platform_thread.h" | 17 #include "base/threading/platform_thread.h" |
17 #include "base/time.h" | 18 #include "base/time.h" |
18 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
19 #include "chrome_frame/test/chrome_frame_test_utils.h" | |
20 #include "chrome_frame/test/chrome_frame_ui_test_utils.h" | 20 #include "chrome_frame/test/chrome_frame_ui_test_utils.h" |
21 #include "chrome_frame/test/ie_event_sink.h" | 21 #include "chrome_frame/test/ie_event_sink.h" |
22 #include "chrome_frame/test/mock_ie_event_sink_test.h" | 22 #include "chrome_frame/test/mock_ie_event_sink_test.h" |
23 #include "chrome_frame/test/simulate_input.h" | 23 #include "chrome_frame/test/simulate_input.h" |
24 #include "testing/gmock/include/gmock/gmock.h" | 24 #include "testing/gmock/include/gmock/gmock.h" |
25 #include "ui/gfx/point.h" | 25 #include "ui/gfx/point.h" |
26 #include "ui/gfx/rect.h" | 26 #include "ui/gfx/rect.h" |
27 | 27 |
28 namespace chrome_frame_test { | 28 namespace chrome_frame_test { |
29 | 29 |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 } | 308 } |
309 | 309 |
310 ACTION_P(DelayDoCloseWindow, delay) { | 310 ACTION_P(DelayDoCloseWindow, delay) { |
311 DCHECK(MessageLoop::current()); | 311 DCHECK(MessageLoop::current()); |
312 MessageLoop::current()->PostDelayedTask( | 312 MessageLoop::current()->PostDelayedTask( |
313 FROM_HERE, base::Bind(DoCloseWindowNow, arg0), | 313 FROM_HERE, base::Bind(DoCloseWindowNow, arg0), |
314 base::TimeDelta::FromMilliseconds(delay)); | 314 base::TimeDelta::FromMilliseconds(delay)); |
315 } | 315 } |
316 | 316 |
317 ACTION(KillChromeFrameProcesses) { | 317 ACTION(KillChromeFrameProcesses) { |
318 KillAllNamedProcessesWithArgument( | 318 base::KillAllNamedProcessesWithArgument( |
319 UTF8ToWide(chrome_frame_test::kChromeImageName), | 319 UTF8ToWide(chrome_frame_test::kChromeImageName), |
320 UTF8ToWide(switches::kChromeFrame)); | 320 UTF8ToWide(switches::kChromeFrame)); |
321 } | 321 } |
322 | 322 |
323 // Verifying actions | 323 // Verifying actions |
324 ACTION_P(AccExpect, matcher) { | 324 ACTION_P(AccExpect, matcher) { |
325 scoped_refptr<AccObject> object; | 325 scoped_refptr<AccObject> object; |
326 EXPECT_TRUE(FindAccObjectInWindow(arg0, matcher, &object)); | 326 EXPECT_TRUE(FindAccObjectInWindow(arg0, matcher, &object)); |
327 } | 327 } |
328 | 328 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 | 440 |
441 loop->PostDelayedTask( | 441 loop->PostDelayedTask( |
442 FROM_HERE, | 442 FROM_HERE, |
443 base::Bind(simulate_input::SendCharA, VK_RETURN, simulate_input::NONE), | 443 base::Bind(simulate_input::SendCharA, VK_RETURN, simulate_input::NONE), |
444 next_delay); | 444 next_delay); |
445 } | 445 } |
446 | 446 |
447 } // namespace chrome_frame_test | 447 } // namespace chrome_frame_test |
448 | 448 |
449 #endif // CHROME_FRAME_TEST_MOCK_IE_EVENT_SINK_ACTIONS_H_ | 449 #endif // CHROME_FRAME_TEST_MOCK_IE_EVENT_SINK_ACTIONS_H_ |
OLD | NEW |