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

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

Issue 11787035: drive: Stop loading account_metadata.json from drive_scheduler_unittest.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/threading/sequenced_worker_pool.h" 10 #include "base/threading/sequenced_worker_pool.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 scoped_ptr<google_apis::ResourceList> resource_list; 52 scoped_ptr<google_apis::ResourceList> resource_list;
53 base::MessageLoopProxy::current()->PostTask(FROM_HERE, 53 base::MessageLoopProxy::current()->PostTask(FROM_HERE,
54 base::Bind(callback, 54 base::Bind(callback,
55 google_apis::GDATA_PARSE_ERROR, 55 google_apis::GDATA_PARSE_ERROR,
56 base::Passed(&resource_list))); 56 base::Passed(&resource_list)));
57 } 57 }
58 } 58 }
59 59
60 virtual void GetAccountMetadata( 60 virtual void GetAccountMetadata(
61 const google_apis::GetAccountMetadataCallback& callback) OVERRIDE { 61 const google_apis::GetAccountMetadataCallback& callback) OVERRIDE {
62 // Make some sample data. 62 // The contents don't matter here, so just return empty metadata.
63 scoped_ptr<Value> data = google_apis::test_util::LoadJSONFile( 63 scoped_ptr<google_apis::AccountMetadataFeed> account_metadata(
64 "gdata/account_metadata.json"); 64 new google_apis::AccountMetadataFeed);
65 scoped_ptr<google_apis::AccountMetadataFeed> account_metadata
66 = google_apis::AccountMetadataFeed::CreateFrom(*data);
67 65
68 base::MessageLoopProxy::current()->PostTask(FROM_HERE, 66 base::MessageLoopProxy::current()->PostTask(FROM_HERE,
69 base::Bind(callback, 67 base::Bind(callback,
70 google_apis::HTTP_SUCCESS, 68 google_apis::HTTP_SUCCESS,
71 base::Passed(&account_metadata))); 69 base::Passed(&account_metadata)));
72 } 70 }
73 71
74 virtual void GetApplicationInfo( 72 virtual void GetApplicationInfo(
75 const google_apis::GetDataCallback& callback) OVERRIDE { 73 const google_apis::GetDataCallback& callback) OVERRIDE {
76 scoped_ptr<Value> data = google_apis::test_util::LoadJSONFile( 74 // The contents don't matter here, so just return an empty dictionary.
77 "gdata/account_metadata.json"); 75 scoped_ptr<base::Value> data(new base::DictionaryValue);
78 76
79 base::MessageLoopProxy::current()->PostTask(FROM_HERE, 77 base::MessageLoopProxy::current()->PostTask(FROM_HERE,
80 base::Bind(callback, 78 base::Bind(callback,
81 google_apis::HTTP_SUCCESS, 79 google_apis::HTTP_SUCCESS,
82 base::Passed(&data))); 80 base::Passed(&data)));
83 } 81 }
84 82
85 virtual void DeleteResource( 83 virtual void DeleteResource(
86 const GURL& edit_url, 84 const GURL& edit_url,
87 const google_apis::EntryActionCallback& callback) { 85 const google_apis::EntryActionCallback& callback) {
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 &google_apis::test_util::CopyResultsFromGetResourceEntryCallback, 435 &google_apis::test_util::CopyResultsFromGetResourceEntryCallback,
438 &error, 436 &error,
439 &entry)); 437 &entry));
440 google_apis::test_util::RunBlockingPoolTask(); 438 google_apis::test_util::RunBlockingPoolTask();
441 439
442 ASSERT_EQ(google_apis::HTTP_SUCCESS, error); 440 ASSERT_EQ(google_apis::HTTP_SUCCESS, error);
443 ASSERT_TRUE(entry); 441 ASSERT_TRUE(entry);
444 } 442 }
445 443
446 } // namespace drive 444 } // namespace drive
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698