summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-13 09:17:58 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-13 09:17:58 +0000
commit0f297c669447ce439e7d4bc21b4a87d07447e7a7 (patch)
tree73a5b64ed2b3408f1ca05c92608bbb19f8a4a05d /chrome/test
parent5a9c77159098a0dc7fc1c38c4f088d1d1a7ed6df (diff)
downloadchromium_src-0f297c669447ce439e7d4bc21b4a87d07447e7a7.zip
chromium_src-0f297c669447ce439e7d4bc21b4a87d07447e7a7.tar.gz
chromium_src-0f297c669447ce439e7d4bc21b4a87d07447e7a7.tar.bz2
[GTTF] Use DieFileDie in UILayoutTest instead of a custom poll'n'loop.
TEST=Covered by ui_tests. BUG=none Review URL: http://codereview.chromium.org/386018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31896 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/ui/ui_layout_test.cc30
1 files changed, 8 insertions, 22 deletions
diff --git a/chrome/test/ui/ui_layout_test.cc b/chrome/test/ui/ui_layout_test.cc
index a760fff..a4be6e2 100644
--- a/chrome/test/ui/ui_layout_test.cc
+++ b/chrome/test/ui/ui_layout_test.cc
@@ -6,6 +6,7 @@
#include "base/file_util.h"
#include "base/string_util.h"
+#include "base/test/test_file_util.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/automation/tab_proxy.h"
@@ -25,32 +26,17 @@ static const char kPlatformName[] = "chromium-linux";
static const char kTestCompleteCookie[] = "status";
UILayoutTest::UILayoutTest()
- : UITest(), initialized_for_layout_test_(false), test_count_(0) {
+ : initialized_for_layout_test_(false),
+ test_count_(0) {
}
UILayoutTest::~UILayoutTest() {
- // The deletion might fail because HTTP server process might not been
- // completely shut down yet and is still holding certain handle to it.
- // To work around this problem, we try to repeat the deletion several
- // times.
if (!temp_test_dir_.empty()) {
- static const int kRetryNum = 10;
- static const int kRetryDelayTimeMs = 500;
-
- int retry_time = 0;
- for (int i = 0; i < kRetryNum; ++i) {
- file_util::Delete(temp_test_dir_, true);
- if (!file_util::DirectoryExists(temp_test_dir_))
- break;
-
- PlatformThread::Sleep(kRetryDelayTimeMs);
- retry_time += kRetryDelayTimeMs;
- }
-
- if (retry_time) {
- printf("Retrying %d ms to delete temp layout test directory.\n",
- retry_time);
- }
+ // The deletion might fail because HTTP server process might not been
+ // completely shut down yet and is still holding certain handle to it.
+ // To work around this problem, we try to repeat the deletion several
+ // times.
+ EXPECT_TRUE(file_util::DieFileDie(temp_test_dir_, true));
}
}