| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 | 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 } | 297 } |
| 298 | 298 |
| 299 // Override virtual void Initialize to not call icu initialize | 299 // Override virtual void Initialize to not call icu initialize |
| 300 void CFUrlRequestUnittestRunner::Initialize() { | 300 void CFUrlRequestUnittestRunner::Initialize() { |
| 301 DCHECK(::GetCurrentThreadId() == test_thread_id_); | 301 DCHECK(::GetCurrentThreadId() == test_thread_id_); |
| 302 | 302 |
| 303 // Start by replicating some of the steps that would otherwise be | 303 // Start by replicating some of the steps that would otherwise be |
| 304 // done by TestSuite::Initialize. We can't call the base class | 304 // done by TestSuite::Initialize. We can't call the base class |
| 305 // directly because it will attempt to initialize some things such as | 305 // directly because it will attempt to initialize some things such as |
| 306 // ICU that have already been initialized for this process. | 306 // ICU that have already been initialized for this process. |
| 307 InitializeLogging(); | 307 CFUrlRequestUnittestRunner::InitializeLogging(); |
| 308 base::Time::EnableHighResolutionTimer(true); | 308 base::Time::EnableHighResolutionTimer(true); |
| 309 | 309 |
| 310 SuppressErrorDialogs(); | 310 SuppressErrorDialogs(); |
| 311 DebugUtil::SuppressDialogs(); | 311 DebugUtil::SuppressDialogs(); |
| 312 #if !defined(PURIFY) | 312 #if !defined(PURIFY) |
| 313 logging::SetLogAssertHandler(UnitTestAssertHandler); | 313 logging::SetLogAssertHandler(UnitTestAssertHandler); |
| 314 #endif // !defined(PURIFY) | 314 #endif // !defined(PURIFY) |
| 315 | 315 |
| 316 // Next, do some initialization for NetTestSuite. | 316 // Next, do some initialization for NetTestSuite. |
| 317 NetTestSuite::InitializeTestThread(); | 317 NetTestSuite::InitializeTestThread(); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 } | 465 } |
| 466 | 466 |
| 467 // We need a module since some of the accessibility code that gets pulled | 467 // We need a module since some of the accessibility code that gets pulled |
| 468 // in here uses ATL. | 468 // in here uses ATL. |
| 469 class ObligatoryModule: public CAtlExeModuleT<ObligatoryModule> { | 469 class ObligatoryModule: public CAtlExeModuleT<ObligatoryModule> { |
| 470 }; | 470 }; |
| 471 | 471 |
| 472 ObligatoryModule g_obligatory_atl_module; | 472 ObligatoryModule g_obligatory_atl_module; |
| 473 | 473 |
| 474 int main(int argc, char** argv) { | 474 int main(int argc, char** argv) { |
| 475 if (chrome_frame_test::GetInstalledIEVersion() == IE_9) { |
| 476 // Adding this here as the command line and the logging stuff gets |
| 477 // initialized in the NetTestSuite constructor. Did not want to break that. |
| 478 base::AtExitManager at_exit_manager_; |
| 479 CommandLine::Init(argc, argv); |
| 480 CFUrlRequestUnittestRunner::InitializeLogging(); |
| 481 LOG(INFO) << "Not running ChromeFrame net tests on IE9"; |
| 482 return 0; |
| 483 } |
| 475 WindowWatchdog watchdog; | 484 WindowWatchdog watchdog; |
| 476 // See url_request_unittest.cc for these credentials. | 485 // See url_request_unittest.cc for these credentials. |
| 477 SupplyProxyCredentials credentials("user", "secret"); | 486 SupplyProxyCredentials credentials("user", "secret"); |
| 478 watchdog.AddObserver(&credentials, "Windows Security", ""); | 487 watchdog.AddObserver(&credentials, "Windows Security", ""); |
| 479 testing::InitGoogleTest(&argc, argv); | 488 testing::InitGoogleTest(&argc, argv); |
| 480 FilterDisabledTests(); | 489 FilterDisabledTests(); |
| 481 PluginService::EnableChromePlugins(false); | 490 PluginService::EnableChromePlugins(false); |
| 482 CFUrlRequestUnittestRunner test_suite(argc, argv); | 491 CFUrlRequestUnittestRunner test_suite(argc, argv); |
| 483 test_suite.RunMainUIThread(); | 492 test_suite.RunMainUIThread(); |
| 484 return 0; | 493 return 0; |
| 485 } | 494 } |
| OLD | NEW |