| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/test/test_file_util.h" | 7 #include "base/test/test_file_util.h" |
| 8 #include "base/win/scoped_comptr.h" | 8 #include "base/win/scoped_comptr.h" |
| 9 #include "base/win/windows_version.h" | 9 #include "base/win/windows_version.h" |
| 10 #include "chrome_frame/test/chrome_frame_test_utils.h" | 10 #include "chrome_frame/test/chrome_frame_test_utils.h" |
| 11 #include "chrome_frame/test/chrome_frame_ui_test_utils.h" | 11 #include "chrome_frame/test/chrome_frame_ui_test_utils.h" |
| 12 #include "chrome_frame/test/mock_ie_event_sink_actions.h" | 12 #include "chrome_frame/test/mock_ie_event_sink_actions.h" |
| 13 #include "chrome_frame/test/mock_ie_event_sink_test.h" | 13 #include "chrome_frame/test/mock_ie_event_sink_test.h" |
| 14 #include "net/http/http_util.h" | 14 #include "net/http/http_util.h" |
| 15 | 15 |
| 16 // Needed for CreateFunctor. | 16 // Needed for CreateFunctor. |
| 17 #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING | 17 #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 18 #include "testing/gmock_mutant.h" | 18 #include "testing/gmock_mutant.h" |
| 19 | 19 |
| 20 using testing::_; | |
| 21 using testing::InSequence; | 20 using testing::InSequence; |
| 22 using testing::StrEq; | 21 using testing::StrEq; |
| 22 using testing::_; |
| 23 | 23 |
| 24 namespace chrome_frame_test { | 24 namespace chrome_frame_test { |
| 25 | 25 |
| 26 // Test fixture for navigation-related tests. Each test is run thrice: IE, CF | 26 // Test fixture for navigation-related tests. Each test is run thrice: IE, CF |
| 27 // with meta tag invocation, and CF with http header invocation. This is | 27 // with meta tag invocation, and CF with http header invocation. This is |
| 28 // accomplished by using gTest's parameterized test. | 28 // accomplished by using gTest's parameterized test. |
| 29 class FullTabNavigationTest | 29 class FullTabNavigationTest |
| 30 : public MockIEEventSinkTest, public testing::TestWithParam<CFInvocation> { | 30 : public MockIEEventSinkTest, public testing::TestWithParam<CFInvocation> { |
| 31 public: | 31 public: |
| 32 FullTabNavigationTest() {} | 32 FullTabNavigationTest() {} |
| (...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 984 swscanf(arg0, L"%d/%d", &num_tests, &failed_tests); | 984 swscanf(arg0, L"%d/%d", &num_tests, &failed_tests); |
| 985 | 985 |
| 986 // Currently we run total 505 tests and 8 steps fail. | 986 // Currently we run total 505 tests and 8 steps fail. |
| 987 // TODO(amit): send results as JSON, diagnose and eliminate failures. | 987 // TODO(amit): send results as JSON, diagnose and eliminate failures. |
| 988 EXPECT_LE(failed_tests, 15) << "Expected failures: " << 15 << | 988 EXPECT_LE(failed_tests, 15) << "Expected failures: " << 15 << |
| 989 " Actual failures: " << failed_tests; | 989 " Actual failures: " << failed_tests; |
| 990 EXPECT_GE(num_tests, 500) << "Expected to run: " << 500 << " tests." << | 990 EXPECT_GE(num_tests, 500) << "Expected to run: " << 500 << " tests." << |
| 991 " Actual number of tests run: " << num_tests; | 991 " Actual number of tests run: " << num_tests; |
| 992 } | 992 } |
| 993 | 993 |
| 994 // Crashes flakily: http://crbug.com/109114 |
| 994 // Tests refreshing causes a page load. | 995 // Tests refreshing causes a page load. |
| 995 TEST_F(FullTabSeleniumTest, Core) { | 996 TEST_F(FullTabSeleniumTest, DISABLED_Core) { |
| 996 // Please see http://code.google.com/p/chromium/issues/detail?id=60987 | 997 // Please see http://code.google.com/p/chromium/issues/detail?id=60987 |
| 997 // for more information on why this test is disabled for Vista with IE7. | 998 // for more information on why this test is disabled for Vista with IE7. |
| 998 if (base::win::GetVersion() == base::win::VERSION_VISTA && | 999 if (base::win::GetVersion() == base::win::VERSION_VISTA && |
| 999 GetInstalledIEVersion() == IE_7) { | 1000 GetInstalledIEVersion() == IE_7) { |
| 1000 LOG(INFO) << "Not running test on Vista with IE7"; | 1001 LOG(INFO) << "Not running test on Vista with IE7"; |
| 1001 return; | 1002 return; |
| 1002 } | 1003 } |
| 1003 | 1004 |
| 1004 server_mock_.ExpectAndServeAnyRequests(CFInvocation::HttpHeader()); | 1005 server_mock_.ExpectAndServeAnyRequests(CFInvocation::HttpHeader()); |
| 1005 std::wstring url = GetTestUrl(L"core/TestRunner.html"); | 1006 std::wstring url = GetTestUrl(L"core/TestRunner.html"); |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1264 &no_referrer_target_opener_window_mock)); | 1265 &no_referrer_target_opener_window_mock)); |
| 1265 | 1266 |
| 1266 EXPECT_CALL(no_referrer_target_opener_window_mock, OnQuit()) | 1267 EXPECT_CALL(no_referrer_target_opener_window_mock, OnQuit()) |
| 1267 .WillOnce(CloseBrowserMock(&ie_mock_)); | 1268 .WillOnce(CloseBrowserMock(&ie_mock_)); |
| 1268 | 1269 |
| 1269 LaunchIENavigateAndLoop(initial_url, | 1270 LaunchIENavigateAndLoop(initial_url, |
| 1270 kChromeFrameVeryLongNavigationTimeoutInSeconds); | 1271 kChromeFrameVeryLongNavigationTimeoutInSeconds); |
| 1271 } | 1272 } |
| 1272 | 1273 |
| 1273 } // namespace chrome_frame_test | 1274 } // namespace chrome_frame_test |
| OLD | NEW |