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

Side by Side Diff: chrome/browser/extensions/api/sync_file_system/sync_file_system_apitest.cc

Issue 12304015: Migrated sync_file_status, sync_action and sync_direction from fileapi:: namespace to sync_file_sys… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 10 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 (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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "chrome/browser/extensions/event_names.h" 9 #include "chrome/browser/extensions/event_names.h"
10 #include "chrome/browser/extensions/extension_apitest.h" 10 #include "chrome/browser/extensions/extension_apitest.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, OnFileStatusChanged) { 121 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, OnFileStatusChanged) {
122 // Mock a pending remote change to be synced. 122 // Mock a pending remote change to be synced.
123 GURL origin; 123 GURL origin;
124 EXPECT_CALL(*mock_remote_service(), RegisterOriginForTrackingChanges(_, _)) 124 EXPECT_CALL(*mock_remote_service(), RegisterOriginForTrackingChanges(_, _))
125 .WillOnce(UpdateRemoteChangeQueue(&origin, mock_remote_service())); 125 .WillOnce(UpdateRemoteChangeQueue(&origin, mock_remote_service()));
126 EXPECT_CALL(*mock_remote_service(), ProcessRemoteChange(_, _)) 126 EXPECT_CALL(*mock_remote_service(), ProcessRemoteChange(_, _))
127 .WillOnce(ReturnWithFakeFileAddedStatus( 127 .WillOnce(ReturnWithFakeFileAddedStatus(
128 &origin, 128 &origin,
129 mock_remote_service(), 129 mock_remote_service(),
130 fileapi::SYNC_FILE_STATUS_SYNCED, 130 sync_file_system::SYNC_FILE_STATUS_SYNCED,
131 fileapi::SYNC_ACTION_ADDED, 131 sync_file_system::SYNC_ACTION_ADDED,
132 fileapi::SYNC_DIRECTION_REMOTE_TO_LOCAL)); 132 sync_file_system::SYNC_DIRECTION_REMOTE_TO_LOCAL));
133 ASSERT_TRUE(RunPlatformAppTest("sync_file_system/on_file_status_changed")) 133 ASSERT_TRUE(RunPlatformAppTest("sync_file_system/on_file_status_changed"))
134 << message_; 134 << message_;
135 } 135 }
136 136
137 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, OnFileStatusChangedDeleted) { 137 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, OnFileStatusChangedDeleted) {
138 // Mock a pending remote change to be synced. 138 // Mock a pending remote change to be synced.
139 GURL origin; 139 GURL origin;
140 EXPECT_CALL(*mock_remote_service(), RegisterOriginForTrackingChanges(_, _)) 140 EXPECT_CALL(*mock_remote_service(), RegisterOriginForTrackingChanges(_, _))
141 .WillOnce(UpdateRemoteChangeQueue(&origin, mock_remote_service())); 141 .WillOnce(UpdateRemoteChangeQueue(&origin, mock_remote_service()));
142 EXPECT_CALL(*mock_remote_service(), ProcessRemoteChange(_, _)) 142 EXPECT_CALL(*mock_remote_service(), ProcessRemoteChange(_, _))
143 .WillOnce(ReturnWithFakeFileAddedStatus( 143 .WillOnce(ReturnWithFakeFileAddedStatus(
144 &origin, 144 &origin,
145 mock_remote_service(), 145 mock_remote_service(),
146 fileapi::SYNC_FILE_STATUS_SYNCED, 146 sync_file_system::SYNC_FILE_STATUS_SYNCED,
147 fileapi::SYNC_ACTION_DELETED, 147 sync_file_system::SYNC_ACTION_DELETED,
148 fileapi::SYNC_DIRECTION_REMOTE_TO_LOCAL)); 148 sync_file_system::SYNC_DIRECTION_REMOTE_TO_LOCAL));
149 ASSERT_TRUE(RunPlatformAppTest( 149 ASSERT_TRUE(RunPlatformAppTest(
150 "sync_file_system/on_file_status_changed_deleted")) 150 "sync_file_system/on_file_status_changed_deleted"))
151 << message_; 151 << message_;
152 } 152 }
153 153
154 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, OnServiceStatusChanged) { 154 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, OnServiceStatusChanged) {
155 EXPECT_CALL(*mock_remote_service(), RegisterOriginForTrackingChanges(_, _)) 155 EXPECT_CALL(*mock_remote_service(), RegisterOriginForTrackingChanges(_, _))
156 .WillOnce(NotifyOkStateAndCallback(mock_remote_service())); 156 .WillOnce(NotifyOkStateAndCallback(mock_remote_service()));
157 ASSERT_TRUE(RunPlatformAppTest("sync_file_system/on_service_status_changed")) 157 ASSERT_TRUE(RunPlatformAppTest("sync_file_system/on_service_status_changed"))
158 << message_; 158 << message_;
159 } 159 }
160 160
161 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, RequestFileSystem) { 161 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, RequestFileSystem) {
162 EXPECT_CALL(*mock_remote_service(), 162 EXPECT_CALL(*mock_remote_service(),
163 RegisterOriginForTrackingChanges(_, _)).Times(1); 163 RegisterOriginForTrackingChanges(_, _)).Times(1);
164 ASSERT_TRUE(RunPlatformAppTest("sync_file_system/request_file_system")) 164 ASSERT_TRUE(RunPlatformAppTest("sync_file_system/request_file_system"))
165 << message_; 165 << message_;
166 } 166 }
167 167
168 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, WriteFileThenGetUsage) { 168 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, WriteFileThenGetUsage) {
169 ASSERT_TRUE(RunPlatformAppTest("sync_file_system/write_file_then_get_usage")) 169 ASSERT_TRUE(RunPlatformAppTest("sync_file_system/write_file_then_get_usage"))
170 << message_; 170 << message_;
171 } 171 }
172 172
173 #endif // !defined(OS_CHROMEOS) 173 #endif // !defined(OS_CHROMEOS)
174 174
175 } // namespace chrome 175 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698