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/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 FilePath path = GetTestFilePath(relative_path); | 62 FilePath path = GetTestFilePath(relative_path); |
63 | 63 |
64 std::string error; | 64 std::string error; |
65 JSONFileValueSerializer serializer(path); | 65 JSONFileValueSerializer serializer(path); |
66 scoped_ptr<base::Value> value(serializer.Deserialize(NULL, &error)); | 66 scoped_ptr<base::Value> value(serializer.Deserialize(NULL, &error)); |
67 LOG_IF(WARNING, !value.get()) << "Failed to parse " << path.value() | 67 LOG_IF(WARNING, !value.get()) << "Failed to parse " << path.value() |
68 << ": " << error; | 68 << ": " << error; |
69 return value.Pass(); | 69 return value.Pass(); |
70 } | 70 } |
71 | 71 |
| 72 void CopyResultsFromGetDataCallback(GDataErrorCode* error_out, |
| 73 scoped_ptr<base::Value>* value_out, |
| 74 GDataErrorCode error_in, |
| 75 scoped_ptr<base::Value> value_in) { |
| 76 value_out->swap(value_in); |
| 77 *error_out = error_in; |
| 78 } |
| 79 |
72 } // namespace test_util | 80 } // namespace test_util |
73 } // namespace google_apis | 81 } // namespace google_apis |
OLD | NEW |