OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/apps/app_browsertest_util.h" | 9 #include "chrome/browser/apps/app_browsertest_util.h" |
10 #include "chrome/browser/drive/fake_drive_service.h" | 10 #include "chrome/browser/drive/fake_drive_service.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 drive_backend::SyncEngine* sync_engine() { | 128 drive_backend::SyncEngine* sync_engine() { |
129 return static_cast<drive_backend::SyncEngine*>( | 129 return static_cast<drive_backend::SyncEngine*>( |
130 sync_file_system_service()->remote_service_.get()); | 130 sync_file_system_service()->remote_service_.get()); |
131 } | 131 } |
132 | 132 |
133 LocalFileSyncService* local_file_sync_service() { | 133 LocalFileSyncService* local_file_sync_service() { |
134 return sync_file_system_service()->local_service_.get(); | 134 return sync_file_system_service()->local_service_.get(); |
135 } | 135 } |
136 | 136 |
137 void SignIn() { | 137 void SignIn() { |
138 fake_signin_manager_->SetAuthenticatedUsername("tester"); | 138 fake_signin_manager_->SetAuthenticatedAccountInfo("12345", "tester"); |
139 sync_engine()->GoogleSigninSucceeded("test_account", "tester", "testing"); | 139 sync_engine()->GoogleSigninSucceeded("12345", "tester", "password"); |
140 } | 140 } |
141 | 141 |
142 void SetSyncEnabled(bool enabled) { | 142 void SetSyncEnabled(bool enabled) { |
143 sync_file_system_service()->SetSyncEnabledForTesting(enabled); | 143 sync_file_system_service()->SetSyncEnabledForTesting(enabled); |
144 } | 144 } |
145 | 145 |
146 void WaitUntilIdle() { | 146 void WaitUntilIdle() { |
147 base::RunLoop run_loop; | 147 base::RunLoop run_loop; |
148 sync_file_system_service()->CallOnIdleForTesting(run_loop.QuitClosure()); | 148 sync_file_system_service()->CallOnIdleForTesting(run_loop.QuitClosure()); |
149 run_loop.Run(); | 149 run_loop.Run(); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 206 |
207 sync_engine()->GoogleSigninSucceeded("test_account", "tester", "testing"); | 207 sync_engine()->GoogleSigninSucceeded("test_account", "tester", "testing"); |
208 WaitUntilIdle(); | 208 WaitUntilIdle(); |
209 | 209 |
210 bar_created.Reply("resume"); | 210 bar_created.Reply("resume"); |
211 | 211 |
212 EXPECT_TRUE(catcher.GetNextResult()); | 212 EXPECT_TRUE(catcher.GetNextResult()); |
213 } | 213 } |
214 | 214 |
215 } // namespace sync_file_system | 215 } // namespace sync_file_system |
OLD | NEW |