diff options
author | jnd@chromium.org <jnd@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-22 02:31:04 +0000 |
---|---|---|
committer | jnd@chromium.org <jnd@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-22 02:31:04 +0000 |
commit | f73ebdf7613fe30b6a4f57ddfca8fcb6bc81ad41 (patch) | |
tree | d2c5a230361341cd2c8b073725624049d69a2bc2 /chrome | |
parent | 56a4df0b9d6570a851c35bc0f232a35c6528c74e (diff) | |
download | chromium_src-f73ebdf7613fe30b6a4f57ddfca8fcb6bc81ad41.zip chromium_src-f73ebdf7613fe30b6a4f57ddfca8fcb6bc81ad41.tar.gz chromium_src-f73ebdf7613fe30b6a4f57ddfca8fcb6bc81ad41.tar.bz2 |
Speed up the BrowserEncodingTest.TestEncodingAutoDetect.
The main way is making the sleep timout shorter.
BUG=22063
TEST=BrowserEncodingTest.TestEncodingAutoDetect.
Review URL: http://codereview.chromium.org/209030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26787 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser_encoding_uitest.cc | 20 | ||||
-rw-r--r-- | chrome/test/ui/ui_test.cc | 5 |
2 files changed, 13 insertions, 12 deletions
diff --git a/chrome/browser/browser_encoding_uitest.cc b/chrome/browser/browser_encoding_uitest.cc index 8e72071..acbb8ee 100644 --- a/chrome/browser/browser_encoding_uitest.cc +++ b/chrome/browser/browser_encoding_uitest.cc @@ -75,7 +75,7 @@ TEST_F(BrowserEncodingTest, TestEncodingAliasMapping) { { "KOI8-U.html", "KOI8-U" }, { "macintosh.html", "macintosh" }, { "Shift-JIS.html", "Shift_JIS" }, - { "US-ASCII.html", "ISO-8859-1" }, // http://crbug.com/15801 + { "US-ASCII.html", "ISO-8859-1" }, // http://crbug.com/15801 { "UTF-8.html", "UTF-8" }, { "UTF-16LE.html", "UTF-16LE" }, { "windows-874.html", "windows-874" }, @@ -238,20 +238,20 @@ TEST_F(BrowserEncodingTest, TestEncodingAutoDetect) { FilePath test_dir_path = FilePath(kTestDir).AppendASCII(kAutoDetectDir); - for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestDatas);i++) { - scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); - ASSERT_TRUE(browser.get()); + scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); + ASSERT_TRUE(browser.get()); + // Set the default charset to one of encodings not supported by the current + // auto-detector (Please refer to the above comments) to make sure we + // incorrectly decode the page. Now we use ISO-8859-4. + browser->SetStringPreference(prefs::kDefaultCharset, L"ISO-8859-4"); + scoped_refptr<TabProxy> tab(GetActiveTab()); + ASSERT_TRUE(tab.get()); - // Set the default charset to one of encodings not supported by the current - // auto-detector (Please refer to the above comments) to make sure we - // incorrectly decode the page. Now we use ISO-8859-4. - browser->SetStringPreference(prefs::kDefaultCharset, L"ISO-8859-4"); + for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestDatas);i++) { FilePath test_file_path(test_dir_path); test_file_path = test_file_path.AppendASCII(kTestDatas[i].test_file_name); GURL url = URLRequestMockHTTPJob::GetMockUrl(test_file_path.ToWStringHack()); - scoped_refptr<TabProxy> tab(GetActiveTab()); - ASSERT_TRUE(tab.get()); ASSERT_TRUE(tab->NavigateToURL(url)); WaitUntilTabCount(1); diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index 7432337..6d7fdb6 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -936,7 +936,8 @@ void UITest::WaitForGeneratedFileAndCheck(const FilePath& generated_file, // Check whether the target file has been generated. file_util::FileInfo previous, current; bool exist = false; - for (int i = 0; i < 20; ++i) { + const int kCycles = 20; + for (int i = 0; i < kCycles; ++i) { if (exist) { file_util::GetFileInfo(generated_file, ¤t); if (current.size == previous.size) @@ -946,7 +947,7 @@ void UITest::WaitForGeneratedFileAndCheck(const FilePath& generated_file, file_util::GetFileInfo(generated_file, &previous); exist = true; } - PlatformThread::Sleep(sleep_timeout_ms()); + PlatformThread::Sleep(sleep_timeout_ms() / kCycles); } EXPECT_TRUE(exist); |