diff options
author | slightlyoff@chromium.org <slightlyoff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-24 05:11:58 +0000 |
---|---|---|
committer | slightlyoff@chromium.org <slightlyoff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-24 05:11:58 +0000 |
commit | f781782dd67077478e117c61dca4ea5eefce3544 (patch) | |
tree | 4801f724123cfdcbb69c4e7fe40a565b331723ae /chrome_frame/test/chrome_frame_automation_mock.cc | |
parent | 63cf4759efa2373e33436fb5df6849f930081226 (diff) | |
download | chromium_src-f781782dd67077478e117c61dca4ea5eefce3544.zip chromium_src-f781782dd67077478e117c61dca4ea5eefce3544.tar.gz chromium_src-f781782dd67077478e117c61dca4ea5eefce3544.tar.bz2 |
Initial import of the Chrome Frame codebase. Integration in chrome.gyp coming in a separate CL.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/218019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27042 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/chrome_frame_automation_mock.cc')
-rw-r--r-- | chrome_frame/test/chrome_frame_automation_mock.cc | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/chrome_frame/test/chrome_frame_automation_mock.cc b/chrome_frame/test/chrome_frame_automation_mock.cc new file mode 100644 index 0000000..d900176 --- /dev/null +++ b/chrome_frame/test/chrome_frame_automation_mock.cc @@ -0,0 +1,47 @@ +// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome_frame/test/chrome_frame_automation_mock.h" +#include "testing/gtest/include/gtest/gtest.h" + +const int kLongWaitTimeout = 25 * 1000; +const int kShortWaitTimeout = 5 * 1000; + +TEST(ChromeFrame, Launch) { + MessageLoopForUI loop; + AutomationMockLaunch mock_launch(&loop, kLongWaitTimeout); + + mock_launch.Navigate("about:blank"); + loop.Run(NULL); + EXPECT_EQ(true, mock_launch.launch_result()); +} + +TEST(ChromeFrame, Navigate) { + MessageLoopForUI loop; + AutomationMockNavigate mock_navigate(&loop, kLongWaitTimeout); + + mock_navigate.NavigateRelativeFile(L"postmessage_basic_frame.html"); + loop.Run(NULL); + EXPECT_EQ(true, mock_navigate.navigation_result()); +} + +TEST(ChromeFrame, PostMessage) { + MessageLoopForUI loop; + AutomationMockPostMessage mock_postmessage(&loop, kLongWaitTimeout); + + mock_postmessage.NavigateRelativeFile(L"postmessage_basic_frame.html"); + loop.Run(NULL); + EXPECT_EQ(true, mock_postmessage.postmessage_result()); +} + +TEST(ChromeFrame, RequestStart) { + MessageLoopForUI loop; + AutomationMockHostNetworkRequestStart mock_request_start(&loop, + kLongWaitTimeout); + + mock_request_start.NavigateRelative(L"postmessage_basic_frame.html"); + loop.Run(NULL); + EXPECT_EQ(true, mock_request_start.request_start_result()); +} + |