| 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 <set> | 5 #include <set> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/base64.h" | 8 #include "base/base64.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 // file with the contents "COW\n". | 34 // file with the contents "COW\n". |
| 35 const char* kBase64ZipEntry = | 35 const char* kBase64ZipEntry = |
| 36 "UEsDBBQACAAIAJpyXEAAAAAAAAAAAAAAAAAEAAAAdGVzdHP2D+" | 36 "UEsDBBQACAAIAJpyXEAAAAAAAAAAAAAAAAAEAAAAdGVzdHP2D+" |
| 37 "cCAFBLBwi/wAzGBgAAAAQAAAA="; | 37 "cCAFBLBwi/wAzGBgAAAAQAAAA="; |
| 38 ASSERT_TRUE(base::Base64Decode(kBase64ZipEntry, &data)); | 38 ASSERT_TRUE(base::Base64Decode(kBase64ZipEntry, &data)); |
| 39 base::FilePath file; | 39 base::FilePath file; |
| 40 std::string error_msg; | 40 std::string error_msg; |
| 41 ASSERT_TRUE(UnzipSoleFile(temp_dir.path(), data, &file, &error_msg)) | 41 ASSERT_TRUE(UnzipSoleFile(temp_dir.path(), data, &file, &error_msg)) |
| 42 << error_msg; | 42 << error_msg; |
| 43 std::string contents; | 43 std::string contents; |
| 44 ASSERT_TRUE(file_util::ReadFileToString(file, &contents)); | 44 ASSERT_TRUE(base::ReadFileToString(file, &contents)); |
| 45 ASSERT_STREQ("COW\n", contents.c_str()); | 45 ASSERT_STREQ("COW\n", contents.c_str()); |
| 46 } | 46 } |
| 47 | 47 |
| 48 } // namespace webdriver | 48 } // namespace webdriver |
| OLD | NEW |