| 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/gdata_test_util.h" | 5 #include "chrome/browser/google_apis/gdata_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 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 bool posted_; | 36 bool posted_; |
| 37 DISALLOW_COPY_AND_ASSIGN(TaskObserver); | 37 DISALLOW_COPY_AND_ASSIGN(TaskObserver); |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 FilePath GetTestFilePath(const std::string& relative_path) { | 40 FilePath GetTestFilePath(const std::string& relative_path) { |
| 41 FilePath path; | 41 FilePath path; |
| 42 std::string error; | 42 std::string error; |
| 43 PathService::Get(chrome::DIR_TEST_DATA, &path); | 43 PathService::Get(chrome::DIR_TEST_DATA, &path); |
| 44 path = path.AppendASCII("chromeos") | 44 path = path.Append(FilePath::FromUTF8Unsafe(relative_path)); |
| 45 .Append(FilePath::FromUTF8Unsafe(relative_path)); | |
| 46 EXPECT_TRUE(file_util::PathExists(path)) << | 45 EXPECT_TRUE(file_util::PathExists(path)) << |
| 47 "Couldn't find " << path.value(); | 46 "Couldn't find " << path.value(); |
| 48 return path; | 47 return path; |
| 49 } | 48 } |
| 50 | 49 |
| 51 void RunBlockingPoolTask() { | 50 void RunBlockingPoolTask() { |
| 52 while (true) { | 51 while (true) { |
| 53 content::BrowserThread::GetBlockingPool()->FlushForTesting(); | 52 content::BrowserThread::GetBlockingPool()->FlushForTesting(); |
| 54 | 53 |
| 55 TaskObserver task_observer; | 54 TaskObserver task_observer; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 68 std::string error; | 67 std::string error; |
| 69 JSONFileValueSerializer serializer(path); | 68 JSONFileValueSerializer serializer(path); |
| 70 scoped_ptr<base::Value> value(serializer.Deserialize(NULL, &error)); | 69 scoped_ptr<base::Value> value(serializer.Deserialize(NULL, &error)); |
| 71 EXPECT_TRUE(value.get()) << | 70 EXPECT_TRUE(value.get()) << |
| 72 "Parse error " << path.value() << ": " << error; | 71 "Parse error " << path.value() << ": " << error; |
| 73 return value.Pass(); | 72 return value.Pass(); |
| 74 } | 73 } |
| 75 | 74 |
| 76 } // namespace test_util | 75 } // namespace test_util |
| 77 } // namespace google_apis | 76 } // namespace google_apis |
| OLD | NEW |