Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: chrome/browser/chromeos/drive/drive_scheduler_unittest.cc

Issue 13448003: Narrow the ownership of DriveUploader from DriveSystemService to DriveScheduler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/drive_scheduler.h" 5 #include "chrome/browser/chromeos/drive/drive_scheduler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 fake_drive_service_.reset(new google_apis::FakeDriveService()); 59 fake_drive_service_.reset(new google_apis::FakeDriveService());
60 fake_drive_service_->LoadResourceListForWapi( 60 fake_drive_service_->LoadResourceListForWapi(
61 "chromeos/gdata/root_feed.json"); 61 "chromeos/gdata/root_feed.json");
62 fake_drive_service_->LoadAccountMetadataForWapi( 62 fake_drive_service_->LoadAccountMetadataForWapi(
63 "chromeos/gdata/account_metadata.json"); 63 "chromeos/gdata/account_metadata.json");
64 fake_drive_service_->LoadAppListForDriveApi( 64 fake_drive_service_->LoadAppListForDriveApi(
65 "chromeos/drive/applist.json"); 65 "chromeos/drive/applist.json");
66 66
67 scheduler_.reset(new DriveScheduler(profile_.get(), 67 scheduler_.reset(new DriveScheduler(profile_.get(),
68 fake_drive_service_.get(), 68 fake_drive_service_.get()));
69 NULL));
70 69
71 scheduler_->Initialize(); 70 scheduler_->Initialize();
72 scheduler_->SetDisableThrottling(true); 71 scheduler_->SetDisableThrottling(true);
73 } 72 }
74 73
75 virtual void TearDown() OVERRIDE { 74 virtual void TearDown() OVERRIDE {
76 // The scheduler should be deleted before NetworkLibrary, as it 75 // The scheduler should be deleted before NetworkLibrary, as it
77 // registers itself as observer of NetworkLibrary. 76 // registers itself as observer of NetworkLibrary.
78 scheduler_.reset(); 77 scheduler_.reset();
79 google_apis::test_util::RunBlockingPoolTask(); 78 google_apis::test_util::RunBlockingPoolTask();
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 // Check the download 550 // Check the download
552 EXPECT_EQ(google_apis::HTTP_SUCCESS, download_error); 551 EXPECT_EQ(google_apis::HTTP_SUCCESS, download_error);
553 std::string content; 552 std::string content;
554 EXPECT_EQ(output_file_path, kOutputFilePath); 553 EXPECT_EQ(output_file_path, kOutputFilePath);
555 ASSERT_TRUE(file_util::ReadFileToString(output_file_path, &content)); 554 ASSERT_TRUE(file_util::ReadFileToString(output_file_path, &content));
556 // The content is "x"s of the file size specified in root_feed.json. 555 // The content is "x"s of the file size specified in root_feed.json.
557 EXPECT_EQ("xxxxxxxxxx", content); 556 EXPECT_EQ("xxxxxxxxxx", content);
558 } 557 }
559 558
560 } // namespace drive 559 } // namespace drive
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drive/drive_scheduler.cc ('k') | chrome/browser/chromeos/drive/drive_system_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698