Bluetooth: clean up Bluetooth classes
[chromium-blink-merge.git] / chrome_frame / test / chrome_frame_automation_mock.cc
blobd3077124943dcbfba2405c6e509bbf4f2c838a19
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
3 // found in the LICENSE file.
5 #include "chrome_frame/test/chrome_frame_automation_mock.h"
6 #include "chrome_frame/test/chrome_frame_test_utils.h"
7 #include "testing/gtest/include/gtest/gtest.h"
9 const base::TimeDelta kLongWaitTimeout = base::TimeDelta::FromSeconds(25);
11 TEST(ChromeFrame, Launch) {
12 MessageLoopForUI loop;
13 AutomationMockLaunch mock_launch(&loop,
14 kLongWaitTimeout.InMilliseconds());
16 loop.PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(), kLongWaitTimeout);
18 mock_launch.Navigate("about:blank");
19 base::RunLoop run_loop(NULL);
20 run_loop.Run();
21 EXPECT_TRUE(mock_launch.launch_result());
24 TEST(ChromeFrame, Navigate) {
25 MessageLoopForUI loop;
26 AutomationMockNavigate mock_navigate(&loop,
27 kLongWaitTimeout.InMilliseconds());
29 loop.PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(), kLongWaitTimeout);
31 mock_navigate.NavigateRelativeFile(L"postmessage_basic_frame.html");
32 base::RunLoop run_loop(NULL);
33 run_loop.Run();
34 EXPECT_FALSE(mock_navigate.navigation_result());
37 TEST(ChromeFrame, PostMessage) {
38 MessageLoopForUI loop;
39 AutomationMockPostMessage mock_postmessage(&loop,
40 kLongWaitTimeout.InMilliseconds());
42 loop.PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(), kLongWaitTimeout);
44 mock_postmessage.NavigateRelativeFile(L"postmessage_basic_frame.html");
45 base::RunLoop run_loop(NULL);
46 run_loop.Run();
47 EXPECT_FALSE(mock_postmessage.postmessage_result());
50 TEST(ChromeFrame, RequestStart) {
51 MessageLoopForUI loop;
52 AutomationMockHostNetworkRequestStart mock_request_start(
53 &loop, kLongWaitTimeout.InMilliseconds());
55 loop.PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(), kLongWaitTimeout);
57 mock_request_start.NavigateRelative(L"postmessage_basic_frame.html");
58 base::RunLoop run_loop(NULL);
59 run_loop.Run();
60 EXPECT_TRUE(mock_request_start.request_start_result());