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

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

Issue 18419004: Remove destruction-only TearDown() methods in Drive related test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fix Created 7 years, 5 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 | « no previous file | chrome/browser/chromeos/drive/drive_app_registry_unittest.cc » ('j') | 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/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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
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()));
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 virtual void TearDown() OVERRIDE {
55 metadata_.reset();
56 }
57
58 // 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
59 // into a ScopedVector<drive::internal::ChangeList>. 55 // into a ScopedVector<drive::internal::ChangeList>.
60 ScopedVector<ChangeList> ParseChangeList(const std::string& test_data_path) { 56 ScopedVector<ChangeList> ParseChangeList(const std::string& test_data_path) {
61 ScopedVector<ChangeList> changes; 57 ScopedVector<ChangeList> changes;
62 changes.push_back(new ChangeList( 58 changes.push_back(new ChangeList(
63 *google_apis::ResourceList::ExtractAndParse( 59 *google_apis::ResourceList::ExtractAndParse(
64 *google_apis::test_util::LoadJSONFile( 60 *google_apis::test_util::LoadJSONFile(
65 test_data_path)))); 61 test_data_path))));
66 return changes.Pass(); 62 return changes.Pass();
67 } 63 }
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 449
454 // The value is written in kTestJson. 450 // The value is written in kTestJson.
455 EXPECT_EQ(16730, metadata_->GetLargestChangestamp()); 451 EXPECT_EQ(16730, metadata_->GetLargestChangestamp());
456 EXPECT_FALSE(GetResourceEntry("drive/root/New Directory/new_pdf_file.pdf")); 452 EXPECT_FALSE(GetResourceEntry("drive/root/New Directory/new_pdf_file.pdf"));
457 453
458 EXPECT_TRUE(changed_dirs.empty()); 454 EXPECT_TRUE(changed_dirs.empty());
459 } 455 }
460 456
461 } // namespace internal 457 } // namespace internal
462 } // namespace drive 458 } // namespace drive
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/drive_app_registry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698