Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1015)

Side by Side Diff: chrome/browser/chromeos/drive/webkit_file_stream_reader_impl_unittest.cc

Issue 23625013: Remove drive::FileSystemInterface::Initialize(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chromeos/drive/file_system_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/webkit_file_stream_reader_impl.h" 5 #include "chrome/browser/chromeos/drive/webkit_file_stream_reader_impl.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/message_loop/message_loop.h"
13 #include "base/threading/thread.h" 12 #include "base/threading/thread.h"
14 #include "base/time/time.h" 13 #include "base/time/time.h"
15 #include "chrome/browser/chromeos/drive/fake_file_system.h" 14 #include "chrome/browser/chromeos/drive/fake_file_system.h"
16 #include "chrome/browser/chromeos/drive/file_system_interface.h" 15 #include "chrome/browser/chromeos/drive/file_system_interface.h"
17 #include "chrome/browser/chromeos/drive/file_system_util.h" 16 #include "chrome/browser/chromeos/drive/file_system_util.h"
18 #include "chrome/browser/chromeos/drive/test_util.h" 17 #include "chrome/browser/chromeos/drive/test_util.h"
19 #include "chrome/browser/drive/fake_drive_service.h" 18 #include "chrome/browser/drive/fake_drive_service.h"
20 #include "chrome/browser/google_apis/time_util.h" 19 #include "chrome/browser/google_apis/time_util.h"
21 #include "content/public/test/test_browser_thread_bundle.h" 20 #include "content/public/test/test_browser_thread_bundle.h"
22 #include "net/base/io_buffer.h" 21 #include "net/base/io_buffer.h"
(...skipping 11 matching lines...) Expand all
34 WebkitFileStreamReaderImplTest() 33 WebkitFileStreamReaderImplTest()
35 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) { 34 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) {
36 } 35 }
37 36
38 virtual void SetUp() OVERRIDE { 37 virtual void SetUp() OVERRIDE {
39 worker_thread_.reset(new base::Thread("WebkitFileStreamReaderImplTest")); 38 worker_thread_.reset(new base::Thread("WebkitFileStreamReaderImplTest"));
40 ASSERT_TRUE(worker_thread_->Start()); 39 ASSERT_TRUE(worker_thread_->Start());
41 40
42 // Initialize FakeDriveService. 41 // Initialize FakeDriveService.
43 fake_drive_service_.reset(new FakeDriveService); 42 fake_drive_service_.reset(new FakeDriveService);
44 fake_drive_service_->LoadResourceListForWapi( 43 ASSERT_TRUE(fake_drive_service_->LoadResourceListForWapi(
45 "gdata/root_feed.json"); 44 "gdata/root_feed.json"));
46 fake_drive_service_->LoadAccountMetadataForWapi( 45 ASSERT_TRUE(fake_drive_service_->LoadAccountMetadataForWapi(
47 "gdata/account_metadata.json"); 46 "gdata/account_metadata.json"));
48 47
49 // Create a testee instance. 48 // Create a testee instance.
50 fake_file_system_.reset( 49 fake_file_system_.reset(
51 new test_util::FakeFileSystem(fake_drive_service_.get())); 50 new test_util::FakeFileSystem(fake_drive_service_.get()));
52 fake_file_system_->Initialize();
53 } 51 }
54 52
55 FileSystemInterface* GetFileSystem() { 53 FileSystemInterface* GetFileSystem() {
56 return fake_file_system_.get(); 54 return fake_file_system_.get();
57 } 55 }
58 56
59 DriveFileStreamReader::FileSystemGetter GetFileSystemGetter() { 57 DriveFileStreamReader::FileSystemGetter GetFileSystemGetter() {
60 return base::Bind(&WebkitFileStreamReaderImplTest::GetFileSystem, 58 return base::Bind(&WebkitFileStreamReaderImplTest::GetFileSystem,
61 base::Unretained(this)); 59 base::Unretained(this));
62 } 60 }
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 base::Time::FromInternalValue(1))); 199 base::Time::FromInternalValue(1)));
202 200
203 net::TestInt64CompletionCallback callback; 201 net::TestInt64CompletionCallback callback;
204 int64 result = reader->GetLength(callback.callback()); 202 int64 result = reader->GetLength(callback.callback());
205 result = callback.GetResult(result); 203 result = callback.GetResult(result);
206 EXPECT_EQ(net::ERR_UPLOAD_FILE_CHANGED, result); 204 EXPECT_EQ(net::ERR_UPLOAD_FILE_CHANGED, result);
207 } 205 }
208 206
209 } // namespace internal 207 } // namespace internal
210 } // namespace drive 208 } // namespace drive
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drive/file_system_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698