diff options
-rw-r--r-- | chrome_frame/chrome_frame.gyp | 74 | ||||
-rw-r--r-- | chrome_frame/test/external_sites_test.cc | 50 |
2 files changed, 124 insertions, 0 deletions
diff --git a/chrome_frame/chrome_frame.gyp b/chrome_frame/chrome_frame.gyp index 1daca741..afa7e80 100644 --- a/chrome_frame/chrome_frame.gyp +++ b/chrome_frame/chrome_frame.gyp @@ -589,6 +589,80 @@ ], }, { + 'target_name': 'chrome_frame_qa_tests', + 'msvs_guid': 'D6B3174D-31DD-49D6-83C0-A63A6A135E0E', + 'type': 'executable', + 'dependencies': [ + '../base/base.gyp:test_support_base', + '../build/temp_gyp/googleurl.gyp:googleurl', + '../net/net.gyp:net_test_support', + '../testing/gmock.gyp:gmock', + '../testing/gtest.gyp:gtest', + 'chrome_frame_ie', + 'chrome_frame_npapi', + 'chrome_frame_strings', + 'npchrome_frame', + ], + 'sources': [ + '../base/test_suite.h', + 'test/chrome_frame_test_utils.cc', + 'test/chrome_frame_test_utils.h', + 'test/chrome_frame_ui_test_utils.cc', + 'test/chrome_frame_ui_test_utils.h', + 'test/external_sites_test.cc', + 'test/http_server.cc', + 'test/http_server.h', + 'test/ie_event_sink.cc', + 'test/ie_event_sink.h', + 'test/mock_ie_event_sink_actions.h', + 'test/mock_ie_event_sink_test.cc', + 'test/mock_ie_event_sink_test.h', + 'test/run_all_unittests.cc', + 'test/simulate_input.cc', + 'test/simulate_input.h', + 'test/test_server.cc', + 'test/test_server.h', + 'test/test_with_web_server.cc', + 'test/test_with_web_server.h', + 'test/win_event_receiver.cc', + 'test/win_event_receiver.h', + 'chrome_tab.h', + 'chrome_tab.idl', + 'renderer_glue.cc', + 'test_utils.cc', + 'test_utils.h', + ], + 'include_dirs': [ + '<@(xul_include_directories)', + '<(DEPTH)/third_party/wtl/include', + # To allow including "chrome_tab.h" + '<(INTERMEDIATE_DIR)', + ], + 'resource_include_dirs': [ + '<(INTERMEDIATE_DIR)', + ], + 'conditions': [ + ['OS=="win"', { + 'link_settings': { + 'libraries': [ + '-loleacc.lib', + ], + }, + 'msvs_settings': { + 'VCLinkerTool': { + 'DelayLoadDLLs': ['xpcom.dll', 'nspr4.dll'], + }, + }, + 'dependencies': [ + '../chrome/chrome.gyp:crash_service', + '../chrome/chrome.gyp:automation', + '../chrome/chrome.gyp:installer_util', + '../google_update/google_update.gyp:google_update', + ] + }], + ], + }, + { 'target_name': 'chrome_frame_npapi_core', 'type': 'static_library', 'dependencies': [ diff --git a/chrome_frame/test/external_sites_test.cc b/chrome_frame/test/external_sites_test.cc new file mode 100644 index 0000000..c24b62ca --- /dev/null +++ b/chrome_frame/test/external_sites_test.cc @@ -0,0 +1,50 @@ +// Copyright (c) 2010 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 <string> + +#include "chrome_frame/test/chrome_frame_test_utils.h" +#include "chrome_frame/test/mock_ie_event_sink_actions.h" +#include "chrome_frame/test/mock_ie_event_sink_test.h" + +using testing::_; +using testing::StrEq; + +namespace chrome_frame_test { + +// Test fixture for compatibility/reliability tests. +class ChromeFrameSitesTest + : public MockIEEventSinkTest, + public testing::TestWithParam<std::wstring> { + public: + ChromeFrameSitesTest() {} + + virtual void SetUp() { + // Permit navigation in both IE and CF. + ie_mock_.ExpectAnyNavigations(); + } +}; + +INSTANTIATE_TEST_CASE_P(CF, ChromeFrameSitesTest, + testing::Values(L"http://www.meebo.com/", + L"http://www.vimeo.com/", + L"http://wordpress.com/", + L"https://github.com/")); + +// Test for navigating to a site that has a CF metatag. +TEST_P(ChromeFrameSitesTest, LoadSite) { + // Print name of site for debugging purposes. + std::wcout << L"Navigating to site: " << GetParam() << std::endl; + + // Verify navigation to the url passed in as parameter. + EXPECT_CALL(ie_mock_, OnLoad(IN_CF, StrEq(GetParam()))) + .WillOnce(testing::DoAll( + VerifyAddressBarUrl(&ie_mock_), + CloseBrowserMock(&ie_mock_))); + + LaunchIENavigateAndLoop(GetParam(), + kChromeFrameLongNavigationTimeoutInSeconds * 2); +} + +} // namespace chrome_frame_test |