OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // encoded following RFC 1521. | 107 // encoded following RFC 1521. |
108 const char* kBase64ZipEntry = | 108 const char* kBase64ZipEntry = |
109 "UEsDBBQAAAAAAMROi0K/wAzGBAAAAAQAAAADAAAAbW9vQ09XClBLAQIUAxQAAAAAAMROi0K/" | 109 "UEsDBBQAAAAAAMROi0K/wAzGBAAAAAQAAAADAAAAbW9vQ09XClBLAQIUAxQAAAAAAMROi0K/" |
110 "wAzG\nBAAAAAQAAAADAAAAAAAAAAAAAACggQAAAABtb29QSwUGAAAAAAEAAQAxAAAAJQAAAA" | 110 "wAzG\nBAAAAAQAAAADAAAAAAAAAAAAAACggQAAAABtb29QSwUGAAAAAAEAAQAxAAAAJQAAAA" |
111 "AA\n"; | 111 "AA\n"; |
112 params.SetString("file", kBase64ZipEntry); | 112 params.SetString("file", kBase64ZipEntry); |
113 Status status = ExecuteUploadFile(&session, params, &value); | 113 Status status = ExecuteUploadFile(&session, params, &value); |
114 ASSERT_EQ(kOk, status.code()) << status.message(); | 114 ASSERT_EQ(kOk, status.code()) << status.message(); |
115 base::FilePath::StringType path; | 115 base::FilePath::StringType path; |
116 ASSERT_TRUE(value->GetAsString(&path)); | 116 ASSERT_TRUE(value->GetAsString(&path)); |
117 ASSERT_TRUE(file_util::PathExists(base::FilePath(path))); | 117 ASSERT_TRUE(base::PathExists(base::FilePath(path))); |
118 std::string data; | 118 std::string data; |
119 ASSERT_TRUE(file_util::ReadFileToString(base::FilePath(path), &data)); | 119 ASSERT_TRUE(file_util::ReadFileToString(base::FilePath(path), &data)); |
120 ASSERT_STREQ("COW\n", data.c_str()); | 120 ASSERT_STREQ("COW\n", data.c_str()); |
121 } | 121 } |
OLD | NEW |