| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <Winsock2.h> | 10 #include <Winsock2.h> |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 | 471 |
| 472 return TRUE; | 472 return TRUE; |
| 473 } | 473 } |
| 474 | 474 |
| 475 FakeExternalTab::FakeExternalTab() { | 475 FakeExternalTab::FakeExternalTab() { |
| 476 user_data_dir_ = chrome_frame_test::GetProfilePathForIE(); | 476 user_data_dir_ = chrome_frame_test::GetProfilePathForIE(); |
| 477 | 477 |
| 478 if (file_util::PathExists(user_data_dir_)) { | 478 if (file_util::PathExists(user_data_dir_)) { |
| 479 VLOG(1) << __FUNCTION__ << " deleting IE Profile user data directory " | 479 VLOG(1) << __FUNCTION__ << " deleting IE Profile user data directory " |
| 480 << user_data_dir_.value(); | 480 << user_data_dir_.value(); |
| 481 bool deleted = file_util::Delete(user_data_dir_, true); | 481 bool deleted = base::Delete(user_data_dir_, true); |
| 482 LOG_IF(ERROR, !deleted) << "Failed to delete user data directory directory " | 482 LOG_IF(ERROR, !deleted) << "Failed to delete user data directory directory " |
| 483 << user_data_dir_.value(); | 483 << user_data_dir_.value(); |
| 484 } | 484 } |
| 485 | 485 |
| 486 PathService::Get(chrome::DIR_USER_DATA, &overridden_user_dir_); | 486 PathService::Get(chrome::DIR_USER_DATA, &overridden_user_dir_); |
| 487 PathService::Override(chrome::DIR_USER_DATA, user_data_dir_); | 487 PathService::Override(chrome::DIR_USER_DATA, user_data_dir_); |
| 488 } | 488 } |
| 489 | 489 |
| 490 FakeExternalTab::~FakeExternalTab() { | 490 FakeExternalTab::~FakeExternalTab() { |
| 491 if (!overridden_user_dir_.empty()) { | 491 if (!overridden_user_dir_.empty()) { |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 if (print) { | 885 if (print) { |
| 886 // Flushing stdout should prevent unrelated output from being interleaved | 886 // Flushing stdout should prevent unrelated output from being interleaved |
| 887 // with the log file output. | 887 // with the log file output. |
| 888 std::cout.flush(); | 888 std::cout.flush(); |
| 889 // Dump the log to stderr. | 889 // Dump the log to stderr. |
| 890 logging_win::PrintLogFile(log_file_, &std::cerr); | 890 logging_win::PrintLogFile(log_file_, &std::cerr); |
| 891 std::cerr.flush(); | 891 std::cerr.flush(); |
| 892 } | 892 } |
| 893 } | 893 } |
| 894 | 894 |
| 895 if (!log_file_.empty() && !file_util::Delete(log_file_, false)) | 895 if (!log_file_.empty() && !base::Delete(log_file_, false)) |
| 896 LOG(ERROR) << "Failed to delete log file " << log_file_.value(); | 896 LOG(ERROR) << "Failed to delete log file " << log_file_.value(); |
| 897 | 897 |
| 898 log_file_.clear(); | 898 log_file_.clear(); |
| 899 file_logger_.reset(); | 899 file_logger_.reset(); |
| 900 } | 900 } |
| 901 | 901 |
| 902 const char* IEVersionToString(IEVersion version) { | 902 const char* IEVersionToString(IEVersion version) { |
| 903 switch (version) { | 903 switch (version) { |
| 904 case IE_6: | 904 case IE_6: |
| 905 return "IE6"; | 905 return "IE6"; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 978 content::InitializeSandboxInfo(&sandbox_info); | 978 content::InitializeSandboxInfo(&sandbox_info); |
| 979 FakeMainDelegate delegate; | 979 FakeMainDelegate delegate; |
| 980 content::ContentMain( | 980 content::ContentMain( |
| 981 reinterpret_cast<HINSTANCE>(GetModuleHandle(NULL)), | 981 reinterpret_cast<HINSTANCE>(GetModuleHandle(NULL)), |
| 982 &sandbox_info, | 982 &sandbox_info, |
| 983 &delegate); | 983 &delegate); |
| 984 | 984 |
| 985 // Note: In debug builds, we ExitProcess during PostDestroyThreads. | 985 // Note: In debug builds, we ExitProcess during PostDestroyThreads. |
| 986 return g_test_suite->test_result(); | 986 return g_test_suite->test_result(); |
| 987 } | 987 } |
| OLD | NEW |