OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <windows.h> | 4 #include <windows.h> |
5 #include <stdarg.h> | 5 #include <stdarg.h> |
6 | 6 |
7 // IShellWindows includes. Unfortunately we can't keep these in | 7 // IShellWindows includes. Unfortunately we can't keep these in |
8 // alphabetic order since exdisp will bark if some interfaces aren't fully | 8 // alphabetic order since exdisp will bark if some interfaces aren't fully |
9 // defined. | 9 // defined. |
10 #include <mshtml.h> | 10 #include <mshtml.h> |
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 const wchar_t kNavigateOutPage[] = L"files/navigate_out.html"; | 1274 const wchar_t kNavigateOutPage[] = L"files/navigate_out.html"; |
1275 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_NavigateOut) { | 1275 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_NavigateOut) { |
1276 SimpleBrowserTest(IE, kNavigateOutPage, L"navigate_out"); | 1276 SimpleBrowserTest(IE, kNavigateOutPage, L"navigate_out"); |
1277 } | 1277 } |
1278 | 1278 |
1279 const wchar_t kReferrerMainTest[] = L"files/referrer_main.html"; | 1279 const wchar_t kReferrerMainTest[] = L"files/referrer_main.html"; |
1280 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_ReferrerTest) { | 1280 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_ReferrerTest) { |
1281 SimpleBrowserTest(IE, kReferrerMainTest, L"FullTab_ReferrerTest"); | 1281 SimpleBrowserTest(IE, kReferrerMainTest, L"FullTab_ReferrerTest"); |
1282 } | 1282 } |
1283 | 1283 |
| 1284 const wchar_t kSubFrameTestPage[] = L"files/full_tab_sub_frame_main.html"; |
| 1285 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_SubFrame) { |
| 1286 SimpleBrowserTest(IE, kSubFrameTestPage, L"sub_frame"); |
| 1287 } |
| 1288 |
| 1289 const wchar_t kSubIFrameTestPage[] = L"files/full_tab_sub_iframe_main.html"; |
| 1290 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_SubIFrame) { |
| 1291 SimpleBrowserTest(IE, kSubIFrameTestPage, L"sub_frame"); |
| 1292 } |
| 1293 |
1284 HRESULT LaunchIEAsComServer(IWebBrowser2** web_browser) { | 1294 HRESULT LaunchIEAsComServer(IWebBrowser2** web_browser) { |
1285 if (!web_browser) | 1295 if (!web_browser) |
1286 return E_INVALIDARG; | 1296 return E_INVALIDARG; |
1287 | 1297 |
1288 ScopedComPtr<IWebBrowser2> web_browser2; | 1298 ScopedComPtr<IWebBrowser2> web_browser2; |
1289 HRESULT hr = CoCreateInstance( | 1299 HRESULT hr = CoCreateInstance( |
1290 CLSID_InternetExplorer, NULL, CLSCTX_LOCAL_SERVER, IID_IWebBrowser2, | 1300 CLSID_InternetExplorer, NULL, CLSCTX_LOCAL_SERVER, IID_IWebBrowser2, |
1291 reinterpret_cast<void**>(web_browser2.Receive())); | 1301 reinterpret_cast<void**>(web_browser2.Receive())); |
1292 | 1302 |
1293 if (SUCCEEDED(hr)) { | 1303 if (SUCCEEDED(hr)) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1333 // This class provides functionality to add expectations to IE full tab mode | 1343 // This class provides functionality to add expectations to IE full tab mode |
1334 // tests. | 1344 // tests. |
1335 class MockWebBrowserEventSink : public WebBrowserEventSink { | 1345 class MockWebBrowserEventSink : public WebBrowserEventSink { |
1336 public: | 1346 public: |
1337 // Needed to support PostTask. | 1347 // Needed to support PostTask. |
1338 static bool ImplementsThreadSafeReferenceCounting() { | 1348 static bool ImplementsThreadSafeReferenceCounting() { |
1339 return true; | 1349 return true; |
1340 } | 1350 } |
1341 | 1351 |
1342 MOCK_METHOD7_WITH_CALLTYPE(__stdcall, OnBeforeNavigate2, | 1352 MOCK_METHOD7_WITH_CALLTYPE(__stdcall, OnBeforeNavigate2, |
1343 HRESULT (IDispatch* dispatch, | 1353 HRESULT (IDispatch* dispatch, // NOLINT |
1344 VARIANT* url, | 1354 VARIANT* url, |
1345 VARIANT* flags, | 1355 VARIANT* flags, |
1346 VARIANT* target_frame_name, | 1356 VARIANT* target_frame_name, |
1347 VARIANT* post_data, | 1357 VARIANT* post_data, |
1348 VARIANT* headers, | 1358 VARIANT* headers, |
1349 VARIANT_BOOL* cancel)); | 1359 VARIANT_BOOL* cancel)); |
1350 | 1360 |
1351 MOCK_METHOD2_WITH_CALLTYPE(__stdcall, OnNavigateComplete2, | 1361 MOCK_METHOD2_WITH_CALLTYPE(__stdcall, OnNavigateComplete2, |
1352 void (IDispatch* dispatch, VARIANT* url)); | 1362 void (IDispatch* dispatch, // NOLINT |
| 1363 VARIANT* url)); |
1353 | 1364 |
1354 MOCK_METHOD5_WITH_CALLTYPE(__stdcall, OnNewWindow3, | 1365 MOCK_METHOD5_WITH_CALLTYPE(__stdcall, OnNewWindow3, |
1355 void (IDispatch** dispatch, | 1366 void (IDispatch** dispatch, // NOLINT |
1356 VARIANT_BOOL* Cancel, | 1367 VARIANT_BOOL* Cancel, |
1357 DWORD flags, | 1368 DWORD flags, |
1358 BSTR url_context, | 1369 BSTR url_context, |
1359 BSTR url)); | 1370 BSTR url)); |
1360 | 1371 |
1361 MOCK_METHOD5_WITH_CALLTYPE(__stdcall, OnNavigateError, | 1372 MOCK_METHOD5_WITH_CALLTYPE(__stdcall, OnNavigateError, |
1362 void (IDispatch* dispatch, | 1373 void (IDispatch* dispatch, // NOLINT |
1363 VARIANT* url, | 1374 VARIANT* url, |
1364 VARIANT* frame_name, | 1375 VARIANT* frame_name, |
1365 VARIANT* status_code, | 1376 VARIANT* status_code, |
1366 VARIANT* cancel)); | 1377 VARIANT* cancel)); |
1367 }; | 1378 }; |
1368 | 1379 |
1369 using testing::_; | 1380 using testing::_; |
1370 | 1381 |
1371 const wchar_t kChromeFrameFileUrl[] = L"cf:file:///C:/"; | 1382 const wchar_t kChromeFrameFileUrl[] = L"cf:file:///C:/"; |
1372 | 1383 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1497 return; | 1508 return; |
1498 | 1509 |
1499 ASSERT_TRUE(mock.web_browser2() != NULL); | 1510 ASSERT_TRUE(mock.web_browser2() != NULL); |
1500 | 1511 |
1501 loop.RunFor(kChromeFrameLongNavigationTimeoutInSeconds); | 1512 loop.RunFor(kChromeFrameLongNavigationTimeoutInSeconds); |
1502 | 1513 |
1503 mock.Uninitialize(); | 1514 mock.Uninitialize(); |
1504 chrome_frame_test::CloseAllIEWindows(); | 1515 chrome_frame_test::CloseAllIEWindows(); |
1505 } | 1516 } |
1506 | 1517 |
OLD | NEW |