OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2006-2009 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. |
| 4 |
| 5 #include "chrome_frame/test/chrome_frame_automation_mock.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 |
| 8 const int kLongWaitTimeout = 25 * 1000; |
| 9 const int kShortWaitTimeout = 5 * 1000; |
| 10 |
| 11 TEST(ChromeFrame, Launch) { |
| 12 MessageLoopForUI loop; |
| 13 AutomationMockLaunch mock_launch(&loop, kLongWaitTimeout); |
| 14 |
| 15 mock_launch.Navigate("about:blank"); |
| 16 loop.Run(NULL); |
| 17 EXPECT_EQ(true, mock_launch.launch_result()); |
| 18 } |
| 19 |
| 20 TEST(ChromeFrame, Navigate) { |
| 21 MessageLoopForUI loop; |
| 22 AutomationMockNavigate mock_navigate(&loop, kLongWaitTimeout); |
| 23 |
| 24 mock_navigate.NavigateRelativeFile(L"postmessage_basic_frame.html"); |
| 25 loop.Run(NULL); |
| 26 EXPECT_EQ(true, mock_navigate.navigation_result()); |
| 27 } |
| 28 |
| 29 TEST(ChromeFrame, PostMessage) { |
| 30 MessageLoopForUI loop; |
| 31 AutomationMockPostMessage mock_postmessage(&loop, kLongWaitTimeout); |
| 32 |
| 33 mock_postmessage.NavigateRelativeFile(L"postmessage_basic_frame.html"); |
| 34 loop.Run(NULL); |
| 35 EXPECT_EQ(true, mock_postmessage.postmessage_result()); |
| 36 } |
| 37 |
| 38 TEST(ChromeFrame, RequestStart) { |
| 39 MessageLoopForUI loop; |
| 40 AutomationMockHostNetworkRequestStart mock_request_start(&loop, |
| 41 kLongWaitTimeout); |
| 42 |
| 43 mock_request_start.NavigateRelative(L"postmessage_basic_frame.html"); |
| 44 loop.Run(NULL); |
| 45 EXPECT_EQ(true, mock_request_start.request_start_result()); |
| 46 } |
| 47 |
OLD | NEW |