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/command_line.h" | 6 #include "base/command_line.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/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
10 #include "chrome/browser/sync_file_system/drive_backend_v1/drive_file_sync_servi
ce.h" | 10 #include "chrome/browser/sync_file_system/drive_backend_v1/drive_file_sync_servi
ce.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 FROM_HERE, base::Bind(arg0, | 107 FROM_HERE, base::Bind(arg0, |
108 sync_file_system::SYNC_STATUS_OK, | 108 sync_file_system::SYNC_STATUS_OK, |
109 mock_url)); | 109 mock_url)); |
110 mock_remote_service->NotifyFileStatusChanged( | 110 mock_remote_service->NotifyFileStatusChanged( |
111 mock_url, sync_direction, sync_file_status, sync_action_taken); | 111 mock_url, sync_direction, sync_file_status, sync_action_taken); |
112 } | 112 } |
113 | 113 |
114 } // namespace | 114 } // namespace |
115 | 115 |
116 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, GetFileStatus) { | 116 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, GetFileStatus) { |
117 EXPECT_CALL(*mock_remote_service(), IsConflicting(_)).WillOnce(Return(true)); | |
118 ASSERT_TRUE(RunPlatformAppTest("sync_file_system/get_file_status")) | 117 ASSERT_TRUE(RunPlatformAppTest("sync_file_system/get_file_status")) |
119 << message_; | 118 << message_; |
120 } | 119 } |
121 | 120 |
122 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, GetFileStatuses) { | 121 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, GetFileStatuses) { |
123 // Mocking to return IsConflicting() == true only for the path "Conflicting". | 122 // Mocking to return IsConflicting() == true only for the path "Conflicting". |
124 base::FilePath conflicting = base::FilePath::FromUTF8Unsafe("Conflicting"); | 123 base::FilePath conflicting = base::FilePath::FromUTF8Unsafe("Conflicting"); |
125 EXPECT_CALL(*mock_remote_service(), | |
126 IsConflicting(Property(&FileSystemURL::path, Eq(conflicting)))) | |
127 .WillOnce(Return(true)); | |
128 EXPECT_CALL(*mock_remote_service(), | |
129 IsConflicting(Property(&FileSystemURL::path, Ne(conflicting)))) | |
130 .WillRepeatedly(Return(false)); | |
131 | |
132 ASSERT_TRUE(RunPlatformAppTest("sync_file_system/get_file_statuses")) | 124 ASSERT_TRUE(RunPlatformAppTest("sync_file_system/get_file_statuses")) |
133 << message_; | 125 << message_; |
134 } | 126 } |
135 | 127 |
136 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, GetUsageAndQuota) { | 128 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, GetUsageAndQuota) { |
137 ASSERT_TRUE(RunExtensionTest("sync_file_system/get_usage_and_quota")) | 129 ASSERT_TRUE(RunExtensionTest("sync_file_system/get_usage_and_quota")) |
138 << message_; | 130 << message_; |
139 } | 131 } |
140 | 132 |
141 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, OnFileStatusChanged) { | 133 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, OnFileStatusChanged) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 ASSERT_TRUE(RunPlatformAppTest("sync_file_system/conflict_resolution_policy")) | 185 ASSERT_TRUE(RunPlatformAppTest("sync_file_system/conflict_resolution_policy")) |
194 << message_; | 186 << message_; |
195 } | 187 } |
196 | 188 |
197 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, GetServiceStatus) { | 189 IN_PROC_BROWSER_TEST_F(SyncFileSystemApiTest, GetServiceStatus) { |
198 mock_remote_service()->SetServiceState( | 190 mock_remote_service()->SetServiceState( |
199 sync_file_system::REMOTE_SERVICE_AUTHENTICATION_REQUIRED); | 191 sync_file_system::REMOTE_SERVICE_AUTHENTICATION_REQUIRED); |
200 ASSERT_TRUE(RunPlatformAppTest("sync_file_system/get_service_status")) | 192 ASSERT_TRUE(RunPlatformAppTest("sync_file_system/get_service_status")) |
201 << message_; | 193 << message_; |
202 } | 194 } |
OLD | NEW |