OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/chromeos/drive/fake_file_system.h" | 5 #include "chrome/browser/chromeos/drive/fake_file_system.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "chrome/browser/chromeos/drive/file_system_util.h" | 9 #include "chrome/browser/chromeos/drive/file_system_util.h" |
10 #include "chrome/browser/drive/fake_drive_service.h" | 10 #include "chrome/browser/drive/fake_drive_service.h" |
11 #include "chrome/browser/google_apis/test_util.h" | 11 #include "chrome/browser/google_apis/test_util.h" |
12 #include "content/public/test/test_browser_thread_bundle.h" | 12 #include "content/public/test/test_browser_thread_bundle.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 namespace drive { | 15 namespace drive { |
16 namespace test_util { | 16 namespace test_util { |
17 | 17 |
18 class FakeFileSystemTest : public ::testing::Test { | 18 class FakeFileSystemTest : public ::testing::Test { |
19 protected: | 19 protected: |
20 virtual void SetUp() OVERRIDE { | 20 virtual void SetUp() OVERRIDE { |
21 // Initialize FakeDriveService. | 21 // Initialize FakeDriveService. |
22 fake_drive_service_.reset(new FakeDriveService); | 22 fake_drive_service_.reset(new FakeDriveService); |
23 fake_drive_service_->LoadResourceListForWapi( | 23 fake_drive_service_->LoadResourceListForWapi( |
24 "chromeos/gdata/root_feed.json"); | 24 "gdata/root_feed.json"); |
25 fake_drive_service_->LoadAccountMetadataForWapi( | 25 fake_drive_service_->LoadAccountMetadataForWapi( |
26 "chromeos/gdata/account_metadata.json"); | 26 "gdata/account_metadata.json"); |
27 | 27 |
28 // Create a testee instance. | 28 // Create a testee instance. |
29 fake_file_system_.reset(new FakeFileSystem(fake_drive_service_.get())); | 29 fake_file_system_.reset(new FakeFileSystem(fake_drive_service_.get())); |
30 ASSERT_TRUE(fake_file_system_->InitializeForTesting()); | 30 ASSERT_TRUE(fake_file_system_->InitializeForTesting()); |
31 } | 31 } |
32 | 32 |
33 content::TestBrowserThreadBundle thread_bundle_; | 33 content::TestBrowserThreadBundle thread_bundle_; |
34 scoped_ptr<FakeDriveService> fake_drive_service_; | 34 scoped_ptr<FakeDriveService> fake_drive_service_; |
35 scoped_ptr<FakeFileSystem> fake_file_system_; | 35 scoped_ptr<FakeFileSystem> fake_file_system_; |
36 }; | 36 }; |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 util::GetDriveMyDriveRootPath().AppendASCII("Invalid File Name"), | 167 util::GetDriveMyDriveRootPath().AppendASCII("Invalid File Name"), |
168 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); | 168 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); |
169 base::RunLoop().RunUntilIdle(); | 169 base::RunLoop().RunUntilIdle(); |
170 | 170 |
171 ASSERT_EQ(FILE_ERROR_NOT_FOUND, error); | 171 ASSERT_EQ(FILE_ERROR_NOT_FOUND, error); |
172 ASSERT_FALSE(entry); | 172 ASSERT_FALSE(entry); |
173 } | 173 } |
174 | 174 |
175 } // namespace test_util | 175 } // namespace test_util |
176 } // namespace drive | 176 } // namespace drive |
OLD | NEW |