| 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 "chrome/browser/chromeos/drive/job_scheduler.h" | 5 #include "chrome/browser/chromeos/drive/job_scheduler.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 fake_drive_service_.reset(new FakeDriveService()); | 98 fake_drive_service_.reset(new FakeDriveService()); |
| 99 fake_drive_service_->LoadResourceListForWapi( | 99 fake_drive_service_->LoadResourceListForWapi( |
| 100 "gdata/root_feed.json"); | 100 "gdata/root_feed.json"); |
| 101 fake_drive_service_->LoadAccountMetadataForWapi( | 101 fake_drive_service_->LoadAccountMetadataForWapi( |
| 102 "gdata/account_metadata.json"); | 102 "gdata/account_metadata.json"); |
| 103 fake_drive_service_->LoadAppListForDriveApi( | 103 fake_drive_service_->LoadAppListForDriveApi( |
| 104 "drive/applist.json"); | 104 "drive/applist.json"); |
| 105 | 105 |
| 106 scheduler_.reset(new JobScheduler(profile_.get(), | 106 scheduler_.reset(new JobScheduler(profile_.get(), |
| 107 fake_drive_service_.get(), | 107 fake_drive_service_.get(), |
| 108 base::MessageLoopProxy::current())); | 108 base::MessageLoopProxy::current().get())); |
| 109 scheduler_->SetDisableThrottling(true); | 109 scheduler_->SetDisableThrottling(true); |
| 110 } | 110 } |
| 111 | 111 |
| 112 protected: | 112 protected: |
| 113 // Sets up FakeNetworkChangeNotifier as if it's connected to a network with | 113 // Sets up FakeNetworkChangeNotifier as if it's connected to a network with |
| 114 // the specified connection type. | 114 // the specified connection type. |
| 115 void ChangeConnectionType(net::NetworkChangeNotifier::ConnectionType type) { | 115 void ChangeConnectionType(net::NetworkChangeNotifier::ConnectionType type) { |
| 116 fake_network_change_notifier_->SetConnectionType(type); | 116 fake_network_change_notifier_->SetConnectionType(type); |
| 117 } | 117 } |
| 118 | 118 |
| (...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 | 858 |
| 859 std::vector<int64> upload_progress; | 859 std::vector<int64> upload_progress; |
| 860 logger.GetProgressInfo(TYPE_UPLOAD_NEW_FILE, &upload_progress); | 860 logger.GetProgressInfo(TYPE_UPLOAD_NEW_FILE, &upload_progress); |
| 861 ASSERT_TRUE(!upload_progress.empty()); | 861 ASSERT_TRUE(!upload_progress.empty()); |
| 862 EXPECT_TRUE(base::STLIsSorted(upload_progress)); | 862 EXPECT_TRUE(base::STLIsSorted(upload_progress)); |
| 863 EXPECT_GE(upload_progress.front(), 0); | 863 EXPECT_GE(upload_progress.front(), 0); |
| 864 EXPECT_LE(upload_progress.back(), 13); | 864 EXPECT_LE(upload_progress.back(), 13); |
| 865 } | 865 } |
| 866 | 866 |
| 867 } // namespace drive | 867 } // namespace drive |
| OLD | NEW |