| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |