| 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 #include <string> | 4 #include <string> |
| 5 | 5 |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/scoped_temp_dir.h" | 7 #include "base/scoped_temp_dir.h" |
| 8 #include "chrome/browser/net/url_request_mock_http_job.h" | 8 #include "chrome/browser/net/url_request_mock_http_job.h" |
| 9 #include "chrome/browser/download/save_package.h" | 9 #include "chrome/browser/download/save_package.h" |
| 10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 std::string encoding; | 108 std::string encoding; |
| 109 EXPECT_TRUE(tab_proxy->GetPageCurrentEncoding(&encoding)); | 109 EXPECT_TRUE(tab_proxy->GetPageCurrentEncoding(&encoding)); |
| 110 EXPECT_EQ(encoding, kEncodingTestDatas[i].encoding_name); | 110 EXPECT_EQ(encoding, kEncodingTestDatas[i].encoding_name); |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| 114 #if defined(OS_WIN) | 114 #if defined(OS_WIN) |
| 115 // We are disabling this test on MacOS and Linux because on those platforms | 115 // We are disabling this test on MacOS and Linux because on those platforms |
| 116 // AutomationProvider::OverrideEncoding is not implemented yet. | 116 // AutomationProvider::OverrideEncoding is not implemented yet. |
| 117 // TODO(port): Enable when encoding-related parts of Browser are ported. | 117 // TODO(port): Enable when encoding-related parts of Browser are ported. |
| 118 TEST_F(BrowserEncodingTest, TestOverrideEncoding) { | 118 TEST_F(BrowserEncodingTest, DISABLED_TestOverrideEncoding) { |
| 119 const char* const kTestFileName = "gb18030_with_iso88591_meta.html"; | 119 const char* const kTestFileName = "gb18030_with_iso88591_meta.html"; |
| 120 const char* const kExpectedFileName = | 120 const char* const kExpectedFileName = |
| 121 "expected_gb18030_saved_from_iso88591_meta.html"; | 121 "expected_gb18030_saved_from_iso88591_meta.html"; |
| 122 const char* const kOverrideTestDir = "user_override"; | 122 const char* const kOverrideTestDir = "user_override"; |
| 123 | 123 |
| 124 FilePath test_dir_path = FilePath(kTestDir).AppendASCII(kOverrideTestDir); | 124 FilePath test_dir_path = FilePath(kTestDir).AppendASCII(kOverrideTestDir); |
| 125 test_dir_path = test_dir_path.AppendASCII(kTestFileName); | 125 test_dir_path = test_dir_path.AppendASCII(kTestFileName); |
| 126 GURL url = URLRequestMockHTTPJob::GetMockUrl(test_dir_path.ToWStringHack()); | 126 GURL url = URLRequestMockHTTPJob::GetMockUrl(test_dir_path.ToWStringHack()); |
| 127 scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); | 127 scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); |
| 128 ASSERT_TRUE(tab_proxy.get()); | 128 ASSERT_TRUE(tab_proxy.get()); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 kExpectedResultDir); | 290 kExpectedResultDir); |
| 291 expected_result_file_name = expected_result_file_name.AppendASCII( | 291 expected_result_file_name = expected_result_file_name.AppendASCII( |
| 292 kTestDatas[i].expected_result); | 292 kTestDatas[i].expected_result); |
| 293 EXPECT_TRUE(tab->SavePage(full_saved_file_name.ToWStringHack(), | 293 EXPECT_TRUE(tab->SavePage(full_saved_file_name.ToWStringHack(), |
| 294 temp_sub_resource_dir_.ToWStringHack(), | 294 temp_sub_resource_dir_.ToWStringHack(), |
| 295 SavePackage::SAVE_AS_COMPLETE_HTML)); | 295 SavePackage::SAVE_AS_COMPLETE_HTML)); |
| 296 EXPECT_TRUE(WaitForDownloadShelfVisible(browser.get())); | 296 EXPECT_TRUE(WaitForDownloadShelfVisible(browser.get())); |
| 297 CheckFile(full_saved_file_name, expected_result_file_name, true); | 297 CheckFile(full_saved_file_name, expected_result_file_name, true); |
| 298 } | 298 } |
| 299 } | 299 } |
| OLD | NEW |