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/test/ui/ui_test.h" | 5 #include "chrome/test/ui/ui_test.h" |
6 | 6 |
7 #if defined(OS_POSIX) | 7 #if defined(OS_POSIX) |
8 #include <signal.h> | 8 #include <signal.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 #endif | 10 #endif |
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1036 return source_history_file; | 1036 return source_history_file; |
1037 } | 1037 } |
1038 | 1038 |
1039 void UITestBase::WaitForGeneratedFileAndCheck( | 1039 void UITestBase::WaitForGeneratedFileAndCheck( |
1040 const FilePath& generated_file, | 1040 const FilePath& generated_file, |
1041 const FilePath& original_file, | 1041 const FilePath& original_file, |
1042 bool compare_files, | 1042 bool compare_files, |
1043 bool need_equal, | 1043 bool need_equal, |
1044 bool delete_generated_file) { | 1044 bool delete_generated_file) { |
1045 // Check whether the target file has been generated. | 1045 // Check whether the target file has been generated. |
1046 file_util::FileInfo previous, current; | 1046 base::PlatformFileInfo previous, current; |
1047 bool exist = false; | 1047 bool exist = false; |
1048 const int kCycles = 20; | 1048 const int kCycles = 20; |
1049 for (int i = 0; i < kCycles; ++i) { | 1049 for (int i = 0; i < kCycles; ++i) { |
1050 if (exist) { | 1050 if (exist) { |
1051 file_util::GetFileInfo(generated_file, ¤t); | 1051 file_util::GetFileInfo(generated_file, ¤t); |
1052 if (current.size == previous.size) | 1052 if (current.size == previous.size) |
1053 break; | 1053 break; |
1054 previous = current; | 1054 previous = current; |
1055 } else if (file_util::PathExists(generated_file)) { | 1055 } else if (file_util::PathExists(generated_file)) { |
1056 file_util::GetFileInfo(generated_file, &previous); | 1056 file_util::GetFileInfo(generated_file, &previous); |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1252 UITestBase::TearDown(); | 1252 UITestBase::TearDown(); |
1253 PlatformTest::TearDown(); | 1253 PlatformTest::TearDown(); |
1254 } | 1254 } |
1255 | 1255 |
1256 AutomationProxy* UITest::CreateAutomationProxy(int execution_timeout) { | 1256 AutomationProxy* UITest::CreateAutomationProxy(int execution_timeout) { |
1257 // Make the AutomationProxy disconnect the channel on the first error, | 1257 // Make the AutomationProxy disconnect the channel on the first error, |
1258 // so that we avoid spending a lot of time in timeouts. The browser is likely | 1258 // so that we avoid spending a lot of time in timeouts. The browser is likely |
1259 // hosed if we hit those errors. | 1259 // hosed if we hit those errors. |
1260 return new AutomationProxy(execution_timeout, true); | 1260 return new AutomationProxy(execution_timeout, true); |
1261 } | 1261 } |
1262 | |
OLD | NEW |