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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 | 476 |
477 return TRUE; | 477 return TRUE; |
478 } | 478 } |
479 | 479 |
480 FakeExternalTab::FakeExternalTab() { | 480 FakeExternalTab::FakeExternalTab() { |
481 user_data_dir_ = chrome_frame_test::GetProfilePathForIE(); | 481 user_data_dir_ = chrome_frame_test::GetProfilePathForIE(); |
482 | 482 |
483 if (base::PathExists(user_data_dir_)) { | 483 if (base::PathExists(user_data_dir_)) { |
484 VLOG(1) << __FUNCTION__ << " deleting IE Profile user data directory " | 484 VLOG(1) << __FUNCTION__ << " deleting IE Profile user data directory " |
485 << user_data_dir_.value(); | 485 << user_data_dir_.value(); |
486 bool deleted = base::Delete(user_data_dir_, true); | 486 bool deleted = base::DeleteFile(user_data_dir_, true); |
487 LOG_IF(ERROR, !deleted) << "Failed to delete user data directory directory " | 487 LOG_IF(ERROR, !deleted) << "Failed to delete user data directory directory " |
488 << user_data_dir_.value(); | 488 << user_data_dir_.value(); |
489 } | 489 } |
490 | 490 |
491 PathService::Get(chrome::DIR_USER_DATA, &overridden_user_dir_); | 491 PathService::Get(chrome::DIR_USER_DATA, &overridden_user_dir_); |
492 PathService::Override(chrome::DIR_USER_DATA, user_data_dir_); | 492 PathService::Override(chrome::DIR_USER_DATA, user_data_dir_); |
493 } | 493 } |
494 | 494 |
495 FakeExternalTab::~FakeExternalTab() { | 495 FakeExternalTab::~FakeExternalTab() { |
496 if (!overridden_user_dir_.empty()) { | 496 if (!overridden_user_dir_.empty()) { |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
894 if (print) { | 894 if (print) { |
895 // Flushing stdout should prevent unrelated output from being interleaved | 895 // Flushing stdout should prevent unrelated output from being interleaved |
896 // with the log file output. | 896 // with the log file output. |
897 std::cout.flush(); | 897 std::cout.flush(); |
898 // Dump the log to stderr. | 898 // Dump the log to stderr. |
899 logging_win::PrintLogFile(log_file_, &std::cerr); | 899 logging_win::PrintLogFile(log_file_, &std::cerr); |
900 std::cerr.flush(); | 900 std::cerr.flush(); |
901 } | 901 } |
902 } | 902 } |
903 | 903 |
904 if (!log_file_.empty() && !base::Delete(log_file_, false)) | 904 if (!log_file_.empty() && !base::DeleteFile(log_file_, false)) |
905 LOG(ERROR) << "Failed to delete log file " << log_file_.value(); | 905 LOG(ERROR) << "Failed to delete log file " << log_file_.value(); |
906 | 906 |
907 log_file_.clear(); | 907 log_file_.clear(); |
908 file_logger_.reset(); | 908 file_logger_.reset(); |
909 } | 909 } |
910 | 910 |
911 const char* IEVersionToString(IEVersion version) { | 911 const char* IEVersionToString(IEVersion version) { |
912 switch (version) { | 912 switch (version) { |
913 case IE_6: | 913 case IE_6: |
914 return "IE6"; | 914 return "IE6"; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 content::InitializeSandboxInfo(&sandbox_info); | 987 content::InitializeSandboxInfo(&sandbox_info); |
988 FakeMainDelegate delegate; | 988 FakeMainDelegate delegate; |
989 content::ContentMain( | 989 content::ContentMain( |
990 reinterpret_cast<HINSTANCE>(GetModuleHandle(NULL)), | 990 reinterpret_cast<HINSTANCE>(GetModuleHandle(NULL)), |
991 &sandbox_info, | 991 &sandbox_info, |
992 &delegate); | 992 &delegate); |
993 | 993 |
994 // Note: In debug builds, we ExitProcess during PostDestroyThreads. | 994 // Note: In debug builds, we ExitProcess during PostDestroyThreads. |
995 return g_test_suite->test_result(); | 995 return g_test_suite->test_result(); |
996 } | 996 } |
OLD | NEW |