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

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

Issue 18308004: Update CrOS to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased 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
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_loader.h" 5 #include "chrome/browser/chromeos/drive/change_list_loader.h"
6 6
7 #include "base/files/scoped_temp_dir.h" 7 #include "base/files/scoped_temp_dir.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "chrome/browser/chromeos/drive/change_list_loader_observer.h" 10 #include "chrome/browser/chromeos/drive/change_list_loader_observer.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 virtual void SetUp() OVERRIDE { 70 virtual void SetUp() OVERRIDE {
71 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 71 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
72 profile_.reset(new TestingProfile); 72 profile_.reset(new TestingProfile);
73 73
74 drive_service_.reset(new FakeDriveService); 74 drive_service_.reset(new FakeDriveService);
75 ASSERT_TRUE(drive_service_->LoadResourceListForWapi( 75 ASSERT_TRUE(drive_service_->LoadResourceListForWapi(
76 "gdata/root_feed.json")); 76 "gdata/root_feed.json"));
77 ASSERT_TRUE(drive_service_->LoadAccountMetadataForWapi( 77 ASSERT_TRUE(drive_service_->LoadAccountMetadataForWapi(
78 "gdata/account_metadata.json")); 78 "gdata/account_metadata.json"));
79 79
80 scheduler_.reset(new JobScheduler(profile_.get(), drive_service_.get(), 80 scheduler_.reset(new JobScheduler(profile_.get(),
81 base::MessageLoopProxy::current())); 81 drive_service_.get(),
82 base::MessageLoopProxy::current().get()));
82 metadata_storage_.reset(new ResourceMetadataStorage( 83 metadata_storage_.reset(new ResourceMetadataStorage(
83 temp_dir_.path(), base::MessageLoopProxy::current())); 84 temp_dir_.path(), base::MessageLoopProxy::current().get()));
84 ASSERT_TRUE(metadata_storage_->Initialize()); 85 ASSERT_TRUE(metadata_storage_->Initialize());
85 86
86 metadata_.reset(new ResourceMetadata(metadata_storage_.get(), 87 metadata_.reset(new ResourceMetadata(
87 base::MessageLoopProxy::current())); 88 metadata_storage_.get(), base::MessageLoopProxy::current().get()));
88 ASSERT_EQ(FILE_ERROR_OK, metadata_->Initialize()); 89 ASSERT_EQ(FILE_ERROR_OK, metadata_->Initialize());
89 90
90 cache_.reset(new FileCache(metadata_storage_.get(), 91 cache_.reset(new FileCache(metadata_storage_.get(),
91 temp_dir_.path(), 92 temp_dir_.path(),
92 base::MessageLoopProxy::current(), 93 base::MessageLoopProxy::current().get(),
93 NULL /* free_disk_space_getter */)); 94 NULL /* free_disk_space_getter */));
94 ASSERT_TRUE(cache_->Initialize()); 95 ASSERT_TRUE(cache_->Initialize());
95 96
96 change_list_loader_.reset(new ChangeListLoader( 97 change_list_loader_.reset(
97 base::MessageLoopProxy::current(), metadata_.get(), scheduler_.get())); 98 new ChangeListLoader(base::MessageLoopProxy::current().get(),
99 metadata_.get(),
100 scheduler_.get()));
98 } 101 }
99 102
100 content::TestBrowserThreadBundle thread_bundle_; 103 content::TestBrowserThreadBundle thread_bundle_;
101 base::ScopedTempDir temp_dir_; 104 base::ScopedTempDir temp_dir_;
102 scoped_ptr<TestingProfile> profile_; 105 scoped_ptr<TestingProfile> profile_;
103 scoped_ptr<FakeDriveService> drive_service_; 106 scoped_ptr<FakeDriveService> drive_service_;
104 scoped_ptr<JobScheduler> scheduler_; 107 scoped_ptr<JobScheduler> scheduler_;
105 scoped_ptr<ResourceMetadataStorage, 108 scoped_ptr<ResourceMetadataStorage,
106 test_util::DestroyHelperForTests> metadata_storage_; 109 test_util::DestroyHelperForTests> metadata_storage_;
107 scoped_ptr<ResourceMetadata, test_util::DestroyHelperForTests> metadata_; 110 scoped_ptr<ResourceMetadata, test_util::DestroyHelperForTests> metadata_;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 EXPECT_EQ(FILE_ERROR_OK, error); 145 EXPECT_EQ(FILE_ERROR_OK, error);
143 146
144 EXPECT_FALSE(change_list_loader_->IsRefreshing()); 147 EXPECT_FALSE(change_list_loader_->IsRefreshing());
145 EXPECT_EQ(previous_changestamp, metadata_->GetLargestChangestamp()); 148 EXPECT_EQ(previous_changestamp, metadata_->GetLargestChangestamp());
146 EXPECT_EQ(previous_resource_list_load_count, 149 EXPECT_EQ(previous_resource_list_load_count,
147 drive_service_->resource_list_load_count()); 150 drive_service_->resource_list_load_count());
148 } 151 }
149 152
150 } // namespace internal 153 } // namespace internal
151 } // namespace drive 154 } // namespace drive
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/camera_detector.cc ('k') | chrome/browser/chromeos/drive/change_list_processor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698