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/change_list_processor.h" | 5 #include "chrome/browser/chromeos/drive/change_list_processor.h" |
6 | 6 |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/chromeos/drive/drive.pb.h" | 10 #include "chrome/browser/chromeos/drive/drive.pb.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 std::string parent_id; | 36 std::string parent_id; |
37 FileOrDirectory type; | 37 FileOrDirectory type; |
38 }; | 38 }; |
39 | 39 |
40 class ChangeListProcessorTest : public testing::Test { | 40 class ChangeListProcessorTest : public testing::Test { |
41 protected: | 41 protected: |
42 virtual void SetUp() OVERRIDE { | 42 virtual void SetUp() OVERRIDE { |
43 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 43 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
44 | 44 |
45 metadata_storage_.reset(new ResourceMetadataStorage( | 45 metadata_storage_.reset(new ResourceMetadataStorage( |
46 temp_dir_.path(), base::MessageLoopProxy::current())); | 46 temp_dir_.path(), base::MessageLoopProxy::current().get())); |
47 ASSERT_TRUE(metadata_storage_->Initialize()); | 47 ASSERT_TRUE(metadata_storage_->Initialize()); |
48 | 48 |
49 metadata_.reset(new internal::ResourceMetadata( | 49 metadata_.reset(new internal::ResourceMetadata( |
50 metadata_storage_.get(), base::MessageLoopProxy::current())); | 50 metadata_storage_.get(), base::MessageLoopProxy::current())); |
51 ASSERT_EQ(FILE_ERROR_OK, metadata_->Initialize()); | 51 ASSERT_EQ(FILE_ERROR_OK, metadata_->Initialize()); |
52 } | 52 } |
53 | 53 |
54 // Parses a json file at |test_data_path| relative to Chrome test directory | 54 // Parses a json file at |test_data_path| relative to Chrome test directory |
55 // into a ScopedVector<drive::internal::ChangeList>. | 55 // into a ScopedVector<drive::internal::ChangeList>. |
56 ScopedVector<ChangeList> ParseChangeList(const std::string& test_data_path) { | 56 ScopedVector<ChangeList> ParseChangeList(const std::string& test_data_path) { |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 | 449 |
450 // The value is written in kTestJson. | 450 // The value is written in kTestJson. |
451 EXPECT_EQ(16730, metadata_->GetLargestChangestamp()); | 451 EXPECT_EQ(16730, metadata_->GetLargestChangestamp()); |
452 EXPECT_FALSE(GetResourceEntry("drive/root/New Directory/new_pdf_file.pdf")); | 452 EXPECT_FALSE(GetResourceEntry("drive/root/New Directory/new_pdf_file.pdf")); |
453 | 453 |
454 EXPECT_TRUE(changed_dirs.empty()); | 454 EXPECT_TRUE(changed_dirs.empty()); |
455 } | 455 } |
456 | 456 |
457 } // namespace internal | 457 } // namespace internal |
458 } // namespace drive | 458 } // namespace drive |
OLD | NEW |