| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 JobSchedulerTest() | 90 JobSchedulerTest() |
| 91 : profile_(new TestingProfile) { | 91 : profile_(new TestingProfile) { |
| 92 } | 92 } |
| 93 | 93 |
| 94 virtual void SetUp() OVERRIDE { | 94 virtual void SetUp() OVERRIDE { |
| 95 fake_network_change_notifier_.reset( | 95 fake_network_change_notifier_.reset( |
| 96 new test_util::FakeNetworkChangeNotifier); | 96 new test_util::FakeNetworkChangeNotifier); |
| 97 | 97 |
| 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 "chromeos/gdata/root_feed.json"); | 100 "gdata/root_feed.json"); |
| 101 fake_drive_service_->LoadAccountMetadataForWapi( | 101 fake_drive_service_->LoadAccountMetadataForWapi( |
| 102 "chromeos/gdata/account_metadata.json"); | 102 "gdata/account_metadata.json"); |
| 103 fake_drive_service_->LoadAppListForDriveApi( | 103 fake_drive_service_->LoadAppListForDriveApi( |
| 104 "chromeos/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())); |
| 109 scheduler_->SetDisableThrottling(true); | 109 scheduler_->SetDisableThrottling(true); |
| 110 } | 110 } |
| 111 | 111 |
| 112 virtual void TearDown() OVERRIDE { | 112 virtual void TearDown() OVERRIDE { |
| 113 // The scheduler should be deleted before NetworkLibrary, as it | 113 // The scheduler should be deleted before NetworkLibrary, as it |
| 114 // registers itself as observer of NetworkLibrary. | 114 // registers itself as observer of NetworkLibrary. |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 | 871 |
| 872 std::vector<int64> upload_progress; | 872 std::vector<int64> upload_progress; |
| 873 logger.GetProgressInfo(TYPE_UPLOAD_NEW_FILE, &upload_progress); | 873 logger.GetProgressInfo(TYPE_UPLOAD_NEW_FILE, &upload_progress); |
| 874 ASSERT_TRUE(!upload_progress.empty()); | 874 ASSERT_TRUE(!upload_progress.empty()); |
| 875 EXPECT_TRUE(base::STLIsSorted(upload_progress)); | 875 EXPECT_TRUE(base::STLIsSorted(upload_progress)); |
| 876 EXPECT_GE(upload_progress.front(), 0); | 876 EXPECT_GE(upload_progress.front(), 0); |
| 877 EXPECT_LE(upload_progress.back(), 13); | 877 EXPECT_LE(upload_progress.back(), 13); |
| 878 } | 878 } |
| 879 | 879 |
| 880 } // namespace drive | 880 } // namespace drive |
| OLD | NEW |