| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_frame/test/test_with_web_server.h" | 5 #include "chrome_frame/test/test_with_web_server.h" |
| 6 | 6 |
| 7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
| 10 #include "base/files/memory_mapped_file.h" | 10 #include "base/files/memory_mapped_file.h" |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 size_t query_index = request_uri.find(L"?"); | 392 size_t query_index = request_uri.find(L"?"); |
| 393 if (query_index != std::string::npos) { | 393 if (query_index != std::string::npos) { |
| 394 path = path.erase(query_index); | 394 path = path.erase(query_index); |
| 395 } | 395 } |
| 396 base::FilePath file_path = root_dir_; | 396 base::FilePath file_path = root_dir_; |
| 397 if (path.size()) | 397 if (path.size()) |
| 398 file_path = file_path.Append(path.substr(1)); // remove first '/' | 398 file_path = file_path.Append(path.substr(1)); // remove first '/' |
| 399 | 399 |
| 400 std::string headers, body; | 400 std::string headers, body; |
| 401 std::string content_type; | 401 std::string content_type; |
| 402 if (file_util::PathExists(file_path) && | 402 if (base::PathExists(file_path) && |
| 403 !file_util::DirectoryExists(file_path)) { | 403 !file_util::DirectoryExists(file_path)) { |
| 404 base::FilePath mock_http_headers(file_path.value() + L".mock-http-headers"); | 404 base::FilePath mock_http_headers(file_path.value() + L".mock-http-headers"); |
| 405 if (file_util::PathExists(mock_http_headers)) { | 405 if (base::PathExists(mock_http_headers)) { |
| 406 headers = GetMockHttpHeaders(mock_http_headers); | 406 headers = GetMockHttpHeaders(mock_http_headers); |
| 407 content_type = http_utils::GetHttpHeaderFromHeaderList("Content-type", | 407 content_type = http_utils::GetHttpHeaderFromHeaderList("Content-type", |
| 408 headers); | 408 headers); |
| 409 } else { | 409 } else { |
| 410 EXPECT_TRUE(net::GetMimeTypeFromFile(file_path, &content_type)); | 410 EXPECT_TRUE(net::GetMimeTypeFromFile(file_path, &content_type)); |
| 411 VLOG(1) << "Going to send file (" << WideToUTF8(file_path.value()) | 411 VLOG(1) << "Going to send file (" << WideToUTF8(file_path.value()) |
| 412 << ") with content type (" << content_type << ")"; | 412 << ") with content type (" << content_type << ")"; |
| 413 headers = CreateHttpHeaders(invocation, add_no_cache_header, | 413 headers = CreateHttpHeaders(invocation, add_no_cache_header, |
| 414 content_type); | 414 content_type); |
| 415 } | 415 } |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 // This test loads a large page and ensures that the full page contents are | 1090 // This test loads a large page and ensures that the full page contents are |
| 1091 // actually loaded via a self-validating HTML page. This is done due to a bug | 1091 // actually loaded via a self-validating HTML page. This is done due to a bug |
| 1092 // whereby the middle of the response stream would sometimes be truncated when | 1092 // whereby the middle of the response stream would sometimes be truncated when |
| 1093 // loading a CF document. See http://crbug.com/178421 for details. | 1093 // loading a CF document. See http://crbug.com/178421 for details. |
| 1094 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_LargePageLoad) { | 1094 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_LargePageLoad) { |
| 1095 const wchar_t kLargePageLoadPage[] = | 1095 const wchar_t kLargePageLoadPage[] = |
| 1096 L"chrome_frame_large_page.html"; | 1096 L"chrome_frame_large_page.html"; |
| 1097 | 1097 |
| 1098 SimpleBrowserTest(IE, kLargePageLoadPage); | 1098 SimpleBrowserTest(IE, kLargePageLoadPage); |
| 1099 } | 1099 } |
| OLD | NEW |