| 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 "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 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 fake_chrome_.reset(); | 652 fake_chrome_.reset(); |
| 653 | 653 |
| 654 #ifndef NDEBUG | 654 #ifndef NDEBUG |
| 655 // Avoid CRT cleanup in debug test runs to ensure that webkit ASSERTs which | 655 // 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. | 656 // 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. | 657 // Webkit global objects are created on the inproc renderer thread. |
| 658 ExitProcess(test_result()); | 658 ExitProcess(test_result()); |
| 659 #endif | 659 #endif |
| 660 } | 660 } |
| 661 | 661 |
| 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) { | 662 const char* IEVersionToString(IEVersion version) { |
| 678 switch (version) { | 663 switch (version) { |
| 679 case IE_6: | 664 case IE_6: |
| 680 return "IE6"; | 665 return "IE6"; |
| 681 case IE_7: | 666 case IE_7: |
| 682 return "IE7"; | 667 return "IE7"; |
| 683 case IE_8: | 668 case IE_8: |
| 684 return "IE8"; | 669 return "IE8"; |
| 685 case IE_9: | 670 case IE_9: |
| 686 return "IE9"; | 671 return "IE9"; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 } | 707 } |
| 723 | 708 |
| 724 int WorkerMain(const content::MainFunctionParams& parameters) { | 709 int WorkerMain(const content::MainFunctionParams& parameters) { |
| 725 return PluginMain(parameters); | 710 return PluginMain(parameters); |
| 726 } | 711 } |
| 727 | 712 |
| 728 int main(int argc, char** argv) { | 713 int main(int argc, char** argv) { |
| 729 g_argc = argc; | 714 g_argc = argc; |
| 730 g_argv = argv; | 715 g_argv = argv; |
| 731 | 716 |
| 732 // Temporarily disabled, http://crbug.com/105435. | 717 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 | 718 // Adding this here as the command line and the logging stuff gets |
| 735 // initialized in the NetTestSuite constructor. Did not want to break that. | 719 // initialized in the NetTestSuite constructor. Did not want to break that. |
| 736 base::AtExitManager at_exit_manager; | 720 base::AtExitManager at_exit_manager; |
| 737 CommandLine::Init(argc, argv); | 721 CommandLine::Init(argc, argv); |
| 738 CFUrlRequestUnittestRunner::InitializeLogging(); | 722 CFUrlRequestUnittestRunner::InitializeLogging(); |
| 739 LOG(INFO) << "Temporarily not running ChromeFrame net tests."; | 723 LOG(INFO) << "Not running ChromeFrame net tests on IE9+"; |
| 740 //LOG(INFO) << "Not running ChromeFrame net tests on IE9+"; | |
| 741 return 0; | 724 return 0; |
| 742 } | 725 } |
| 743 | 726 |
| 744 google_breakpad::scoped_ptr<google_breakpad::ExceptionHandler> breakpad( | 727 google_breakpad::scoped_ptr<google_breakpad::ExceptionHandler> breakpad( |
| 745 InitializeCrashReporting(HEADLESS)); | 728 InitializeCrashReporting(HEADLESS)); |
| 746 | 729 |
| 747 // Display the IE version we run with. This must be done after | 730 // Display the IE version we run with. This must be done after |
| 748 // CFUrlRequestUnittestRunner is constructed since that initializes logging. | 731 // CFUrlRequestUnittestRunner is constructed since that initializes logging. |
| 749 IEVersion ie_version = chrome_frame_test::GetInstalledIEVersion(); | 732 IEVersion ie_version = chrome_frame_test::GetInstalledIEVersion(); |
| 750 LOG(INFO) << "Running CF net tests with IE version: " | 733 LOG(INFO) << "Running CF net tests with IE version: " |
| 751 << IEVersionToString(ie_version); | 734 << IEVersionToString(ie_version); |
| 752 | 735 |
| 753 // See url_request_unittest.cc for these credentials. | 736 // See url_request_unittest.cc for these credentials. |
| 754 SupplyProxyCredentials credentials("user", "secret"); | 737 SupplyProxyCredentials credentials("user", "secret"); |
| 755 WindowWatchdog watchdog; | 738 WindowWatchdog watchdog; |
| 756 watchdog.AddObserver(&credentials, "Windows Security", ""); | 739 watchdog.AddObserver(&credentials, "Windows Security", ""); |
| 757 | 740 |
| 758 sandbox::SandboxInterfaceInfo sandbox_info = {0}; | 741 sandbox::SandboxInterfaceInfo sandbox_info = {0}; |
| 759 // This would normally be done, but is probably not needed for these tests. | 742 // This would normally be done, but is probably not needed for these tests. |
| 760 // content::InitializeSandboxInfo(&sandbox_info); | 743 // content::InitializeSandboxInfo(&sandbox_info); |
| 761 FakeMainDelegate delegate; | 744 FakeMainDelegate delegate; |
| 762 content::ContentMain( | 745 content::ContentMain( |
| 763 reinterpret_cast<HINSTANCE>(GetModuleHandle(NULL)), | 746 reinterpret_cast<HINSTANCE>(GetModuleHandle(NULL)), |
| 764 &sandbox_info, | 747 &sandbox_info, |
| 765 &delegate); | 748 &delegate); |
| 766 | 749 |
| 767 // Note: In debug builds, we ExitProcess during PostDestroyThreads. | 750 // Note: In debug builds, we ExitProcess during PostDestroyThreads. |
| 768 return g_test_suite->test_result(); | 751 return g_test_suite->test_result(); |
| 769 } | 752 } |
| OLD | NEW |