Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: chrome_frame/test/net/fake_external_tab.cc

Issue 8907054: Enable ChromeFrame net tests for IE versions 8 and below. Changes include the following:- (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/test/test_suite.cc ('k') | net/base/net_test_suite.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome_frame/test/net/fake_external_tab.h" 5 #include "chrome_frame/test/net/fake_external_tab.h"
6 6
7 #include <atlbase.h> 7 #include <atlbase.h>
8 #include <atlcom.h> 8 #include <atlcom.h>
9 #include <exdisp.h> 9 #include <exdisp.h>
10 10
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 "URLRequestTestHTTP.NetworkDelegateOnAuthRequiredSyncNoAction", 256 "URLRequestTestHTTP.NetworkDelegateOnAuthRequiredSyncNoAction",
257 "URLRequestTestHTTP.NetworkDelegateOnAuthRequiredSyncSetAuth", 257 "URLRequestTestHTTP.NetworkDelegateOnAuthRequiredSyncSetAuth",
258 "URLRequestTestHTTP.NetworkDelegateOnAuthRequiredSyncCancel", 258 "URLRequestTestHTTP.NetworkDelegateOnAuthRequiredSyncCancel",
259 "URLRequestTestHTTP.NetworkDelegateOnAuthRequiredAsyncNoAction", 259 "URLRequestTestHTTP.NetworkDelegateOnAuthRequiredAsyncNoAction",
260 "URLRequestTestHTTP.NetworkDelegateOnAuthRequiredAsyncSetAuth", 260 "URLRequestTestHTTP.NetworkDelegateOnAuthRequiredAsyncSetAuth",
261 "URLRequestTestHTTP.NetworkDelegateOnAuthRequiredAsyncCancel", 261 "URLRequestTestHTTP.NetworkDelegateOnAuthRequiredAsyncCancel",
262 262
263 // Flaky on the tryservers, http://crbug.com/103097 263 // Flaky on the tryservers, http://crbug.com/103097
264 "URLRequestTestHTTP.MultipleRedirectTest", 264 "URLRequestTestHTTP.MultipleRedirectTest",
265 "URLRequestTestHTTP.NetworkDelegateRedirectRequest", 265 "URLRequestTestHTTP.NetworkDelegateRedirectRequest",
266
267 // These tests are unsupported in CF.
268 "HTTPSRequestTest.HTTPSPreloadedHSTSTest",
269 "HTTPSRequestTest.ResumeTest",
270 "HTTPSRequestTest.SSLSessionCacheShardTest",
266 }; 271 };
267 272
268 const char* ie9_disabled_tests[] = { 273 const char* ie9_disabled_tests[] = {
269 // These always hang on Joi's box with IE9, http://crbug.com/105435. 274 // These always hang on Joi's box with IE9, http://crbug.com/105435.
270 // Several other tests, e.g. URLRequestTestHTTP.CancelTest2, 3 and 275 // Several other tests, e.g. URLRequestTestHTTP.CancelTest2, 3 and
271 // 5, often hang but not always. 276 // 5, often hang but not always.
272 "URLRequestTestHTTP.NetworkDelegateRedirectRequestPost", 277 "URLRequestTestHTTP.NetworkDelegateRedirectRequestPost",
273 "URLRequestTestHTTP.GetTest", 278 "URLRequestTestHTTP.GetTest",
274 "HTTPSRequestTest.HTTPSPreloadedHSTSTest", 279 "HTTPSRequestTest.HTTPSPreloadedHSTSTest",
275 }; 280 };
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 process_singleton_.reset(); 455 process_singleton_.reset();
451 456
452 ResourceBundle::CleanupSharedInstance(); 457 ResourceBundle::CleanupSharedInstance();
453 } 458 }
454 459
455 FakeBrowserProcessImpl* FakeExternalTab::browser_process() const { 460 FakeBrowserProcessImpl* FakeExternalTab::browser_process() const {
456 return browser_process_.get(); 461 return browser_process_.get();
457 } 462 }
458 463
459 CFUrlRequestUnittestRunner::CFUrlRequestUnittestRunner(int argc, char** argv) 464 CFUrlRequestUnittestRunner::CFUrlRequestUnittestRunner(int argc, char** argv)
460 : NetTestSuite(argc, argv), 465 : NetTestSuite(argc, argv, false),
461 chrome_frame_html_("/chrome_frame", kChromeFrameHtml), 466 chrome_frame_html_("/chrome_frame", kChromeFrameHtml),
462 registrar_(chrome_frame_test::GetTestBedType()), 467 registrar_(chrome_frame_test::GetTestBedType()),
463 test_result_(0) { 468 test_result_(0) {
464 } 469 }
465 470
466 CFUrlRequestUnittestRunner::~CFUrlRequestUnittestRunner() { 471 CFUrlRequestUnittestRunner::~CFUrlRequestUnittestRunner() {
467 } 472 }
468 473
469 void CFUrlRequestUnittestRunner::StartChromeFrameInHostBrowser() { 474 void CFUrlRequestUnittestRunner::StartChromeFrameInHostBrowser() {
470 if (!ShouldLaunchBrowser()) 475 if (!ShouldLaunchBrowser())
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 fake_chrome_.reset(); 657 fake_chrome_.reset();
653 658
654 #ifndef NDEBUG 659 #ifndef NDEBUG
655 // Avoid CRT cleanup in debug test runs to ensure that webkit ASSERTs which 660 // Avoid CRT cleanup in debug test runs to ensure that webkit ASSERTs which
656 // check if globals are created and destroyed on the same thread don't fire. 661 // check if globals are created and destroyed on the same thread don't fire.
657 // Webkit global objects are created on the inproc renderer thread. 662 // Webkit global objects are created on the inproc renderer thread.
658 ExitProcess(test_result()); 663 ExitProcess(test_result());
659 #endif 664 #endif
660 } 665 }
661 666
662 // We need a module since some of the accessibility code that gets pulled
663 // in here uses ATL.
664 class ObligatoryModule: public CAtlExeModuleT<ObligatoryModule> {
665 public:
666 static HRESULT InitializeCom() {
667 return OleInitialize(NULL);
668 }
669
670 static void UninitializeCom() {
671 OleUninitialize();
672 }
673 };
674
675 ObligatoryModule g_obligatory_atl_module;
676
677 const char* IEVersionToString(IEVersion version) { 667 const char* IEVersionToString(IEVersion version) {
678 switch (version) { 668 switch (version) {
679 case IE_6: 669 case IE_6:
680 return "IE6"; 670 return "IE6";
681 case IE_7: 671 case IE_7:
682 return "IE7"; 672 return "IE7";
683 case IE_8: 673 case IE_8:
684 return "IE8"; 674 return "IE8";
685 case IE_9: 675 case IE_9:
686 return "IE9"; 676 return "IE9";
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 } 712 }
723 713
724 int WorkerMain(const content::MainFunctionParams& parameters) { 714 int WorkerMain(const content::MainFunctionParams& parameters) {
725 return PluginMain(parameters); 715 return PluginMain(parameters);
726 } 716 }
727 717
728 int main(int argc, char** argv) { 718 int main(int argc, char** argv) {
729 g_argc = argc; 719 g_argc = argc;
730 g_argv = argv; 720 g_argv = argv;
731 721
732 // Temporarily disabled, http://crbug.com/105435. 722 if (chrome_frame_test::GetInstalledIEVersion() >= IE_9) {
733 if (true || chrome_frame_test::GetInstalledIEVersion() >= IE_9) {
734 // Adding this here as the command line and the logging stuff gets 723 // Adding this here as the command line and the logging stuff gets
735 // initialized in the NetTestSuite constructor. Did not want to break that. 724 // initialized in the NetTestSuite constructor. Did not want to break that.
736 base::AtExitManager at_exit_manager; 725 base::AtExitManager at_exit_manager;
737 CommandLine::Init(argc, argv); 726 CommandLine::Init(argc, argv);
738 CFUrlRequestUnittestRunner::InitializeLogging(); 727 CFUrlRequestUnittestRunner::InitializeLogging();
739 LOG(INFO) << "Temporarily not running ChromeFrame net tests."; 728 LOG(INFO) << "Not running ChromeFrame net tests on IE9+";
740 //LOG(INFO) << "Not running ChromeFrame net tests on IE9+";
741 return 0; 729 return 0;
742 } 730 }
743 731
744 google_breakpad::scoped_ptr<google_breakpad::ExceptionHandler> breakpad( 732 google_breakpad::scoped_ptr<google_breakpad::ExceptionHandler> breakpad(
745 InitializeCrashReporting(HEADLESS)); 733 InitializeCrashReporting(HEADLESS));
746 734
747 // Display the IE version we run with. This must be done after 735 // Display the IE version we run with. This must be done after
748 // CFUrlRequestUnittestRunner is constructed since that initializes logging. 736 // CFUrlRequestUnittestRunner is constructed since that initializes logging.
749 IEVersion ie_version = chrome_frame_test::GetInstalledIEVersion(); 737 IEVersion ie_version = chrome_frame_test::GetInstalledIEVersion();
750 LOG(INFO) << "Running CF net tests with IE version: " 738 LOG(INFO) << "Running CF net tests with IE version: "
751 << IEVersionToString(ie_version); 739 << IEVersionToString(ie_version);
752 740
753 // See url_request_unittest.cc for these credentials. 741 // See url_request_unittest.cc for these credentials.
754 SupplyProxyCredentials credentials("user", "secret"); 742 SupplyProxyCredentials credentials("user", "secret");
755 WindowWatchdog watchdog; 743 WindowWatchdog watchdog;
756 watchdog.AddObserver(&credentials, "Windows Security", ""); 744 watchdog.AddObserver(&credentials, "Windows Security", "");
757 745
758 sandbox::SandboxInterfaceInfo sandbox_info = {0}; 746 sandbox::SandboxInterfaceInfo sandbox_info = {0};
759 // This would normally be done, but is probably not needed for these tests. 747 // This would normally be done, but is probably not needed for these tests.
760 // content::InitializeSandboxInfo(&sandbox_info); 748 // content::InitializeSandboxInfo(&sandbox_info);
761 FakeMainDelegate delegate; 749 FakeMainDelegate delegate;
762 content::ContentMain( 750 content::ContentMain(
763 reinterpret_cast<HINSTANCE>(GetModuleHandle(NULL)), 751 reinterpret_cast<HINSTANCE>(GetModuleHandle(NULL)),
764 &sandbox_info, 752 &sandbox_info,
765 &delegate); 753 &delegate);
766 754
767 // Note: In debug builds, we ExitProcess during PostDestroyThreads. 755 // Note: In debug builds, we ExitProcess during PostDestroyThreads.
768 return g_test_suite->test_result(); 756 return g_test_suite->test_result();
769 } 757 }
OLDNEW
« no previous file with comments | « base/test/test_suite.cc ('k') | net/base/net_test_suite.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698