| 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 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1039 case UITestBase::CUSTOM_FRAME_NATIVE_THEME: | 1039 case UITestBase::CUSTOM_FRAME_NATIVE_THEME: |
| 1040 source_history_file = | 1040 source_history_file = |
| 1041 source_history_file.AppendASCII("custom_frame_gtk_theme"); | 1041 source_history_file.AppendASCII("custom_frame_gtk_theme"); |
| 1042 break; | 1042 break; |
| 1043 default: | 1043 default: |
| 1044 NOTREACHED(); | 1044 NOTREACHED(); |
| 1045 } | 1045 } |
| 1046 return source_history_file; | 1046 return source_history_file; |
| 1047 } | 1047 } |
| 1048 | 1048 |
| 1049 void UITestBase::WaitForGeneratedFileAndCheck(const FilePath& generated_file, | 1049 void UITestBase::WaitForGeneratedFileAndCheck( |
| 1050 const FilePath& original_file, | 1050 const FilePath& generated_file, |
| 1051 bool compare_files, | 1051 const FilePath& original_file, |
| 1052 bool need_equal, | 1052 bool compare_files, |
| 1053 bool delete_generated_file) { | 1053 bool need_equal, |
| 1054 bool delete_generated_file) { |
| 1054 // Check whether the target file has been generated. | 1055 // Check whether the target file has been generated. |
| 1055 file_util::FileInfo previous, current; | 1056 file_util::FileInfo previous, current; |
| 1056 bool exist = false; | 1057 bool exist = false; |
| 1057 const int kCycles = 20; | 1058 const int kCycles = 20; |
| 1058 for (int i = 0; i < kCycles; ++i) { | 1059 for (int i = 0; i < kCycles; ++i) { |
| 1059 if (exist) { | 1060 if (exist) { |
| 1060 file_util::GetFileInfo(generated_file, ¤t); | 1061 file_util::GetFileInfo(generated_file, ¤t); |
| 1061 if (current.size == previous.size) | 1062 if (current.size == previous.size) |
| 1062 break; | 1063 break; |
| 1063 previous = current; | 1064 previous = current; |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1546 set_ui_test_name(ASCIIToWide(test_name)); | 1547 set_ui_test_name(ASCIIToWide(test_name)); |
| 1547 } | 1548 } |
| 1548 UITestBase::SetUp(); | 1549 UITestBase::SetUp(); |
| 1549 PlatformTest::SetUp(); | 1550 PlatformTest::SetUp(); |
| 1550 } | 1551 } |
| 1551 | 1552 |
| 1552 void UITest::TearDown() { | 1553 void UITest::TearDown() { |
| 1553 UITestBase::TearDown(); | 1554 UITestBase::TearDown(); |
| 1554 PlatformTest::TearDown(); | 1555 PlatformTest::TearDown(); |
| 1555 } | 1556 } |
| OLD | NEW |