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 |
11 #include "app/app_paths.h" | 11 #include "app/app_paths.h" |
12 #include "app/resource_bundle.h" | 12 #include "app/resource_bundle.h" |
13 #include "app/win/scoped_com_initializer.h" | 13 #include "app/win/scoped_com_initializer.h" |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "base/debug_util.h" | 15 #include "base/debug/debugger.h" |
16 #include "base/file_util.h" | 16 #include "base/file_util.h" |
17 #include "base/file_version_info.h" | 17 #include "base/file_version_info.h" |
18 #include "base/i18n/icu_util.h" | 18 #include "base/i18n/icu_util.h" |
19 #include "base/path_service.h" | 19 #include "base/path_service.h" |
20 #include "base/scoped_comptr_win.h" | 20 #include "base/scoped_comptr_win.h" |
21 #include "base/string_util.h" | 21 #include "base/string_util.h" |
22 #include "base/stringprintf.h" | 22 #include "base/stringprintf.h" |
| 23 #include "base/threading/platform_thread.h" |
23 #include "chrome/browser/automation/automation_provider_list.h" | 24 #include "chrome/browser/automation/automation_provider_list.h" |
24 #include "chrome/browser/plugin_service.h" | 25 #include "chrome/browser/plugin_service.h" |
25 #include "chrome/browser/prefs/browser_prefs.h" | 26 #include "chrome/browser/prefs/browser_prefs.h" |
26 #include "chrome/browser/prefs/pref_service.h" | 27 #include "chrome/browser/prefs/pref_service.h" |
27 #include "chrome/browser/process_singleton.h" | 28 #include "chrome/browser/process_singleton.h" |
28 #include "chrome/browser/profiles/profile_manager.h" | 29 #include "chrome/browser/profiles/profile_manager.h" |
29 #include "chrome/browser/renderer_host/render_process_host.h" | 30 #include "chrome/browser/renderer_host/render_process_host.h" |
30 #include "chrome/browser/renderer_host/web_cache_manager.h" | 31 #include "chrome/browser/renderer_host/web_cache_manager.h" |
31 #include "chrome/common/chrome_constants.h" | 32 #include "chrome/common/chrome_constants.h" |
32 #include "chrome/common/chrome_paths.h" | 33 #include "chrome/common/chrome_paths.h" |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 DCHECK(::GetCurrentThreadId() == test_thread_id_); | 302 DCHECK(::GetCurrentThreadId() == test_thread_id_); |
302 | 303 |
303 // Start by replicating some of the steps that would otherwise be | 304 // Start by replicating some of the steps that would otherwise be |
304 // done by TestSuite::Initialize. We can't call the base class | 305 // done by TestSuite::Initialize. We can't call the base class |
305 // directly because it will attempt to initialize some things such as | 306 // directly because it will attempt to initialize some things such as |
306 // ICU that have already been initialized for this process. | 307 // ICU that have already been initialized for this process. |
307 CFUrlRequestUnittestRunner::InitializeLogging(); | 308 CFUrlRequestUnittestRunner::InitializeLogging(); |
308 base::Time::EnableHighResolutionTimer(true); | 309 base::Time::EnableHighResolutionTimer(true); |
309 | 310 |
310 SuppressErrorDialogs(); | 311 SuppressErrorDialogs(); |
311 DebugUtil::SuppressDialogs(); | 312 base::debug::SetSuppressDebugUI(true); |
312 #if !defined(PURIFY) | 313 #if !defined(PURIFY) |
313 logging::SetLogAssertHandler(UnitTestAssertHandler); | 314 logging::SetLogAssertHandler(UnitTestAssertHandler); |
314 #endif // !defined(PURIFY) | 315 #endif // !defined(PURIFY) |
315 | 316 |
316 // Next, do some initialization for NetTestSuite. | 317 // Next, do some initialization for NetTestSuite. |
317 NetTestSuite::InitializeTestThread(); | 318 NetTestSuite::InitializeTestThread(); |
318 } | 319 } |
319 | 320 |
320 void CFUrlRequestUnittestRunner::Shutdown() { | 321 void CFUrlRequestUnittestRunner::Shutdown() { |
321 DCHECK(::GetCurrentThreadId() == test_thread_id_); | 322 DCHECK(::GetCurrentThreadId() == test_thread_id_); |
(...skipping 29 matching lines...) Expand all Loading... |
351 MessageBoxA(NULL, "click ok to run", "", MB_OK); | 352 MessageBoxA(NULL, "click ok to run", "", MB_OK); |
352 | 353 |
353 DCHECK_EQ(test_thread_.IsValid(), false); | 354 DCHECK_EQ(test_thread_.IsValid(), false); |
354 test_thread_.Set(::CreateThread(NULL, 0, RunAllUnittests, this, 0, | 355 test_thread_.Set(::CreateThread(NULL, 0, RunAllUnittests, this, 0, |
355 &test_thread_id_)); | 356 &test_thread_id_)); |
356 DCHECK(test_thread_.IsValid()); | 357 DCHECK(test_thread_.IsValid()); |
357 } | 358 } |
358 | 359 |
359 // static | 360 // static |
360 DWORD CFUrlRequestUnittestRunner::RunAllUnittests(void* param) { | 361 DWORD CFUrlRequestUnittestRunner::RunAllUnittests(void* param) { |
361 PlatformThread::SetName("CFUrlRequestUnittestRunner"); | 362 base::PlatformThread::SetName("CFUrlRequestUnittestRunner"); |
362 // Needed for some url request tests like the intercept job tests, etc. | 363 // Needed for some url request tests like the intercept job tests, etc. |
363 NotificationService service; | 364 NotificationService service; |
364 CFUrlRequestUnittestRunner* me = | 365 CFUrlRequestUnittestRunner* me = |
365 reinterpret_cast<CFUrlRequestUnittestRunner*>(param); | 366 reinterpret_cast<CFUrlRequestUnittestRunner*>(param); |
366 me->Run(); | 367 me->Run(); |
367 me->fake_chrome_.ui_loop()->PostTask(FROM_HERE, | 368 me->fake_chrome_.ui_loop()->PostTask(FROM_HERE, |
368 NewRunnableFunction(TakeDownBrowser, me)); | 369 NewRunnableFunction(TakeDownBrowser, me)); |
369 return 0; | 370 return 0; |
370 } | 371 } |
371 | 372 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 // See url_request_unittest.cc for these credentials. | 493 // See url_request_unittest.cc for these credentials. |
493 SupplyProxyCredentials credentials("user", "secret"); | 494 SupplyProxyCredentials credentials("user", "secret"); |
494 watchdog.AddObserver(&credentials, "Windows Security", ""); | 495 watchdog.AddObserver(&credentials, "Windows Security", ""); |
495 testing::InitGoogleTest(&argc, argv); | 496 testing::InitGoogleTest(&argc, argv); |
496 FilterDisabledTests(); | 497 FilterDisabledTests(); |
497 PluginService::EnableChromePlugins(false); | 498 PluginService::EnableChromePlugins(false); |
498 CFUrlRequestUnittestRunner test_suite(argc, argv); | 499 CFUrlRequestUnittestRunner test_suite(argc, argv); |
499 test_suite.RunMainUIThread(); | 500 test_suite.RunMainUIThread(); |
500 return 0; | 501 return 0; |
501 } | 502 } |
OLD | NEW |