| 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 <windows.h> | 5 #include <windows.h> |
| 6 #include <atlsecurity.h> | 6 #include <atlsecurity.h> |
| 7 #include <shellapi.h> | 7 #include <shellapi.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 return false; | 60 return false; |
| 61 } | 61 } |
| 62 | 62 |
| 63 base::FilePath path; | 63 base::FilePath path; |
| 64 if (!GetTestPath(test_case, &path)) { | 64 if (!GetTestPath(test_case, &path)) { |
| 65 NOTREACHED(); | 65 NOTREACHED(); |
| 66 return false; | 66 return false; |
| 67 } | 67 } |
| 68 | 68 |
| 69 std::string raw_data; | 69 std::string raw_data; |
| 70 file_util::ReadFileToString(path, &raw_data); | 70 base::ReadFileToString(path, &raw_data); |
| 71 | 71 |
| 72 // Convert to wide using the "best effort" assurance described in | 72 // Convert to wide using the "best effort" assurance described in |
| 73 // string_util.h | 73 // string_util.h |
| 74 data->assign(UTF8ToWide(raw_data)); | 74 data->assign(UTF8ToWide(raw_data)); |
| 75 return true; | 75 return true; |
| 76 } | 76 } |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 TEST_F(HtmlUtilUnittest, BasicTest) { | 79 TEST_F(HtmlUtilUnittest, BasicTest) { |
| 80 std::wstring test_data; | 80 std::wstring test_data; |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 "Content-Length: 42\r\n" | 494 "Content-Length: 42\r\n" |
| 495 "X-Frame-Options: SAMEORIGIN\r\n")); | 495 "X-Frame-Options: SAMEORIGIN\r\n")); |
| 496 EXPECT_TRUE(http_utils::HasFrameBustingHeader( | 496 EXPECT_TRUE(http_utils::HasFrameBustingHeader( |
| 497 "X-Frame-Options: deny\r\n" | 497 "X-Frame-Options: deny\r\n" |
| 498 "X-Frame-Options: ALLOWall\r\n" | 498 "X-Frame-Options: ALLOWall\r\n" |
| 499 "Content-Length: 42\r\n")); | 499 "Content-Length: 42\r\n")); |
| 500 EXPECT_TRUE(http_utils::HasFrameBustingHeader( | 500 EXPECT_TRUE(http_utils::HasFrameBustingHeader( |
| 501 "X-Frame-Options: SAMEORIGIN\r\n" | 501 "X-Frame-Options: SAMEORIGIN\r\n" |
| 502 "X-Frame-Options: ALLOWall\r\n")); | 502 "X-Frame-Options: ALLOWall\r\n")); |
| 503 } | 503 } |
| OLD | NEW |