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/browser/google_apis/test_util.h" | 5 #include "chrome/browser/google_apis/test_util.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/json/json_file_value_serializer.h" | 8 #include "base/json/json_file_value_serializer.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 base::FilePath path = GetTestFilePath(relative_path); | 94 base::FilePath path = GetTestFilePath(relative_path); |
95 | 95 |
96 std::string error; | 96 std::string error; |
97 JSONFileValueSerializer serializer(path); | 97 JSONFileValueSerializer serializer(path); |
98 scoped_ptr<base::Value> value(serializer.Deserialize(NULL, &error)); | 98 scoped_ptr<base::Value> value(serializer.Deserialize(NULL, &error)); |
99 LOG_IF(WARNING, !value.get()) << "Failed to parse " << path.value() | 99 LOG_IF(WARNING, !value.get()) << "Failed to parse " << path.value() |
100 << ": " << error; | 100 << ": " << error; |
101 return value.Pass(); | 101 return value.Pass(); |
102 } | 102 } |
103 | 103 |
104 void CopyResultsFromDownloadActionCallback( | |
105 GDataErrorCode* error_out, | |
106 base::FilePath* temp_file_out, | |
107 GDataErrorCode error_in, | |
108 const base::FilePath& temp_file_in) { | |
109 *error_out = error_in; | |
110 *temp_file_out = temp_file_in; | |
111 } | |
112 | |
113 void CopyResultsFromInitiateUploadCallback( | 104 void CopyResultsFromInitiateUploadCallback( |
114 GDataErrorCode* error_out, | 105 GDataErrorCode* error_out, |
115 GURL* url_out, | 106 GURL* url_out, |
116 GDataErrorCode error_in, | 107 GDataErrorCode error_in, |
117 const GURL& url_in) { | 108 const GURL& url_in) { |
118 *error_out = error_in; | 109 *error_out = error_in; |
119 *url_out = url_in; | 110 *url_out = url_in; |
120 } | 111 } |
121 | 112 |
122 void CopyResultsFromInitiateUploadCallbackAndQuit( | 113 void CopyResultsFromInitiateUploadCallbackAndQuit( |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 base::SplitString(range, '-', &parts); | 218 base::SplitString(range, '-', &parts); |
228 if (parts.size() != 2U) | 219 if (parts.size() != 2U) |
229 return false; | 220 return false; |
230 | 221 |
231 return (base::StringToInt64(parts[0], start_position) && | 222 return (base::StringToInt64(parts[0], start_position) && |
232 base::StringToInt64(parts[1], end_position)); | 223 base::StringToInt64(parts[1], end_position)); |
233 } | 224 } |
234 | 225 |
235 } // namespace test_util | 226 } // namespace test_util |
236 } // namespace google_apis | 227 } // namespace google_apis |
OLD | NEW |