| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 #endif | 516 #endif |
| 517 if (!base::WaitForSingleProcess(process_, timeout)) { | 517 if (!base::WaitForSingleProcess(process_, timeout)) { |
| 518 // We need to force the browser to quit because it didn't quit fast | 518 // We need to force the browser to quit because it didn't quit fast |
| 519 // enough. Take no chance and kill every chrome processes. | 519 // enough. Take no chance and kill every chrome processes. |
| 520 CleanupAppProcesses(); | 520 CleanupAppProcesses(); |
| 521 } | 521 } |
| 522 } | 522 } |
| 523 | 523 |
| 524 // Don't forget to close the handle | 524 // Don't forget to close the handle |
| 525 base::CloseProcessHandle(process_); | 525 base::CloseProcessHandle(process_); |
| 526 process_ = 0; | 526 process_ = NULL; |
| 527 } | 527 } |
| 528 | 528 |
| 529 void UITest::AssertAppNotRunning(const std::wstring& error_message) { | 529 void UITest::AssertAppNotRunning(const std::wstring& error_message) { |
| 530 ASSERT_EQ(0, GetBrowserProcessCount()) << error_message; | 530 ASSERT_EQ(0, GetBrowserProcessCount()) << error_message; |
| 531 } | 531 } |
| 532 | 532 |
| 533 void UITest::CleanupAppProcesses() { | 533 void UITest::CleanupAppProcesses() { |
| 534 TerminateAllChromeProcesses(user_data_dir()); | 534 TerminateAllChromeProcesses(user_data_dir()); |
| 535 | 535 |
| 536 // Suppress spammy failures that seem to be occurring when running | 536 // Suppress spammy failures that seem to be occurring when running |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1078 EXPECT_TRUE(file_util::ContentsEqual(generated_file, original_file)); | 1078 EXPECT_TRUE(file_util::ContentsEqual(generated_file, original_file)); |
| 1079 } else { | 1079 } else { |
| 1080 EXPECT_NE(generated_file_size, original_file_size); | 1080 EXPECT_NE(generated_file_size, original_file_size); |
| 1081 EXPECT_FALSE(file_util::ContentsEqual(generated_file, original_file)); | 1081 EXPECT_FALSE(file_util::ContentsEqual(generated_file, original_file)); |
| 1082 } | 1082 } |
| 1083 } | 1083 } |
| 1084 if (delete_generated_file) | 1084 if (delete_generated_file) |
| 1085 EXPECT_TRUE(file_util::DieFileDie(generated_file, false)); | 1085 EXPECT_TRUE(file_util::DieFileDie(generated_file, false)); |
| 1086 } | 1086 } |
| 1087 | 1087 |
| OLD | NEW |