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

Side by Side Diff: chrome/browser/sync_file_system/drive_file_sync_client_unittest.cc

Issue 11414253: DriveFileSyncService listens to OnAuthenticated event to recover from unavailable state (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix broken tests... Created 8 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/sync_file_system/drive_file_sync_client.h" 5 #include "chrome/browser/sync_file_system/drive_file_sync_client.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "chrome/browser/google_apis/drive_uploader.h" 10 #include "chrome/browser/google_apis/drive_uploader.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 DriveFileSyncClientTest() 129 DriveFileSyncClientTest()
130 : mock_drive_service_(NULL), 130 : mock_drive_service_(NULL),
131 fake_drive_uploader_(NULL) { 131 fake_drive_uploader_(NULL) {
132 } 132 }
133 133
134 virtual void SetUp() OVERRIDE { 134 virtual void SetUp() OVERRIDE {
135 mock_drive_service_ = new StrictMock<MockDriveService>; 135 mock_drive_service_ = new StrictMock<MockDriveService>;
136 fake_drive_uploader_ = new FakeDriveUploader; 136 fake_drive_uploader_ = new FakeDriveUploader;
137 137
138 EXPECT_CALL(*mock_drive_service_, Initialize(&profile_)).Times(1); 138 EXPECT_CALL(*mock_drive_service_, Initialize(&profile_)).Times(1);
139 EXPECT_CALL(*mock_drive_service_, AddObserver(_));
139 140
140 sync_client_ = DriveFileSyncClient::CreateForTesting( 141 sync_client_ = DriveFileSyncClient::CreateForTesting(
141 &profile_, 142 &profile_,
142 scoped_ptr<DriveServiceInterface>(mock_drive_service_), 143 scoped_ptr<DriveServiceInterface>(mock_drive_service_),
143 scoped_ptr<DriveUploaderInterface>(fake_drive_uploader_)).Pass(); 144 scoped_ptr<DriveUploaderInterface>(fake_drive_uploader_)).Pass();
144 } 145 }
145 146
146 virtual void TearDown() OVERRIDE { 147 virtual void TearDown() OVERRIDE {
148 EXPECT_CALL(*mock_drive_service_, RemoveObserver(_));
147 EXPECT_CALL(*mock_drive_service(), CancelAll()); 149 EXPECT_CALL(*mock_drive_service(), CancelAll());
148 sync_client_.reset(); 150 sync_client_.reset();
149 } 151 }
150 152
151 protected: 153 protected:
152 DriveFileSyncClient* sync_client() { return sync_client_.get(); } 154 DriveFileSyncClient* sync_client() { return sync_client_.get(); }
153 155
154 std::string FormatTitleQuery(const std::string& title) { 156 std::string FormatTitleQuery(const std::string& title) {
155 return DriveFileSyncClient::FormatTitleQuery(title); 157 return DriveFileSyncClient::FormatTitleQuery(title);
156 } 158 }
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 base::Bind(&DidDeleteFile, &done, &error)); 840 base::Bind(&DidDeleteFile, &done, &error));
839 message_loop()->RunUntilIdle(); 841 message_loop()->RunUntilIdle();
840 842
841 EXPECT_TRUE(done); 843 EXPECT_TRUE(done);
842 EXPECT_EQ(google_apis::HTTP_CONFLICT, error); 844 EXPECT_EQ(google_apis::HTTP_CONFLICT, error);
843 } 845 }
844 846
845 #endif // !defined(OS_ANDROID) 847 #endif // !defined(OS_ANDROID)
846 848
847 } // namespace sync_file_system 849 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698