OLD | NEW |
1 // Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2010 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 #include "chrome_frame/test/test_mock_with_web_server.h" | 4 #include "chrome_frame/test/test_mock_with_web_server.h" |
5 | 5 |
6 #include <mshtmcid.h> | 6 #include <mshtmcid.h> |
7 | 7 |
8 #include "base/scoped_bstr_win.h" | 8 #include "base/scoped_bstr_win.h" |
9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
10 #include "chrome_frame/utils.h" | 10 #include "chrome_frame/utils.h" |
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 HRESULT hr = mock.LaunchIEAndNavigate(kHostBrowserUrl); | 1279 HRESULT hr = mock.LaunchIEAndNavigate(kHostBrowserUrl); |
1280 ASSERT_HRESULT_SUCCEEDED(hr); | 1280 ASSERT_HRESULT_SUCCEEDED(hr); |
1281 if (hr == S_FALSE) | 1281 if (hr == S_FALSE) |
1282 return; | 1282 return; |
1283 | 1283 |
1284 ASSERT_TRUE(mock.web_browser2() != NULL); | 1284 ASSERT_TRUE(mock.web_browser2() != NULL); |
1285 loop.RunFor(kChromeFrameLongNavigationTimeoutInSeconds * 2); | 1285 loop.RunFor(kChromeFrameLongNavigationTimeoutInSeconds * 2); |
1286 } | 1286 } |
1287 | 1287 |
1288 TEST(IEPrivacy, NavigationToRestrictedSite) { | 1288 TEST(IEPrivacy, NavigationToRestrictedSite) { |
1289 if (!MonikerPatchEnabled()) { | 1289 if (IsIBrowserServicePatchEnabled()) { |
1290 LOG(ERROR) << "Not running test. Moniker patch not enabled."; | 1290 LOG(ERROR) << "Not running test. IBrowserServicePatch is in place."; |
1291 return; | 1291 return; |
1292 } | 1292 } |
1293 CloseIeAtEndOfScope last_resort_close_ie; | 1293 CloseIeAtEndOfScope last_resort_close_ie; |
1294 ComStackObjectWithUninitialize<MockWebBrowserEventSink> mock; | 1294 ComStackObjectWithUninitialize<MockWebBrowserEventSink> mock; |
1295 chrome_frame_test::TimedMsgLoop loop; | 1295 chrome_frame_test::TimedMsgLoop loop; |
1296 ChromeFrameHTTPServer server; | 1296 ChromeFrameHTTPServer server; |
1297 server.SetUp(); | 1297 server.SetUp(); |
1298 | 1298 |
1299 ScopedComPtr<IInternetSecurityManager> security_manager; | 1299 ScopedComPtr<IInternetSecurityManager> security_manager; |
1300 HRESULT hr = security_manager.CreateInstance(CLSID_InternetSecurityManager); | 1300 HRESULT hr = security_manager.CreateInstance(CLSID_InternetSecurityManager); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1334 loop.RunFor(kChromeFrameLongNavigationTimeoutInSeconds * 2); | 1334 loop.RunFor(kChromeFrameLongNavigationTimeoutInSeconds * 2); |
1335 } | 1335 } |
1336 | 1336 |
1337 ASSERT_HRESULT_SUCCEEDED(security_manager->SetZoneMapping(URLZONE_UNTRUSTED, | 1337 ASSERT_HRESULT_SUCCEEDED(security_manager->SetZoneMapping(URLZONE_UNTRUSTED, |
1338 L"http://localhost:1337", SZM_DELETE)); | 1338 L"http://localhost:1337", SZM_DELETE)); |
1339 } | 1339 } |
1340 | 1340 |
1341 // See bug 36694 for details. http://crbug.com/36694 | 1341 // See bug 36694 for details. http://crbug.com/36694 |
1342 TEST_F(ChromeFrameTestWithWebServer, | 1342 TEST_F(ChromeFrameTestWithWebServer, |
1343 DISABLED_FullTabModeIE_TestDownloadFromForm) { | 1343 DISABLED_FullTabModeIE_TestDownloadFromForm) { |
1344 if (!MonikerPatchEnabled()) { | 1344 if (IsIBrowserServicePatchEnabled()) { |
1345 LOG(ERROR) << "Not running test. Moniker patch not enabled."; | 1345 LOG(ERROR) << "Not running test. IBrowserServicePatch is in place."; |
1346 return; | 1346 return; |
1347 } | 1347 } |
1348 | 1348 |
1349 CloseIeAtEndOfScope last_resort_close_ie; | 1349 CloseIeAtEndOfScope last_resort_close_ie; |
1350 | 1350 |
1351 // The content of our HTML test page. This will be returned whenever | 1351 // The content of our HTML test page. This will be returned whenever |
1352 // we reply to a GET request. | 1352 // we reply to a GET request. |
1353 static const char kHtml[] = | 1353 static const char kHtml[] = |
1354 "<html><head>\n" | 1354 "<html><head>\n" |
1355 "<title>ChromeFrame Form Download Test</title>\n" | 1355 "<title>ChromeFrame Form Download Test</title>\n" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1482 } | 1482 } |
1483 | 1483 |
1484 EXPECT_EQ(1, response->get_request_count()); | 1484 EXPECT_EQ(1, response->get_request_count()); |
1485 EXPECT_EQ(1, response->post_request_count()); | 1485 EXPECT_EQ(1, response->post_request_count()); |
1486 } | 1486 } |
1487 | 1487 |
1488 // This test validates that typing in URLs with a fragment in them switch to | 1488 // This test validates that typing in URLs with a fragment in them switch to |
1489 // to ChromeFrame correctly. | 1489 // to ChromeFrame correctly. |
1490 TEST_F(ChromeFrameTestWithWebServer, | 1490 TEST_F(ChromeFrameTestWithWebServer, |
1491 FLAKY_FullTabModeIE_AltD_AnchorUrlNavigate) { | 1491 FLAKY_FullTabModeIE_AltD_AnchorUrlNavigate) { |
1492 if (!MonikerPatchEnabled()) { | 1492 if (IsIBrowserServicePatchEnabled()) { |
1493 LOG(ERROR) << "Not running test. Moniker patch not enabled."; | 1493 LOG(ERROR) << "Not running test. IBrowserServicePatch is in place."; |
1494 return; | 1494 return; |
1495 } | 1495 } |
1496 | 1496 |
1497 CloseIeAtEndOfScope last_resort_close_ie; | 1497 CloseIeAtEndOfScope last_resort_close_ie; |
1498 ComStackObjectWithUninitialize<MockWebBrowserEventSink> mock; | 1498 ComStackObjectWithUninitialize<MockWebBrowserEventSink> mock; |
1499 chrome_frame_test::TimedMsgLoop loop; | 1499 chrome_frame_test::TimedMsgLoop loop; |
1500 ::testing::InSequence sequence; | 1500 ::testing::InSequence sequence; |
1501 | 1501 |
1502 mock.ExpectNavigationAndSwitchSequence(kSubFrameUrl1); | 1502 mock.ExpectNavigationAndSwitchSequence(kSubFrameUrl1); |
1503 EXPECT_CALL(mock, OnLoad(testing::StrCaseEq(kSubFrameUrl1))) | 1503 EXPECT_CALL(mock, OnLoad(testing::StrCaseEq(kSubFrameUrl1))) |
(...skipping 10 matching lines...) Expand all Loading... |
1514 .WillOnce(QUIT_LOOP(loop)); | 1514 .WillOnce(QUIT_LOOP(loop)); |
1515 | 1515 |
1516 HRESULT hr = mock.LaunchIEAndNavigate(kSubFrameUrl1); | 1516 HRESULT hr = mock.LaunchIEAndNavigate(kSubFrameUrl1); |
1517 ASSERT_HRESULT_SUCCEEDED(hr); | 1517 ASSERT_HRESULT_SUCCEEDED(hr); |
1518 if (hr == S_FALSE) | 1518 if (hr == S_FALSE) |
1519 return; | 1519 return; |
1520 | 1520 |
1521 ASSERT_TRUE(mock.web_browser2() != NULL); | 1521 ASSERT_TRUE(mock.web_browser2() != NULL); |
1522 loop.RunFor(kChromeFrameLongNavigationTimeoutInSeconds); | 1522 loop.RunFor(kChromeFrameLongNavigationTimeoutInSeconds); |
1523 } | 1523 } |
OLD | NEW |