summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjnd@chromium.org <jnd@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-22 08:28:47 +0000
committerjnd@chromium.org <jnd@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-22 08:28:47 +0000
commit8a6093978565c34ac56e1e42e7addd9da52d0353 (patch)
tree2e179b9010adfb8ee9ba0485c00a35ae0c0583cd /chrome
parent4f945a09c6105d647f88c481ec8819fad522b296 (diff)
downloadchromium_src-8a6093978565c34ac56e1e42e7addd9da52d0353.zip
chromium_src-8a6093978565c34ac56e1e42e7addd9da52d0353.tar.gz
chromium_src-8a6093978565c34ac56e1e42e7addd9da52d0353.tar.bz2
Add a UI test for "Encoding" menu. Please see crbug.com/5515 for more details.This change list is based on http://codereview.chromium.org/18417 which was written by xlyuan@chromiumBug=5515 ( http://crbug.com/5515 )
Review URL: http://codereview.chromium.org/165393 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24073 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/browser_encoding_uitest.cc305
-rw-r--r--chrome/browser/download/save_page_uitest.cc28
-rw-r--r--chrome/chrome.gyp1
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/Big5.html17
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/EUC-JP.html24
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/ISO-8859-13.html15
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/ISO-8859-15.html10
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/ISO-8859-2.html105
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/ISO-8859-4.html15
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/ISO-8859-5.html10
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/ISO-8859-6.html10
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/ISO-8859-7.html10
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/ISO-8859-8.html10
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/KOI8-R.html10
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/KOI8-U.html10
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/Shift-JIS.html12
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/UTF-16LE.htmlbin0 -> 956 bytes
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/UTF-8.html12
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/gb18030.html15
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/iso-8859-1.html11
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/macintosh.html10
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/windows-1250.html105
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/windows-1251.html10
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/windows-1252.html14
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/windows-1253.html10
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/windows-1254.html10
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/windows-1255.html10
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/windows-1256.html10
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/windows-1257.html23
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/windows-1258.html10
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/windows-874.html11
-rw-r--r--chrome/test/data/encoding_tests/alias_mapping/windows-949.html14
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/Big5_with_no_encoding_specified.html16
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/ISO-8859-5_with_no_encoding_specified.html9
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/ISO-8859-6_with_no_encoding_specified.html9
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/ISO-8859-7_with_no_encoding_specified.html9
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/ISO-8859-8_with_no_encoding_specified.html9
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/KOI8-R_with_no_encoding_specified.html9
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/Shift-JIS_with_no_encoding_specified.html11
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/UTF-8_with_no_encoding_specified.html9
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/expected_results/expected_Big5_saved_from_no_encoding_specified.html16
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-5_saved_from_no_encoding_specified.html9
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-6_saved_from_no_encoding_specified.html9
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-7_saved_from_no_encoding_specified.html9
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-8_saved_from_no_encoding_specified.html9
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/expected_results/expected_KOI8-R_saved_from_no_encoding_specified.html9
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/expected_results/expected_Shift-JIS_saved_from_no_encoding_specified.html11
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/expected_results/expected_UTF-8_saved_from_no_encoding_specified.html11
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/expected_results/expected_gb18030_saved_from_no_encoding_specified.html19
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/expected_results/expected_iso-8859-1_saved_from_no_encoding_specified.html9
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1251_saved_from_no_encoding_specified.html9
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1254_saved_from_no_encoding_specified.html9
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1255_saved_from_no_encoding_specified.html9
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1256_saved_from_no_encoding_specified.html9
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-949_saved_from_no_encoding_specified.html13
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/gb18030_with_no_encoding_specified.html20
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/iso-8859-1_with_no_encoding_specified.html10
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/windows-1251_with_no_encoding_specified.html9
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/windows-1254_with_no_encoding_specified.html9
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/windows-1255_with_no_encoding_specified.html9
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/windows-1256_with_no_encoding_specified.html9
-rw-r--r--chrome/test/data/encoding_tests/auto_detect/windows-949_with_no_encoding_specified.html13
-rw-r--r--chrome/test/data/encoding_tests/user_override/expected_gb18030_saved_from_iso88591_meta.html19
-rw-r--r--chrome/test/data/encoding_tests/user_override/gb18030_with_iso88591_meta.html20
-rw-r--r--chrome/test/ui/ui_test.cc53
-rw-r--r--chrome/test/ui/ui_test.h19
66 files changed, 1277 insertions, 21 deletions
diff --git a/chrome/browser/browser_encoding_uitest.cc b/chrome/browser/browser_encoding_uitest.cc
new file mode 100644
index 0000000..468cbbd
--- /dev/null
+++ b/chrome/browser/browser_encoding_uitest.cc
@@ -0,0 +1,305 @@
+// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+#include <string>
+
+#include "base/file_util.h"
+#include "base/path_service.h"
+#include "base/string_util.h"
+#include "chrome/browser/net/url_request_mock_http_job.h"
+#include "chrome/browser/download/save_package.h"
+#include "chrome/common/chrome_paths.h"
+#include "chrome/test/automation/automation_messages.h"
+#include "chrome/test/automation/automation_proxy.h"
+#include "chrome/test/automation/browser_proxy.h"
+#include "chrome/test/automation/tab_proxy.h"
+#include "chrome/test/ui/ui_test.h"
+#include "net/url_request/url_request_unittest.h"
+#include "chrome/common/pref_names.h"
+
+const wchar_t* const kTestDir = L"encoding_tests";
+
+class BrowserEncodingTest : public UITest {
+ protected:
+ BrowserEncodingTest() : UITest() {}
+
+ // Make sure the content of the page are as expected
+ // after override or auto-detect
+ void CheckFile(const FilePath& generated_file,
+ const FilePath& expected_result_file,
+ bool check_equal) {
+ FilePath expected_result_filepath = UITest::GetTestFilePath(
+ kTestDir, expected_result_file.ToWStringHack());
+
+ ASSERT_TRUE(file_util::PathExists(expected_result_filepath));
+ WaitForGeneratedFileAndCheck(generated_file,
+ expected_result_filepath,
+ true, // We do care whether they are equal.
+ check_equal,
+ true); // Delete the generated file when done.
+ }
+
+ virtual void SetUp() {
+ UITest::SetUp();
+ EXPECT_TRUE(file_util::CreateNewTempDirectory(L"", &save_dir_));
+ save_dir_ += FilePath::kSeparators[0];
+ }
+
+ std::wstring save_dir_;
+};
+
+// TODO(jnd): 1. Some encodings are missing here. It'll be added later. See
+// http://crbug.com/13306.
+// 2. Add more files with multiple encoding name variants for each canonical
+// encoding name). Webkit layout tests cover some, but testing in the UI test is
+// also necessary.
+TEST_F(BrowserEncodingTest, TestEncodingAliasMapping) {
+ struct EncodingTestData {
+ const wchar_t* file_name;
+ const wchar_t* encoding_name;
+ };
+
+ const EncodingTestData kEncodingTestDatas[] = {
+ { L"Big5.html", L"Big5" },
+ { L"EUC-JP.html", L"EUC-JP" },
+ { L"gb18030.html", L"gb18030" },
+ { L"iso-8859-1.html", L"ISO-8859-1" },
+ { L"ISO-8859-2.html", L"ISO-8859-2" },
+ { L"ISO-8859-4.html", L"ISO-8859-4" },
+ { L"ISO-8859-5.html", L"ISO-8859-5" },
+ { L"ISO-8859-6.html", L"ISO-8859-6" },
+ { L"ISO-8859-7.html", L"ISO-8859-7" },
+ { L"ISO-8859-8.html", L"ISO-8859-8" },
+ { L"ISO-8859-13.html", L"ISO-8859-13" },
+ { L"ISO-8859-15.html", L"ISO-8859-15" },
+ { L"KOI8-R.html", L"KOI8-R" },
+ { L"KOI8-U.html", L"KOI8-U" },
+ { L"macintosh.html", L"macintosh" },
+ { L"Shift-JIS.html", L"Shift_JIS" },
+ { L"UTF-8.html", L"UTF-8" },
+ { L"UTF-16LE.html", L"UTF-16LE" },
+ { L"windows-874.html", L"windows-874" },
+ { L"windows-949.html", L"windows-949" },
+ { L"windows-1250.html", L"windows-1250" },
+ { L"windows-1251.html", L"windows-1251" },
+ { L"windows-1252.html", L"windows-1252" },
+ { L"windows-1253.html", L"windows-1253" },
+ { L"windows-1254.html", L"windows-1254" },
+ { L"windows-1255.html", L"windows-1255" },
+ { L"windows-1256.html", L"windows-1256" },
+ { L"windows-1257.html", L"windows-1257" },
+ { L"windows-1258.html", L"windows-1258" }
+ };
+ const wchar_t* const kAliasTestDir = L"alias_mapping";
+
+ FilePath test_dir_path = FilePath::FromWStringHack(kTestDir);
+ test_dir_path = test_dir_path.Append(kAliasTestDir);
+ for (int i = 0; i < arraysize(kEncodingTestDatas); ++i) {
+ FilePath test_file_path(test_dir_path);
+ test_file_path = test_file_path.Append(kEncodingTestDatas[i].file_name);
+ GURL url =
+ URLRequestMockHTTPJob::GetMockUrl(test_file_path.ToWStringHack());
+
+ scoped_refptr<TabProxy> tab_proxy(GetActiveTab());
+ ASSERT_TRUE(tab_proxy.get());
+ ASSERT_TRUE(tab_proxy->NavigateToURL(url));
+ WaitUntilTabCount(1);
+
+ std::wstring encoding;
+ EXPECT_TRUE(tab_proxy->GetPageCurrentEncoding(&encoding));
+ EXPECT_EQ(encoding, kEncodingTestDatas[i].encoding_name);
+ }
+}
+
+TEST_F(BrowserEncodingTest, TestOverrideEncoding) {
+ const wchar_t* const kTestFileName =
+ L"gb18030_with_iso88591_meta.html";
+ const wchar_t* const kExpectedFileName =
+ L"expected_gb18030_saved_from_iso88591_meta.html";
+ const wchar_t* const kOverrideTestDir = L"user_override";
+
+ FilePath test_dir_path = FilePath::FromWStringHack(kTestDir);
+ test_dir_path = test_dir_path.Append(kOverrideTestDir);
+ test_dir_path = test_dir_path.Append(kTestFileName);
+ GURL url = URLRequestMockHTTPJob::GetMockUrl(test_dir_path.ToWStringHack());
+ scoped_refptr<TabProxy> tab_proxy(GetActiveTab());
+ ASSERT_TRUE(tab_proxy.get());
+ ASSERT_TRUE(tab_proxy->NavigateToURL(url));
+ WaitUntilTabCount(1);
+
+ // Get the encoding declared in the page.
+ std::wstring encoding;
+ EXPECT_TRUE(tab_proxy->GetPageCurrentEncoding(&encoding));
+ EXPECT_EQ(encoding, L"ISO-8859-1");
+
+ // Override the encoding to "gb18030".
+ int64 last_nav_time = 0;
+ EXPECT_TRUE(tab_proxy->GetLastNavigationTime(&last_nav_time));
+ EXPECT_TRUE(tab_proxy->OverrideEncoding(L"gb18030"));
+ EXPECT_TRUE(tab_proxy->WaitForNavigation(last_nav_time));
+
+ // Re-get the encoding of page. It should be gb18030.
+ EXPECT_TRUE(tab_proxy->GetPageCurrentEncoding(&encoding));
+ EXPECT_EQ(encoding, L"gb18030");
+
+ // Dump the page, the content of dump page should be identical to the
+ // expected result file.
+ std::wstring full_file_name = save_dir_ + kTestFileName;
+ // We save the page as way of complete HTML file, which requires a directory
+ // name to save sub resources in it. Although this test file does not have
+ // sub resources, but the directory name is still required.
+ std::wstring dir = save_dir_ + L"sub_resource_files";
+ EXPECT_TRUE(tab_proxy->SavePage(full_file_name, dir,
+ SavePackage::SAVE_AS_COMPLETE_HTML));
+ scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
+ ASSERT_TRUE(browser.get());
+ EXPECT_TRUE(WaitForDownloadShelfVisible(browser.get()));
+ FilePath expected_file_name =
+ FilePath::FromWStringHack(kOverrideTestDir);
+ expected_file_name = expected_file_name.Append(kExpectedFileName);
+ CheckFile(FilePath::FromWStringHack(full_file_name),
+ expected_file_name, true);
+}
+
+// The following encodings are excluded from the auto-detection test because
+// it's a known issue that the current encoding detector does not detect them:
+// ISO-8859-4
+// ISO-8859-13
+// KOI8-U
+// macintosh
+// windows-874
+// windows-1252
+// windows-1253
+// windows-1257
+// windows-1258
+
+// For Hebrew, the expected encoding value is ISO-8859-8-I. See
+// http://crbug.com/2927 for more details.
+TEST_F(BrowserEncodingTest, TestEncodingAutoDetect) {
+ struct EncodingAutoDetectTestData {
+ const wchar_t* test_file_name; // File name of test data.
+ const wchar_t* expected_result; // File name of expected results.
+ const wchar_t* expected_encoding; // expected encoding.
+ };
+ const EncodingAutoDetectTestData kTestDatas[] = {
+ { L"Big5_with_no_encoding_specified.html",
+ L"expected_Big5_saved_from_no_encoding_specified.html",
+ L"Big5" },
+ { L"gb18030_with_no_encoding_specified.html",
+ L"expected_gb18030_saved_from_no_encoding_specified.html",
+ L"gb18030" },
+ { L"iso-8859-1_with_no_encoding_specified.html",
+ L"expected_iso-8859-1_saved_from_no_encoding_specified.html",
+ L"ISO-8859-1" },
+ { L"ISO-8859-5_with_no_encoding_specified.html",
+ L"expected_ISO-8859-5_saved_from_no_encoding_specified.html",
+ L"ISO-8859-5" },
+ { L"ISO-8859-6_with_no_encoding_specified.html",
+ L"expected_ISO-8859-6_saved_from_no_encoding_specified.html",
+ L"ISO-8859-6" },
+ { L"ISO-8859-7_with_no_encoding_specified.html",
+ L"expected_ISO-8859-7_saved_from_no_encoding_specified.html",
+ L"ISO-8859-7" },
+ { L"ISO-8859-8_with_no_encoding_specified.html",
+ L"expected_ISO-8859-8_saved_from_no_encoding_specified.html",
+ L"ISO-8859-8-I" },
+ { L"KOI8-R_with_no_encoding_specified.html",
+ L"expected_KOI8-R_saved_from_no_encoding_specified.html",
+ L"KOI8-R" },
+ { L"Shift-JIS_with_no_encoding_specified.html",
+ L"expected_Shift-JIS_saved_from_no_encoding_specified.html",
+ L"Shift_JIS" },
+ { L"UTF-8_with_no_encoding_specified.html",
+ L"expected_UTF-8_saved_from_no_encoding_specified.html",
+ L"UTF-8" },
+ { L"windows-949_with_no_encoding_specified.html",
+ L"expected_windows-949_saved_from_no_encoding_specified.html",
+ L"windows-949" },
+ { L"windows-1251_with_no_encoding_specified.html",
+ L"expected_windows-1251_saved_from_no_encoding_specified.html",
+ L"windows-1251" },
+ { L"windows-1254_with_no_encoding_specified.html",
+ L"expected_windows-1254_saved_from_no_encoding_specified.html",
+ L"windows-1254" },
+ { L"windows-1255_with_no_encoding_specified.html",
+ L"expected_windows-1255_saved_from_no_encoding_specified.html",
+ L"windows-1255" },
+ { L"windows-1256_with_no_encoding_specified.html",
+ L"expected_windows-1256_saved_from_no_encoding_specified.html",
+ L"windows-1256" }
+ };
+ const wchar_t* const kAutoDetectDir = L"auto_detect";
+ // Directory of the files of expected results.
+ const wchar_t* const kExpectedResultDir = L"expected_results";
+
+ // Full path of saved file. full_file_name = save_dir_ + file_name[i];
+ std::wstring full_saved_file_name;
+ // Sub resource directory of saved file.
+ std::wstring tmp_save_dir(save_dir_);
+ tmp_save_dir += L"sub_resource_files";
+
+ FilePath test_dir_path = FilePath::FromWStringHack(kTestDir);
+ test_dir_path = test_dir_path.Append(kAutoDetectDir);
+
+ for (int i = 0;i < arraysize(kTestDatas);i++) {
+ 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");
+ FilePath test_file_path(test_dir_path);
+ test_file_path = test_file_path.Append(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);
+
+ // Disable auto detect if it is on.
+ EXPECT_TRUE(
+ browser->SetBooleanPreference(prefs::kWebKitUsesUniversalDetector,
+ false));
+ EXPECT_TRUE(tab->Reload());
+
+ // Get the encoding used for the page, it must be the default charset we
+ // just set.
+ std::wstring encoding;
+ EXPECT_TRUE(tab->GetPageCurrentEncoding(&encoding));
+ EXPECT_EQ(encoding, L"ISO-8859-4");
+
+ // Enable the encoding auto detection.
+ EXPECT_TRUE(browser->SetBooleanPreference(
+ prefs::kWebKitUsesUniversalDetector, true));
+ EXPECT_TRUE(tab->Reload());
+
+ // Re-get the encoding of page. It should return the real encoding now.
+ bool encoding_auto_detect = false;
+ EXPECT_TRUE(
+ browser->GetBooleanPreference(prefs::kWebKitUsesUniversalDetector,
+ &encoding_auto_detect));
+ EXPECT_TRUE(encoding_auto_detect);
+ EXPECT_TRUE(tab->GetPageCurrentEncoding(&encoding));
+ EXPECT_EQ(encoding, kTestDatas[i].expected_encoding);
+
+ // Dump the page, the content of dump page should be equal with our expect
+ // result file.
+ full_saved_file_name = save_dir_ + kTestDatas[i].test_file_name;
+ // Full path of expect result file.
+ FilePath expected_result_file_name =
+ FilePath::FromWStringHack(kAutoDetectDir);
+ expected_result_file_name =
+ expected_result_file_name.Append(kExpectedResultDir);
+ expected_result_file_name =
+ expected_result_file_name.Append(kTestDatas[i].expected_result);
+ EXPECT_TRUE(tab->SavePage(full_saved_file_name, tmp_save_dir,
+ SavePackage::SAVE_AS_COMPLETE_HTML));
+ EXPECT_TRUE(WaitForDownloadShelfVisible(browser.get()));
+ CheckFile(FilePath::FromWStringHack(full_saved_file_name),
+ expected_result_file_name,
+ true);
+ }
+}
+
diff --git a/chrome/browser/download/save_page_uitest.cc b/chrome/browser/download/save_page_uitest.cc
index 0e49b46..cf21ca3 100644
--- a/chrome/browser/download/save_page_uitest.cc
+++ b/chrome/browser/download/save_page_uitest.cc
@@ -29,24 +29,16 @@ class SavePageTest : public UITest {
protected:
SavePageTest() : UITest() {}
- void CheckFile(const FilePath& client_file,
- const FilePath& server_file) {
- file_util::FileInfo previous, current;
- bool exist = false;
- for (int i = 0; i < 20; ++i) {
- if (exist) {
- file_util::GetFileInfo(client_file, &current);
- if (current.size == previous.size)
- break;
- previous = current;
- } else if (file_util::PathExists(client_file)) {
- file_util::GetFileInfo(client_file, &previous);
- exist = true;
- }
- PlatformThread::Sleep(sleep_timeout_ms());
- }
- EXPECT_TRUE(exist);
- EXPECT_TRUE(file_util::DieFileDie(client_file, false));
+ void CheckFile(const FilePath& generated_file,
+ const FilePath& expected_result_file) {
+ FilePath expected_result_filepath = UITest::GetTestFilePath(
+ UTF8ToWide(kTestDir), expected_result_file.ToWStringHack());
+ ASSERT_TRUE(file_util::PathExists(expected_result_filepath));
+ WaitForGeneratedFileAndCheck(generated_file,
+ expected_result_filepath,
+ false, // Don't care whether they are equal.
+ false,
+ false); // Don't delete file
}
virtual void SetUp() {
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index af32d9f..69d534c 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -3637,6 +3637,7 @@
],
'sources': [
'app/chrome_main_uitest.cc',
+ 'browser/browser_encoding_uitest.cc',
'browser/browser_uitest.cc',
'browser/download/download_uitest.cc',
'browser/download/save_page_uitest.cc',
diff --git a/chrome/test/data/encoding_tests/alias_mapping/Big5.html b/chrome/test/data/encoding_tests/alias_mapping/Big5.html
new file mode 100644
index 0000000..2dfa975
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/Big5.html
@@ -0,0 +1,17 @@
+<HTML>
+ <HEAD>
+ <TITLE> Big5 </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=Big5" />
+ </HEAD>
+
+ <BODY>
+ x_ݦuҬQѩde`γ󪺩Ъ١Aިӫ󪺱jPCҤQΥLٷ|ȮɹL½cdAhìOӨ뱴LpALwzL߮vV_ҪFuYijvC
+
+x_ݦuҬQѥߧYMAudСvOҦ椽ơAåbФҿתu½cdvFdGo{HW~A]aA٩ФʵvA@idC
+
+_ҰƩҪj˱jաA@eHwACѳ|wɡBwId٩СAQѤUȩde`Ϊ٩ЮɡA]󥿻Pߩe\SOA۰WSO߮v|A@ɨӤΧidơC
+
+߮vGshAijudСvIpAߧGѷ|nΥܡAQѥL]ѭ𨾸ƥ浹AקKenFLëijQEXxWfnAFuIqijvAܷ|Ҽ{C
+ </BODY>
+</HTML>
+
diff --git a/chrome/test/data/encoding_tests/alias_mapping/EUC-JP.html b/chrome/test/data/encoding_tests/alias_mapping/EUC-JP.html
new file mode 100644
index 0000000..d98eb48
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/EUC-JP.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" >
+<head>
+ <title>EUC-JP</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP" />
+</head>
+<body>
+ʵƻ򤳤褦˰ƤȤˡ񿳵Ĥڤ롣Ϲ̱餷ܵǹͤƤΤסʹƤ
+
+ˤ澮Ȥζͻٱ硢عѿ̲®ƻϩʤɡ衦ʵкޤƤ롣Ϻϣǯͽȹ碌ʵƤΣʥåȤΣܤȰդ롣
+
+ʵкɬޤǧ롣Ϳޤä礤˲ķ衢ΩΤϡǤʤȤǤϤʤϤ
+
+ۣߤ۵նˤ롣ޤᡢ۸ǤȤ󾧤ΤѤѤޤ줿
+
+ٱΤᤫʵɷ¤򤹤ΤʤΤνϼΤहΤݡͿޤбžžƤ̱ɾȽ˧ʤ
+
+εնˤäơͽΩƻ򼫤ĤƤޤä
+
+ޤз򶯤Ƥ롣ǯͽƿĤؤαƶ򤱤줽ˤʤ
+
+ͽƤΤΤϡäƣƤмΩ롣ϢˡƤϣ᤮ʤнǺƲķǤʤͽμԤϤ줳ࡣ
+</body>
+</html>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-13.html b/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-13.html
new file mode 100644
index 0000000..9e88f5f
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-13.html
@@ -0,0 +1,15 @@
+<HTML>
+ <HEAD>
+ <TITLE> ISO-8859-13 </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-13" />
+ </HEAD>
+
+ <BODY>
+
+
+
+
+
+
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-15.html b/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-15.html
new file mode 100644
index 0000000..25ae209
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-15.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" >
+<head>
+ <title>ISO-8859-15</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-15" />
+</head>
+<body>
+
+</body>
+</html>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-2.html b/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-2.html
new file mode 100644
index 0000000..544554a
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-2.html
@@ -0,0 +1,105 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" >
+<head>
+ <title>ISO-8859-2</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-2" />
+</head>
+<body>
+[ ] 160 10/00 240 A0 No-break space
+[] 161 10/01 241 A1 A ogonek
+[] 162 10/02 242 A2 Breve
+[] 163 10/03 243 A3 L with stroke
+[] 164 10/04 244 A4 Currency sign
+[] 165 10/05 245 A5 L caron
+[] 166 10/06 246 A6 S acute
+[] 167 10/07 247 A7 Paragraph sign
+[] 168 10/08 250 A8 Diaeresis
+[] 169 10/09 251 A9 S caron
+[] 170 10/10 252 AA S cedilla
+[] 171 10/11 253 AB T caron
+[] 172 10/12 254 AC Z acute
+[] 173 10/13 255 AD Soft hyphen
+[] 174 10/14 256 AE Z caron
+[] 175 10/15 257 AF Z dot above
+[] 176 11/00 260 B0 Degree sign, ring above
+[] 177 11/01 261 B1 a ogonek
+[] 178 11/02 262 B2 ogonek
+[] 179 11/03 263 B3 l with stroke
+[] 180 11/04 264 B4 Acute accent
+[] 181 11/05 265 B5 l caron
+[] 182 11/06 266 B6 s acute
+[] 183 11/07 267 B7 Caron
+[] 184 11/08 270 B8 Cedilla
+[] 185 11/09 271 B9 s caron
+[] 186 11/10 272 BA s cedilla
+[] 187 11/11 273 BB t caron
+[] 188 11/12 274 BC z acute
+[] 189 11/13 275 BD Double acute accent
+[] 190 11/14 276 BE z caron
+[] 191 11/15 277 BF z dot above
+[] 192 12/00 300 C0 R acute
+[] 193 12/01 301 C1 A acute
+[] 194 12/02 302 C2 A circumflex
+[] 195 12/03 303 C3 A breve
+[] 196 12/04 304 C4 A diaeresis
+[] 197 12/05 305 C5 L acute
+[] 198 12/06 306 C6 C acute
+[] 199 12/07 307 C7 C Cedilla
+[] 200 12/08 310 C8 C caron
+[] 201 12/09 311 C9 E acute
+[] 202 12/10 312 CA E ogonek
+[] 203 12/11 313 CB E diaeresis
+[] 204 12/12 314 CC E caron
+[] 205 12/13 315 CD I acute
+[] 206 12/14 316 CE I circumflex
+[] 207 12/15 317 CF D caron
+[] 208 13/00 320 D0 D stroke
+[] 209 13/01 321 D1 N acute
+[] 210 13/02 322 D2 N caron
+[] 211 13/03 323 D3 O acute
+[] 212 13/04 324 D4 O circumflex
+[] 213 13/05 325 D5 O double acute
+[] 214 13/06 326 D6 O diaeresis
+[] 215 13/07 327 D7 Multiplication sign
+[] 216 13/08 330 D8 R caron
+[] 217 13/09 331 D9 U ring
+[] 218 13/10 332 DA U acute
+[] 219 13/11 333 DB U double acute
+[] 220 13/12 334 DC U diaeresis
+[] 221 13/13 335 DD Y acute
+[] 222 13/14 336 DE T cedilla
+[] 223 13/15 337 DF German sharp s
+[] 224 14/00 340 E0 r acute
+[] 225 14/01 341 E1 a acute
+[] 226 14/02 342 E2 a circumflex
+[] 227 14/03 343 E3 a breve
+[] 228 14/04 344 E4 a diaeresis
+[] 229 14/05 345 E5 l acute
+[] 230 14/06 346 E6 c acute
+[] 231 14/07 347 E7 c cedilla
+[] 232 14/08 350 E8 c caron
+[] 233 14/09 351 E9 e acute
+[] 234 14/10 352 EA e ogonek
+[] 235 14/11 353 EB e diaeresis
+[] 236 14/12 354 EC e caron
+[] 237 14/13 355 ED i acute
+[] 238 14/14 356 EE i circumflex
+[] 239 14/15 357 EF d caron
+[] 240 15/00 360 F0 d stroke
+[] 241 15/01 361 F1 n acute
+[] 242 15/02 362 F2 n caron
+[] 243 15/03 363 F3 o acute
+[] 244 15/04 364 F4 o circumflex
+[] 245 15/05 365 F5 o double acute
+[] 246 15/06 366 F6 o diaeresis
+[] 247 15/07 367 F7 Division sign
+[] 248 15/08 370 F8 r caron
+[] 249 15/09 371 F9 u ring
+[] 250 15/10 372 FA u acute
+[] 251 15/11 373 FB u double acute
+[] 252 15/12 374 FC u diaeresis
+[] 253 15/13 375 FD y acute
+[] 254 15/14 376 FE t cedilla
+[] 255 15/15 377 FF Dot above
+</body>
+</html>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-4.html b/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-4.html
new file mode 100644
index 0000000..36eb7f7
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-4.html
@@ -0,0 +1,15 @@
+<HTML>
+ <HEAD>
+ <TITLE> ISO-8859-4 </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-4" />
+ </HEAD>
+
+ <BODY>
+
+
+
+
+
+
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-5.html b/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-5.html
new file mode 100644
index 0000000..a6ef5a4
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-5.html
@@ -0,0 +1,10 @@
+<HTML>
+ <HEAD>
+ <TITLE> ISO-8859-5 </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-5" />
+ </HEAD>
+
+ <BODY>
+ , 9 - . . "", , - . ...
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-6.html b/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-6.html
new file mode 100644
index 0000000..b883b7b
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-6.html
@@ -0,0 +1,10 @@
+<HTML>
+ <HEAD>
+ <TITLE> ISO-8859-6 </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-6" />
+ </HEAD>
+
+ <BODY dir="RTL">
+ // . " ɬ 16:20 " . " ...
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-7.html b/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-7.html
new file mode 100644
index 0000000..d10d630
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-7.html
@@ -0,0 +1,10 @@
+<HTML>
+ <HEAD>
+ <TITLE> ISO-8859-7 </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-7" />
+ </HEAD>
+
+ <BODY>
+ . . . , ...
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-8.html b/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-8.html
new file mode 100644
index 0000000..3c16fa8
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/ISO-8859-8.html
@@ -0,0 +1,10 @@
+<HTML>
+ <HEAD>
+ <TITLE> ISO-8859-8 </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-8" />
+ </HEAD>
+
+ <body dir="rtl">
+ , " : " . " ". " " " " - " - (') , , " ...
+ </body>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/KOI8-R.html b/chrome/test/data/encoding_tests/alias_mapping/KOI8-R.html
new file mode 100644
index 0000000..97451cc
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/KOI8-R.html
@@ -0,0 +1,10 @@
+<HTML>
+ <HEAD>
+ <TITLE> KOI8-R </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=KOI8-R" />
+ </HEAD>
+
+ <BODY>
+ , 9 - . . "", , - . ...
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/KOI8-U.html b/chrome/test/data/encoding_tests/alias_mapping/KOI8-U.html
new file mode 100644
index 0000000..dd7c27a9
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/KOI8-U.html
@@ -0,0 +1,10 @@
+<HTML>
+ <HEAD>
+ <TITLE> KOI8-U </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=KOI8-U" />
+ </HEAD>
+
+ <BODY>
+ , 9 - . . "", , - . ...
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/Shift-JIS.html b/chrome/test/data/encoding_tests/alias_mapping/Shift-JIS.html
new file mode 100644
index 0000000..944827c
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/Shift-JIS.html
@@ -0,0 +1,12 @@
+<HTML>
+ <HEAD>
+ <TITLE> Shift_JIS </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS" />
+ </HEAD>
+
+ <BODY>
+ O@c@^cψ͂Xߌ̗ŁAPRɖ{cJAQ~̒zt𐷂荞񂾂QOOWNxQ␳\ZĂƊ֘A@Ă̌邱Ƃ⌛ψ̐EŌ߂B^}̎^ʼnŒAQ@ɑtB}́ut̋c_s\vƔAQ@Rcɂ͓ʉȂjB̌ł́Atւ̕sԂ鎩}瑢҂o”\A͍ŏ̃}}B
+@O@c^ςɐ旧AO@\Zψ͗ŁAPRɂQ␳̒߂莿^š邱Ƃ߂BZAAyʂ̊eψȂǂJAztȂǂ̍ƂčZʉvS~ʉvɌJ@ĂȂǂ̊֘A@ĂAɍ̌邱ƂB{cɋً}AŒ^тB
+@ɑ΂A}͂XߌA}{ŏY\炪oȂĊJAQ␳ւ̑Ήɂ‚(1)PȐO@\ZςƖ{cɂ͏oȂǍOɑސȂȂǂčRc(2)Q@ł̐Rc͓ʋۂ|Ƃ߂B
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/UTF-16LE.html b/chrome/test/data/encoding_tests/alias_mapping/UTF-16LE.html
new file mode 100644
index 0000000..eed43e9
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/UTF-16LE.html
Binary files differ
diff --git a/chrome/test/data/encoding_tests/alias_mapping/UTF-8.html b/chrome/test/data/encoding_tests/alias_mapping/UTF-8.html
new file mode 100644
index 0000000..7360fb6
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/UTF-8.html
@@ -0,0 +1,12 @@
+<HTML>
+ <HEAD>
+ <TITLE> UTF-8 </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ </HEAD>
+
+ <BODY>
+ 麦蒂的天赋极高,即使是著名的“麦黑”弗兰.布林巴里也直率的表示,麦蒂的天赋足可以排进NBA的前10位。但是在麦蒂的职业生涯中,他却从未取得比季后赛第一轮更好的成绩,现在还甚至被广大的球迷和专家口诛笔伐称为“毒瘤”,称他不在场上的时候火箭反而能够打得更好——作为一个年薪2000万超级球星来说,麦蒂似乎已经失去了他的天赋所应该给他和球队带来的场上价值。
+
+“麦蒂一直认为,他的天赋可以让他做到一些事情。”在与凯尔特人的比赛之后,阿泰斯特如是说。“但是我们有时候会忘记,其实努力比天赋更重要,我们必须努力才行。”
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/gb18030.html b/chrome/test/data/encoding_tests/alias_mapping/gb18030.html
new file mode 100644
index 0000000..581a4e4
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/gb18030.html
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML>
+ <HEAD>
+ <TITLE> New Document </TITLE>
+ <META NAME="Generator" CONTENT="EditPlus">
+ <META NAME="Author" CONTENT="">
+ <META NAME="Keywords" CONTENT="">
+ <META NAME="Description" CONTENT="">
+ <meta http-equiv="Content-Type" content="text/html; charset=gb18030" />
+ </HEAD>
+
+ <BODY>
+ NBAٷչ09ȫƱѡĽ׶Խħз2,102,368ƱȻܶƾ豾ֳ䱾ɫСʵղķ˹ϿɣĿǰܼ1,940,162ƱԽ˿ƱȾ˵ڶ棬С޿Ʊ1,903,798ƱȾλҦ1,758,499Ʊ׷зӦ֮ܹעҹԱ׽ڴ˴ιĽǰλڶλļȻ16ƱIJ࣬ǵ˴۾սԼıƣ10ͶƱϣӭͷϡ
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/iso-8859-1.html b/chrome/test/data/encoding_tests/alias_mapping/iso-8859-1.html
new file mode 100644
index 0000000..71b9f35
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/iso-8859-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.o rg/TR/1999/REC-html401-19991224/loose.dtd">
+<HTML lang=en-US xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
+<HEAD profile=http://www.w3.org/2000/08/w3c-synd/#>
+<TITLE>World Wide Web Consortium - Web Standards</TITLE>
+<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
+</HEAD>
+<BODY>
+<H1 id=logo><IMG height=48 alt="The World Wide Web Consortium (W3C)" src="/Icons/w3c_main" width=315></H1>
+<H2 id=slogan>Leading the Web to Its Full Potential...</H2>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/chrome/test/data/encoding_tests/alias_mapping/macintosh.html b/chrome/test/data/encoding_tests/alias_mapping/macintosh.html
new file mode 100644
index 0000000..4c09602
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/macintosh.html
@@ -0,0 +1,10 @@
+<HTML>
+ <HEAD>
+ <TITLE> macintosh </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=macintosh" />
+ </HEAD>
+
+ <BODY>
+ By Tom Curry Here is a guide to the process by which Gov. Rod Blagojevich of Illinois might be removed from office Impeachment is the formal accusation of wrongdoing, lobbed by a legislative body against an executive branch official, such as a governor ...
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/windows-1250.html b/chrome/test/data/encoding_tests/alias_mapping/windows-1250.html
new file mode 100644
index 0000000..6b7b98b
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/windows-1250.html
@@ -0,0 +1,105 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" >
+<head>
+ <title>windows-1250</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=windows-1250" />
+</head>
+<body>
+[ ] 160 10/00 240 A0 No-break space
+[] 161 10/01 241 A1 A ogonek
+[] 162 10/02 242 A2 Breve
+[] 163 10/03 243 A3 L with stroke
+[] 164 10/04 244 A4 Currency sign
+[] 165 10/05 245 A5 L caron
+[] 166 10/06 246 A6 S acute
+[] 167 10/07 247 A7 Paragraph sign
+[] 168 10/08 250 A8 Diaeresis
+[] 169 10/09 251 A9 S caron
+[] 170 10/10 252 AA S cedilla
+[] 171 10/11 253 AB T caron
+[] 172 10/12 254 AC Z acute
+[] 173 10/13 255 AD Soft hyphen
+[] 174 10/14 256 AE Z caron
+[] 175 10/15 257 AF Z dot above
+[] 176 11/00 260 B0 Degree sign, ring above
+[] 177 11/01 261 B1 a ogonek
+[] 178 11/02 262 B2 ogonek
+[] 179 11/03 263 B3 l with stroke
+[] 180 11/04 264 B4 Acute accent
+[] 181 11/05 265 B5 l caron
+[] 182 11/06 266 B6 s acute
+[] 183 11/07 267 B7 Caron
+[] 184 11/08 270 B8 Cedilla
+[] 185 11/09 271 B9 s caron
+[] 186 11/10 272 BA s cedilla
+[] 187 11/11 273 BB t caron
+[] 188 11/12 274 BC z acute
+[] 189 11/13 275 BD Double acute accent
+[] 190 11/14 276 BE z caron
+[] 191 11/15 277 BF z dot above
+[] 192 12/00 300 C0 R acute
+[] 193 12/01 301 C1 A acute
+[] 194 12/02 302 C2 A circumflex
+[] 195 12/03 303 C3 A breve
+[] 196 12/04 304 C4 A diaeresis
+[] 197 12/05 305 C5 L acute
+[] 198 12/06 306 C6 C acute
+[] 199 12/07 307 C7 C Cedilla
+[] 200 12/08 310 C8 C caron
+[] 201 12/09 311 C9 E acute
+[] 202 12/10 312 CA E ogonek
+[] 203 12/11 313 CB E diaeresis
+[] 204 12/12 314 CC E caron
+[] 205 12/13 315 CD I acute
+[] 206 12/14 316 CE I circumflex
+[] 207 12/15 317 CF D caron
+[] 208 13/00 320 D0 D stroke
+[] 209 13/01 321 D1 N acute
+[] 210 13/02 322 D2 N caron
+[] 211 13/03 323 D3 O acute
+[] 212 13/04 324 D4 O circumflex
+[] 213 13/05 325 D5 O double acute
+[] 214 13/06 326 D6 O diaeresis
+[] 215 13/07 327 D7 Multiplication sign
+[] 216 13/08 330 D8 R caron
+[] 217 13/09 331 D9 U ring
+[] 218 13/10 332 DA U acute
+[] 219 13/11 333 DB U double acute
+[] 220 13/12 334 DC U diaeresis
+[] 221 13/13 335 DD Y acute
+[] 222 13/14 336 DE T cedilla
+[] 223 13/15 337 DF German sharp s
+[] 224 14/00 340 E0 r acute
+[] 225 14/01 341 E1 a acute
+[] 226 14/02 342 E2 a circumflex
+[] 227 14/03 343 E3 a breve
+[] 228 14/04 344 E4 a diaeresis
+[] 229 14/05 345 E5 l acute
+[] 230 14/06 346 E6 c acute
+[] 231 14/07 347 E7 c cedilla
+[] 232 14/08 350 E8 c caron
+[] 233 14/09 351 E9 e acute
+[] 234 14/10 352 EA e ogonek
+[] 235 14/11 353 EB e diaeresis
+[] 236 14/12 354 EC e caron
+[] 237 14/13 355 ED i acute
+[] 238 14/14 356 EE i circumflex
+[] 239 14/15 357 EF d caron
+[] 240 15/00 360 F0 d stroke
+[] 241 15/01 361 F1 n acute
+[] 242 15/02 362 F2 n caron
+[] 243 15/03 363 F3 o acute
+[] 244 15/04 364 F4 o circumflex
+[] 245 15/05 365 F5 o double acute
+[] 246 15/06 366 F6 o diaeresis
+[] 247 15/07 367 F7 Division sign
+[] 248 15/08 370 F8 r caron
+[] 249 15/09 371 F9 u ring
+[] 250 15/10 372 FA u acute
+[] 251 15/11 373 FB u double acute
+[] 252 15/12 374 FC u diaeresis
+[] 253 15/13 375 FD y acute
+[] 254 15/14 376 FE t cedilla
+[] 255 15/15 377 FF Dot above
+</body>
+</html>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/windows-1251.html b/chrome/test/data/encoding_tests/alias_mapping/windows-1251.html
new file mode 100644
index 0000000..15fac6c
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/windows-1251.html
@@ -0,0 +1,10 @@
+<HTML>
+ <HEAD>
+ <TITLE> windows-1251 </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
+ </HEAD>
+
+ <BODY>
+ , 9 - . . "", , - . ...
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/windows-1252.html b/chrome/test/data/encoding_tests/alias_mapping/windows-1252.html
new file mode 100644
index 0000000..caa8a23
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/windows-1252.html
@@ -0,0 +1,14 @@
+<HTML>
+ <HEAD>
+ <TITLE> windows-1252 </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
+ </HEAD>
+
+ <BODY>
+ The article of impeachment -- essentially an indictment -- now goes to the state Senate for a trial. A two-thirds vote is required there to convict Blagojevich and remove him from office. The trial will be presided over by the chief justice of the Illinois Supreme Court and could begin as early as Jan. 26.
+
+In the state Senate trial, impeachment managers and Blagojevich will have the opportunity to present witnesses and evidence.
+
+If convicted by the Illinois Senate, Blagojevich would be removed from office and Lt. Gov. Pat Quinn would become acting governor.
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/windows-1253.html b/chrome/test/data/encoding_tests/alias_mapping/windows-1253.html
new file mode 100644
index 0000000..a7fc76b
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/windows-1253.html
@@ -0,0 +1,10 @@
+<HTML>
+ <HEAD>
+ <TITLE> windows-1253 </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=windows-1253" />
+ </HEAD>
+
+ <BODY>
+ . . . , ...
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/windows-1254.html b/chrome/test/data/encoding_tests/alias_mapping/windows-1254.html
new file mode 100644
index 0000000..f5da510
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/windows-1254.html
@@ -0,0 +1,10 @@
+<HTML>
+ <HEAD>
+ <TITLE> windows-1254 </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=windows-1254" />
+ </HEAD>
+
+ <BODY>
+ Arama yaplan en arpc adres, AK Parti Genel Merkezi'nin karsnda yer alan ve Atatrk Orman iftlii'nin snrlar iinde yer alan Saklbahe mesirelik alan. Polis ekipleri arama almalarn Saklbahe'nin 'emeba' mevkiinde younlatrld. ...
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/windows-1255.html b/chrome/test/data/encoding_tests/alias_mapping/windows-1255.html
new file mode 100644
index 0000000..07584f1
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/windows-1255.html
@@ -0,0 +1,10 @@
+<HTML>
+ <HEAD>
+ <TITLE> windows-1255 </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=windows-1255" />
+ </HEAD>
+
+ <body dir="rtl">
+ , " : " . " ". " " " " - " (') , , " ...
+ </body>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/windows-1256.html b/chrome/test/data/encoding_tests/alias_mapping/windows-1256.html
new file mode 100644
index 0000000..72c6d31
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/windows-1256.html
@@ -0,0 +1,10 @@
+<HTML>
+ <HEAD>
+ <TITLE> windows-1256 </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=windows-1256" />
+ </HEAD>
+
+ <BODY dir="RTL">
+ // . " ɡ 16:20 " . " ...
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/windows-1257.html b/chrome/test/data/encoding_tests/alias_mapping/windows-1257.html
new file mode 100644
index 0000000..adf4cb7
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/windows-1257.html
@@ -0,0 +1,23 @@
+<HTML>
+ <HEAD>
+ <TITLE> windows-1257 </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=windows-1257" />
+ </HEAD>
+
+ <BODY>
+ ! " # $ % & ' ( ) * + , - . /
+0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+@ A B C D E F G H I J K L M N O
+P Q R S T U V W X Y Z [ \ ] ^ _
+` a b c d e f g h i j k l m n o
+p q r s t u v w x y z { | } ~ 
+ ? ? ?
+ ? ? ?
+
+
+
+
+
+
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/windows-1258.html b/chrome/test/data/encoding_tests/alias_mapping/windows-1258.html
new file mode 100644
index 0000000..bb788a3
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/windows-1258.html
@@ -0,0 +1,10 @@
+<HTML>
+ <HEAD>
+ <TITLE> windows-1258 </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=windows-1258" />
+ </HEAD>
+
+ <BODY>
+ L nh?ng ng?i h?c tr?, mn qu dng t?ng th?y c trong ngy 20/11 khng ph?i l nh?ng b hoa hay nh?ng t?ng v?t v? v?t ch?t m chnh l s? thnh ?t c?a h?c tr?. Nh?ng bng hoa ti c th? t?a hng thm ngt nhng n khng thm b?ng hoa i?m m?i. Khng c l?i ca no hay b?ng s? thnh cng m ng?i h?c tr? knh dng ln th?y. m?i l i?u nh?ng ng?i lm ngh? ?ch? ?? m?i c?m th?y h?nh phc. Th?y ? a em ?n b?n b? tri th?c m?i. Thnh cng c?a em hm nay lun c bng dng th?y. Thnh cng hm c?a chng em chnh l th?c o v? s? thnh ?t c?a ng?i th?y.
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/windows-874.html b/chrome/test/data/encoding_tests/alias_mapping/windows-874.html
new file mode 100644
index 0000000..5813b96
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/windows-874.html
@@ -0,0 +1,11 @@
+<HTML>
+ <HEAD>
+ <TITLE> windows-874 </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
+ </HEAD>
+
+ <BODY>
+ ٹ ѧŧ дǡѺä
+ǤԴ :: 㹻 "ѧŧ/ѧŧ͹Ź" ҡ ѧŧ 㹰ҹšҧ(·ӡѾഷءѹ) µ͡ä ԹöҶ֧ŷ ѹ ҧǴ дǡ
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/alias_mapping/windows-949.html b/chrome/test/data/encoding_tests/alias_mapping/windows-949.html
new file mode 100644
index 0000000..3159777
--- /dev/null
+++ b/chrome/test/data/encoding_tests/alias_mapping/windows-949.html
@@ -0,0 +1,14 @@
+<HTML>
+ <HEAD>
+ <TITLE> windows-949 </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=windows-949" />
+ </HEAD>
+
+ <BODY>
+ ѳ 2 ӽñȸ ȸ 'ȸ ¹' ϱ ߴ.
+
+ִ ׷ "ѳ ռ 'MBǹ' óϷ ؼ ġ ° ߴܵ ŷ ä ߴ ȣϰ ִ" ݹߴ.
+
+ä ̳ "ȸ »¿ õ ҡ 11 żϰ ϰ ö ϶" ߴ. "ȸ ִ ߵž , ҡ ִ ŭ Ҽ ̳ ϸ ϰ Ģ ó϶" ߴ. Ⱙ γ ǥ 12, ִ , γ ǿԴ 13 ⼮϶ ߼ߴ.
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/auto_detect/Big5_with_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/Big5_with_no_encoding_specified.html
new file mode 100644
index 0000000..1f30b4e
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/Big5_with_no_encoding_specified.html
@@ -0,0 +1,16 @@
+<HTML>
+ <HEAD>
+ <TITLE> Big5 </TITLE>
+ </HEAD>
+
+ <BODY>
+ x_ݦuҬQѩde`γ󪺩Ъ١Aިӫ󪺱jPCҤQΥLٷ|ȮɹL½cdAhìOӨ뱴LpALwzL߮vV_ҪFuYijvC
+
+x_ݦuҬQѥߧYMAudСvOҦ椽ơAåbФҿתu½cdvFdGo{HW~A]aA٩ФʵvA@idC
+
+_ҰƩҪj˱jաA@eHwACѳ|wɡBwId٩СAQѤUȩde`Ϊ٩ЮɡA]󥿻Pߩe\SOA۰WSO߮v|A@ɨӤΧidơC
+
+߮vGshAijudСvIpAߧGѷ|nΥܡAQѥL]ѭ𨾸ƥ浹AקKenFLëijQEXxWfnAFuIqijvAܷ|Ҽ{C
+ </BODY>
+</HTML>
+
diff --git a/chrome/test/data/encoding_tests/auto_detect/ISO-8859-5_with_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/ISO-8859-5_with_no_encoding_specified.html
new file mode 100644
index 0000000..f5ca11e
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/ISO-8859-5_with_no_encoding_specified.html
@@ -0,0 +1,9 @@
+<HTML>
+ <HEAD>
+ <TITLE> ISO-8859-5 </TITLE>
+ </HEAD>
+
+ <BODY>
+ , 9 - . . "", , - . ...
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/auto_detect/ISO-8859-6_with_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/ISO-8859-6_with_no_encoding_specified.html
new file mode 100644
index 0000000..6aad8bb
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/ISO-8859-6_with_no_encoding_specified.html
@@ -0,0 +1,9 @@
+<HTML>
+ <HEAD>
+ <TITLE> ISO-8859-6 </TITLE>
+ </HEAD>
+
+ <BODY dir="RTL">
+ // . " ɬ 16:20 " . " ...
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/auto_detect/ISO-8859-7_with_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/ISO-8859-7_with_no_encoding_specified.html
new file mode 100644
index 0000000..63a9047
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/ISO-8859-7_with_no_encoding_specified.html
@@ -0,0 +1,9 @@
+<HTML>
+ <HEAD>
+ <TITLE> ISO-8859-7 </TITLE>
+ </HEAD>
+
+ <BODY>
+ . . . , ...
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/auto_detect/ISO-8859-8_with_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/ISO-8859-8_with_no_encoding_specified.html
new file mode 100644
index 0000000..4a4e467
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/ISO-8859-8_with_no_encoding_specified.html
@@ -0,0 +1,9 @@
+<HTML>
+ <HEAD>
+ <TITLE> ISO-8859-8 </TITLE>
+ </HEAD>
+
+ <body dir="rtl">
+ , " : " . " ". " " " " - " - (') , , " ...
+ </body>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/auto_detect/KOI8-R_with_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/KOI8-R_with_no_encoding_specified.html
new file mode 100644
index 0000000..13c81c9
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/KOI8-R_with_no_encoding_specified.html
@@ -0,0 +1,9 @@
+<HTML>
+ <HEAD>
+ <TITLE> KOI8-R </TITLE>
+ </HEAD>
+
+ <BODY>
+ , 9 - . . "", , - . ...
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/auto_detect/Shift-JIS_with_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/Shift-JIS_with_no_encoding_specified.html
new file mode 100644
index 0000000..63d5852
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/Shift-JIS_with_no_encoding_specified.html
@@ -0,0 +1,11 @@
+<HTML>
+ <HEAD>
+ <TITLE> Shift_JIS </TITLE>
+ </HEAD>
+
+ <BODY>
+ O@c@^cψ͂Xߌ̗ŁAPRɖ{cJAQ~̒zt𐷂荞񂾂QOOWNxQ␳\ZĂƊ֘A@Ă̌邱Ƃ⌛ψ̐EŌ߂B^}̎^ʼnŒAQ@ɑtB}́ut̋c_s\vƔAQ@Rcɂ͓ʉȂjB̌ł́Atւ̕sԂ鎩}瑢҂o”\A͍ŏ̃}}B
+@O@c^ςɐ旧AO@\Zψ͗ŁAPRɂQ␳̒߂莿^š邱Ƃ߂BZAAyʂ̊eψȂǂJAztȂǂ̍ƂčZʉvS~ʉvɌJ@ĂȂǂ̊֘A@ĂAɍ̌邱ƂB{cɋً}AŒ^тB
+@ɑ΂A}͂XߌA}{ŏY\炪oȂĊJAQ␳ւ̑Ήɂ‚(1)PȐO@\ZςƖ{cɂ͏oȂǍOɑސȂȂǂčRc(2)Q@ł̐Rc͓ʋۂ|Ƃ߂B
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/auto_detect/UTF-8_with_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/UTF-8_with_no_encoding_specified.html
new file mode 100644
index 0000000..65537cb
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/UTF-8_with_no_encoding_specified.html
@@ -0,0 +1,9 @@
+<HTML><HEAD>
+ <TITLE> UTF-8 </TITLE>
+ </HEAD><BODY>
+ 麦蒂的天赋极高,即使是著名的“麦黑”弗兰.布林巴里也直率的表示,麦蒂的天赋足可以排进NBA的前10位。但是在麦蒂的职业生涯中,他却从未取得比季后赛第一轮更好的成绩,现在还甚至被广大的球迷和专家口诛笔伐称为“毒瘤”,称他不在场上的时候火箭反而能够打得更好——作为一个年薪2000万超级球星来说,麦蒂似乎已经失去了他的天赋所应该给他和球队带来的场上价值。
+
+“麦蒂一直认为,他的天赋可以让他做到一些事情。”在与凯尔特人的比赛之后,阿泰斯特如是说。“但是我们有时候会忘记,其实努力比天赋更重要,我们必须努力才行。”
+
+
+</BODY></HTML> \ No newline at end of file
diff --git a/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_Big5_saved_from_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_Big5_saved_from_no_encoding_specified.html
new file mode 100644
index 0000000..c1da48d
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_Big5_saved_from_no_encoding_specified.html
@@ -0,0 +1,16 @@
+
+<!-- saved from url=(0080)http://mock.http/encoding_tests/auto_detect/Big5_with_no_encoding_specified.html -->
+<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=Big5">
+ <TITLE> Big5 </TITLE>
+ </HEAD><BODY>
+ x_ݦuҬQѩde`γ󪺩Ъ١Aިӫ󪺱jPCҤQΥLٷ|ȮɹL½cdAhìOӨ뱴LpALwzL߮vV_ҪFuYijvC
+
+x_ݦuҬQѥߧYMAudСvOҦ椽ơAåbФҿתu½cdvFdGo{HW~A]aA٩ФʵvA@idC
+
+_ҰƩҪj˱jաA@eHwACѳ|wɡBwId٩СAQѤUȩde`Ϊ٩ЮɡA]󥿻Pߩe\SOA۰WSO߮v|A@ɨӤΧidơC
+
+߮vGshAijudСvIpAߧGѷ|nΥܡAQѥL]ѭ𨾸ƥ浹AקKenFLëijQEXxWfnAFuIqijvAܷ|Ҽ{C
+
+
+
+</BODY></HTML> \ No newline at end of file
diff --git a/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-5_saved_from_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-5_saved_from_no_encoding_specified.html
new file mode 100644
index 0000000..bd58e79
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-5_saved_from_no_encoding_specified.html
@@ -0,0 +1,9 @@
+
+<!-- saved from url=(0086)http://mock.http/encoding_tests/auto_detect/ISO-8859-5_with_no_encoding_specified.html -->
+<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-5">
+ <TITLE> ISO-8859-5 </TITLE>
+ </HEAD><BODY>
+ , 9 - . . "", , - . ...
+
+
+</BODY></HTML> \ No newline at end of file
diff --git a/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-6_saved_from_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-6_saved_from_no_encoding_specified.html
new file mode 100644
index 0000000..04c6dc1
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-6_saved_from_no_encoding_specified.html
@@ -0,0 +1,9 @@
+
+<!-- saved from url=(0086)http://mock.http/encoding_tests/auto_detect/ISO-8859-6_with_no_encoding_specified.html -->
+<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-6">
+ <TITLE> ISO-8859-6 </TITLE>
+ </HEAD><BODY dir="RTL">
+ // . " ɬ 16:20 " . " ...
+
+
+</BODY></HTML> \ No newline at end of file
diff --git a/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-7_saved_from_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-7_saved_from_no_encoding_specified.html
new file mode 100644
index 0000000..21be47b
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-7_saved_from_no_encoding_specified.html
@@ -0,0 +1,9 @@
+
+<!-- saved from url=(0086)http://mock.http/encoding_tests/auto_detect/ISO-8859-7_with_no_encoding_specified.html -->
+<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-7">
+ <TITLE> ISO-8859-7 </TITLE>
+ </HEAD><BODY>
+ . . . , ...
+
+
+</BODY></HTML> \ No newline at end of file
diff --git a/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-8_saved_from_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-8_saved_from_no_encoding_specified.html
new file mode 100644
index 0000000..cc921aef
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-8_saved_from_no_encoding_specified.html
@@ -0,0 +1,9 @@
+
+<!-- saved from url=(0086)http://mock.http/encoding_tests/auto_detect/ISO-8859-8_with_no_encoding_specified.html -->
+<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-8-I">
+ <TITLE> ISO-8859-8 </TITLE>
+ </HEAD><BODY dir="rtl">
+ , " : " . " ". " " " " - " - (') , , " ...
+
+
+</BODY></HTML> \ No newline at end of file
diff --git a/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_KOI8-R_saved_from_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_KOI8-R_saved_from_no_encoding_specified.html
new file mode 100644
index 0000000..8a66d34
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_KOI8-R_saved_from_no_encoding_specified.html
@@ -0,0 +1,9 @@
+
+<!-- saved from url=(0082)http://mock.http/encoding_tests/auto_detect/KOI8-R_with_no_encoding_specified.html -->
+<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=KOI8-R">
+ <TITLE> KOI8-R </TITLE>
+ </HEAD><BODY>
+ , 9 - . . "", , - . ...
+
+
+</BODY></HTML> \ No newline at end of file
diff --git a/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_Shift-JIS_saved_from_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_Shift-JIS_saved_from_no_encoding_specified.html
new file mode 100644
index 0000000..2a0d5b1
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_Shift-JIS_saved_from_no_encoding_specified.html
@@ -0,0 +1,11 @@
+
+<!-- saved from url=(0085)http://mock.http/encoding_tests/auto_detect/Shift-JIS_with_no_encoding_specified.html -->
+<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
+ <TITLE> Shift_JIS </TITLE>
+ </HEAD><BODY>
+ O@c@^cψ͂Xߌ̗ŁAPRɖ{cJAQ~̒zt𐷂荞񂾂QOOWNxQ␳\ZĂƊ֘A@Ă̌邱Ƃ⌛ψ̐EŌ߂B^}̎^ʼnŒAQ@ɑtB}́ut̋c_s\vƔAQ@Rcɂ͓ʉȂjB̌ł́Atւ̕sԂ鎩}瑢҂o”\A͍ŏ̃}}B
+@O@c^ςɐ旧AO@\Zψ͗ŁAPRɂQ␳̒߂莿^š邱Ƃ߂BZAAyʂ̊eψȂǂJAztȂǂ̍ƂčZʉvS~ʉvɌJ@ĂȂǂ̊֘A@ĂAɍ̌邱ƂB{cɋً}AŒ^тB
+@ɑ΂A}͂XߌA}{ŏY\炪oȂĊJAQ␳ւ̑Ήɂ‚(1)PȐO@\ZςƖ{cɂ͏oȂǍOɑސȂȂǂčRc(2)Q@ł̐Rc͓ʋۂ|Ƃ߂B
+
+
+</BODY></HTML> \ No newline at end of file
diff --git a/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_UTF-8_saved_from_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_UTF-8_saved_from_no_encoding_specified.html
new file mode 100644
index 0000000..b76be7a
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_UTF-8_saved_from_no_encoding_specified.html
@@ -0,0 +1,11 @@
+
+<!-- saved from url=(0081)http://mock.http/encoding_tests/auto_detect/UTF-8_with_no_encoding_specified.html -->
+<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <TITLE> UTF-8 </TITLE>
+ </HEAD><BODY>
+ 麦蒂的天赋极高,即使是著名的“麦黑”弗兰.布林巴里也直率的表示,麦蒂的天赋足可以排进NBA的前10位。但是在麦蒂的职业生涯中,他却从未取得比季后赛第一轮更好的成绩,现在还甚至被广大的球迷和专家口诛笔伐称为“毒瘤”,称他不在场上的时候火箭反而能够打得更好——作为一个年薪2000万超级球星来说,麦蒂似乎已经失去了他的天赋所应该给他和球队带来的场上价值。
+
+“麦蒂一直认为,他的天赋可以让他做到一些事情。”在与凯尔特人的比赛之后,阿泰斯特如是说。“但是我们有时候会忘记,其实努力比天赋更重要,我们必须努力才行。”
+
+
+</BODY></HTML> \ No newline at end of file
diff --git a/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_gb18030_saved_from_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_gb18030_saved_from_no_encoding_specified.html
new file mode 100644
index 0000000..f7625ed
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_gb18030_saved_from_no_encoding_specified.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- saved from url=(0083)http://mock.http/encoding_tests/auto_detect/gb18030_with_no_encoding_specified.html -->
+<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><META http-equiv="Content-Type" content="text/html; charset=gb18030">
+<TITLE>й3</TITLE>
+</HEAD><BODY>
+й3
+
+йƼŹ˾ܾ𾪵ĺ조йٶȡƶй̫ʱ
+
+ףƶͨ豸޹˾߼ʣΪйTD֮ΪTD׼龫ǣ2008ףӴ3GʢĻ
+
+ļŶ¾ϯǿҵֱʵչ۾ᡰ׵֮ȫںУйƷ
+
+Ļҵĺѡ2
+
+ݣŲҵ޹˾³ԽͳӡˢҵִITںϣڱӡˢ900ΪӡˢĹӮ˽ϣ
+
+ƽйӰŹ˾³ӡ޼Ͷ״ڡ÷ɺƽ쵼ӰŶʹйӰʼĴƬʱ
+</BODY></HTML> \ No newline at end of file
diff --git a/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_iso-8859-1_saved_from_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_iso-8859-1_saved_from_no_encoding_specified.html
new file mode 100644
index 0000000..2917cfe
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_iso-8859-1_saved_from_no_encoding_specified.html
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.o rg/TR/1999/REC-html401-19991224/loose.dtd">
+<!-- saved from url=(0086)http://mock.http/encoding_tests/auto_detect/iso-8859-1_with_no_encoding_specified.html -->
+<HTML lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml"><HEAD profile="http://www.w3.org/2000/08/w3c-synd/#"><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<TITLE>iso-8859-1</TITLE>
+</HEAD><BODY>
+<H1 id="logo"><IMG height="48" alt="The World Wide Web Consortium (W3C)" src="http://mock.http/Icons/w3c_main" width="315"></H1>
+<H2 id="slogan">Leading the Web to Its Full Potential...</H2>
+
+</BODY></HTML> \ No newline at end of file
diff --git a/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1251_saved_from_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1251_saved_from_no_encoding_specified.html
new file mode 100644
index 0000000..39f0513
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1251_saved_from_no_encoding_specified.html
@@ -0,0 +1,9 @@
+
+<!-- saved from url=(0088)http://mock.http/encoding_tests/auto_detect/windows-1251_with_no_encoding_specified.html -->
+<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=windows-1251">
+ <TITLE> windows-1251 </TITLE>
+ </HEAD><BODY>
+ , 9 - . . "", , - . ...
+
+
+</BODY></HTML> \ No newline at end of file
diff --git a/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1254_saved_from_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1254_saved_from_no_encoding_specified.html
new file mode 100644
index 0000000..7a44240
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1254_saved_from_no_encoding_specified.html
@@ -0,0 +1,9 @@
+
+<!-- saved from url=(0088)http://mock.http/encoding_tests/auto_detect/windows-1254_with_no_encoding_specified.html -->
+<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=windows-1254">
+ <TITLE> windows-1254 </TITLE>
+ </HEAD><BODY>
+ Arama yaplan en arpc adres, AK Parti Genel Merkezi'nin karsnda yer alan ve Atatrk Orman iftlii'nin snrlar iinde yer alan Saklbahe mesirelik alan. Polis ekipleri arama almalarn Saklbahe'nin 'emeba' mevkiinde younlatrld. ...
+
+
+</BODY></HTML> \ No newline at end of file
diff --git a/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1255_saved_from_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1255_saved_from_no_encoding_specified.html
new file mode 100644
index 0000000..adeb491
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1255_saved_from_no_encoding_specified.html
@@ -0,0 +1,9 @@
+
+<!-- saved from url=(0088)http://mock.http/encoding_tests/auto_detect/windows-1255_with_no_encoding_specified.html -->
+<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=windows-1255">
+ <TITLE> windows-1255 </TITLE>
+ </HEAD><BODY dir="rtl">
+ , " : " . " ". " " " " - " (') , , " ...
+
+
+</BODY></HTML> \ No newline at end of file
diff --git a/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1256_saved_from_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1256_saved_from_no_encoding_specified.html
new file mode 100644
index 0000000..d145318
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1256_saved_from_no_encoding_specified.html
@@ -0,0 +1,9 @@
+
+<!-- saved from url=(0088)http://mock.http/encoding_tests/auto_detect/windows-1256_with_no_encoding_specified.html -->
+<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=windows-1256">
+ <TITLE> windows-1256 </TITLE>
+ </HEAD><BODY dir="RTL">
+ // . " ɡ 16:20 " . " ...
+
+
+</BODY></HTML> \ No newline at end of file
diff --git a/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-949_saved_from_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-949_saved_from_no_encoding_specified.html
new file mode 100644
index 0000000..6d3ddcf2
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-949_saved_from_no_encoding_specified.html
@@ -0,0 +1,13 @@
+
+<!-- saved from url=(0087)http://mock.http/encoding_tests/auto_detect/windows-949_with_no_encoding_specified.html -->
+<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=windows-949">
+ <TITLE> windows-949 </TITLE>
+ </HEAD><BODY>
+ ѳ 2 ӽñȸ ȸ 'ȸ ¹' ϱ ߴ.
+
+ִ ׷ "ѳ ռ 'MBǹ' óϷ ؼ ġ ° ߴܵ ŷ ä ߴ ȣϰ ִ" ݹߴ.
+
+ä ̳ "ȸ »¿ õ ҡ 11 żϰ ϰ ö ϶" ߴ. "ȸ ִ ߵž , ҡ ִ ŭ Ҽ ̳ ϸ ϰ Ģ ó϶" ߴ. Ⱙ γ ǥ 12, ִ , γ ǿԴ 13 ⼮϶ ߼ߴ.
+
+
+</BODY></HTML> \ No newline at end of file
diff --git a/chrome/test/data/encoding_tests/auto_detect/gb18030_with_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/gb18030_with_no_encoding_specified.html
new file mode 100644
index 0000000..fb9dfbf
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/gb18030_with_no_encoding_specified.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- saved from url=(0023)http://www.sina.com.cn/ -->
+<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD>
+<TITLE>й3</TITLE>
+</HEAD>
+<BODY>
+й3
+
+йƼŹ˾ܾ𾪵ĺ조йٶȡƶй̫ʱ
+
+ףƶͨ豸޹˾߼ʣΪйTD֮ΪTD׼龫ǣ2008ףӴ3GʢĻ
+
+ļŶ¾ϯǿҵֱʵչ۾ᡰ׵֮ȫںУйƷ
+
+Ļҵĺѡ2
+
+ݣŲҵ޹˾³ԽͳӡˢҵִITںϣڱӡˢ900ΪӡˢĹӮ˽ϣ
+
+ƽйӰŹ˾³ӡ޼Ͷ״ڡ÷ɺƽ쵼ӰŶʹйӰʼĴƬʱ
+</BODY></HTML> \ No newline at end of file
diff --git a/chrome/test/data/encoding_tests/auto_detect/iso-8859-1_with_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/iso-8859-1_with_no_encoding_specified.html
new file mode 100644
index 0000000..17571c9
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/iso-8859-1_with_no_encoding_specified.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.o rg/TR/1999/REC-html401-19991224/loose.dtd">
+<HTML lang=en-US xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
+<HEAD profile=http://www.w3.org/2000/08/w3c-synd/#>
+<TITLE>iso-8859-1</TITLE>
+</HEAD>
+<BODY>
+<H1 id=logo><IMG height=48 alt="The World Wide Web Consortium (W3C)" src="/Icons/w3c_main" width=315></H1>
+<H2 id=slogan>Leading the Web to Its Full Potential...</H2>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/chrome/test/data/encoding_tests/auto_detect/windows-1251_with_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/windows-1251_with_no_encoding_specified.html
new file mode 100644
index 0000000..436da4d
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/windows-1251_with_no_encoding_specified.html
@@ -0,0 +1,9 @@
+<HTML>
+ <HEAD>
+ <TITLE> windows-1251 </TITLE>
+ </HEAD>
+
+ <BODY>
+ , 9 - . . "", , - . ...
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/auto_detect/windows-1254_with_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/windows-1254_with_no_encoding_specified.html
new file mode 100644
index 0000000..6e7a9ee
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/windows-1254_with_no_encoding_specified.html
@@ -0,0 +1,9 @@
+<HTML>
+ <HEAD>
+ <TITLE> windows-1254 </TITLE>
+ </HEAD>
+
+ <BODY>
+ Arama yaplan en arpc adres, AK Parti Genel Merkezi'nin karsnda yer alan ve Atatrk Orman iftlii'nin snrlar iinde yer alan Saklbahe mesirelik alan. Polis ekipleri arama almalarn Saklbahe'nin 'emeba' mevkiinde younlatrld. ...
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/auto_detect/windows-1255_with_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/windows-1255_with_no_encoding_specified.html
new file mode 100644
index 0000000..ae33499
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/windows-1255_with_no_encoding_specified.html
@@ -0,0 +1,9 @@
+<HTML>
+ <HEAD>
+ <TITLE> windows-1255 </TITLE>
+ </HEAD>
+
+ <body dir="rtl">
+ , " : " . " ". " " " " - " (') , , " ...
+ </body>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/auto_detect/windows-1256_with_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/windows-1256_with_no_encoding_specified.html
new file mode 100644
index 0000000..1ec5a88
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/windows-1256_with_no_encoding_specified.html
@@ -0,0 +1,9 @@
+<HTML>
+ <HEAD>
+ <TITLE> windows-1256 </TITLE>
+ </HEAD>
+
+ <BODY dir="RTL">
+ // . " ɡ 16:20 " . " ...
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/auto_detect/windows-949_with_no_encoding_specified.html b/chrome/test/data/encoding_tests/auto_detect/windows-949_with_no_encoding_specified.html
new file mode 100644
index 0000000..33bdb87
--- /dev/null
+++ b/chrome/test/data/encoding_tests/auto_detect/windows-949_with_no_encoding_specified.html
@@ -0,0 +1,13 @@
+<HTML>
+ <HEAD>
+ <TITLE> windows-949 </TITLE>
+ </HEAD>
+
+ <BODY>
+ ѳ 2 ӽñȸ ȸ 'ȸ ¹' ϱ ߴ.
+
+ִ ׷ "ѳ ռ 'MBǹ' óϷ ؼ ġ ° ߴܵ ŷ ä ߴ ȣϰ ִ" ݹߴ.
+
+ä ̳ "ȸ »¿ õ ҡ 11 żϰ ϰ ö ϶" ߴ. "ȸ ִ ߵž , ҡ ִ ŭ Ҽ ̳ ϸ ϰ Ģ ó϶" ߴ. Ⱙ γ ǥ 12, ִ , γ ǿԴ 13 ⼮϶ ߼ߴ.
+ </BODY>
+</HTML>
diff --git a/chrome/test/data/encoding_tests/user_override/expected_gb18030_saved_from_iso88591_meta.html b/chrome/test/data/encoding_tests/user_override/expected_gb18030_saved_from_iso88591_meta.html
new file mode 100644
index 0000000..8c57b71
--- /dev/null
+++ b/chrome/test/data/encoding_tests/user_override/expected_gb18030_saved_from_iso88591_meta.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- saved from url=(0077)http://mock.http/encoding_tests/user_override/gb18030_with_iso88591_meta.html -->
+<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><META http-equiv="Content-Type" content="text/html; charset=gb18030">
+<TITLE>й3</TITLE>
+</HEAD><BODY>
+й3
+
+йƼŹ˾ܾ𾪵ĺ조йٶȡƶй̫ʱ
+
+ףƶͨ豸޹˾߼ʣΪйTD֮ΪTD׼龫ǣ2008ףӴ3GʢĻ
+
+ļŶ¾ϯǿҵֱʵչ۾ᡰ׵֮ȫںУйƷ
+
+Ļҵĺѡ2
+
+ݣŲҵ޹˾³ԽͳӡˢҵִITںϣڱӡˢ900ΪӡˢĹӮ˽ϣ
+
+ƽйӰŹ˾³ӡ޼Ͷ״ڡ÷ɺƽ쵼ӰŶʹйӰʼĴƬʱ
+</BODY></HTML> \ No newline at end of file
diff --git a/chrome/test/data/encoding_tests/user_override/gb18030_with_iso88591_meta.html b/chrome/test/data/encoding_tests/user_override/gb18030_with_iso88591_meta.html
new file mode 100644
index 0000000..f349d2b
--- /dev/null
+++ b/chrome/test/data/encoding_tests/user_override/gb18030_with_iso88591_meta.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- saved from url=(0023)http://www.sina.com.cn/ -->
+<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<TITLE>й3</TITLE>
+</HEAD>
+<BODY>
+й3
+
+йƼŹ˾ܾ𾪵ĺ조йٶȡƶй̫ʱ
+
+ףƶͨ豸޹˾߼ʣΪйTD֮ΪTD׼龫ǣ2008ףӴ3GʢĻ
+
+ļŶ¾ϯǿҵֱʵչ۾ᡰ׵֮ȫںУйƷ
+
+Ļҵĺѡ2
+
+ݣŲҵ޹˾³ԽͳӡˢҵִITںϣڱӡˢ900ΪӡˢĹӮ˽ϣ
+
+ƽйӰŹ˾³ӡ޼Ͷ״ڡ÷ɺƽ쵼ӰŶʹйӰʼĴƬʱ
+</BODY></HTML> \ No newline at end of file
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index aad49c9..4be37c3c 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -873,13 +873,20 @@ bool UITest::CloseBrowser(BrowserProxy* browser,
return result;
}
-GURL UITest::GetTestUrl(const std::wstring& test_directory,
- const std::wstring &test_case) {
+// Static
+FilePath UITest::GetTestFilePath(const std::wstring& test_directory,
+ const std::wstring& test_case) {
FilePath path;
PathService::Get(chrome::DIR_TEST_DATA, &path);
path = path.Append(FilePath::FromWStringHack(test_directory));
path = path.Append(FilePath::FromWStringHack(test_case));
- return net::FilePathToFileURL(path);
+ return path;
+}
+
+// Static
+GURL UITest::GetTestUrl(const std::wstring& test_directory,
+ const std::wstring &test_case) {
+ return net::FilePathToFileURL(GetTestFilePath(test_directory, test_case));
}
void UITest::WaitForFinish(const std::string &name,
@@ -1038,4 +1045,44 @@ FilePath UITest::ComputeTypicalUserDataSource(int profile_type) {
return source_history_file;
}
+void UITest::WaitForGeneratedFileAndCheck(const FilePath& generated_file,
+ const FilePath& original_file,
+ bool compare_files,
+ bool need_equal,
+ bool delete_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) {
+ if (exist) {
+ file_util::GetFileInfo(generated_file, &current);
+ if (current.size == previous.size)
+ break;
+ previous = current;
+ } else if (file_util::PathExists(generated_file)) {
+ file_util::GetFileInfo(generated_file, &previous);
+ exist = true;
+ }
+ PlatformThread::Sleep(sleep_timeout_ms());
+ }
+ EXPECT_TRUE(exist);
+
+ if (compare_files) {
+ // Check whether the generated file is equal with original file according to
+ // parameter: need_equal.
+ int64 generated_file_size = 0;
+ int64 original_file_size = 0;
+ EXPECT_TRUE(file_util::GetFileSize(generated_file, &generated_file_size));
+ EXPECT_TRUE(file_util::GetFileSize(original_file, &original_file_size));
+ if (need_equal) {
+ EXPECT_EQ(generated_file_size, original_file_size);
+ EXPECT_TRUE(file_util::ContentsEqual(generated_file, original_file));
+ } else {
+ EXPECT_NE(generated_file_size, original_file_size);
+ EXPECT_FALSE(file_util::ContentsEqual(generated_file, original_file));
+ }
+ }
+ if (delete_generated_file)
+ EXPECT_TRUE(file_util::DieFileDie(generated_file, false));
+}
diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h
index 0a7142f..b86f142 100644
--- a/chrome/test/ui/ui_test.h
+++ b/chrome/test/ui/ui_test.h
@@ -270,6 +270,17 @@ class UITest : public testing::Test {
// own the handle returned.
base::ProcessHandle process() { return process_; }
+ // Wait for |generated_file| to be ready and then compare it with
+ // |original_file| to see if they're identical or not if |compare_file| is
+ // true. If |need_equal| is true, they need to be identical. Otherwise,
+ // they should be different. This function will delete the generated file if
+ // the parameter |delete_generated_file| is true.
+ void WaitForGeneratedFileAndCheck(const FilePath& generated_file,
+ const FilePath& original_file,
+ bool compare_files,
+ bool need_equal,
+ bool delete_generated_file);
+
public:
// Get/Set a flag to run the renderer in process when running the
// tests.
@@ -393,9 +404,17 @@ class UITest : public testing::Test {
// error.
DictionaryValue* GetDefaultProfilePreferences();
+ // Generate the file path for testing a particular test.
+ // The file for the tests is all located in
+ // test_root_directory\test_directory\<testcase>
+ // The returned path is FilePath format.
+ static FilePath GetTestFilePath(const std::wstring& test_directory,
+ const std::wstring& test_case);
+
// Generate the URL for testing a particular test.
// HTML for the tests is all located in
// test_root_directory\test_directory\<testcase>
+ // The returned path is GURL format.
static GURL GetTestUrl(const std::wstring& test_directory,
const std::wstring &test_case);