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

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

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 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/file_system.h" 5 #include "chrome/browser/chromeos/drive/file_system.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 29 matching lines...) Expand all
40 using ::testing::_; 40 using ::testing::_;
41 41
42 namespace drive { 42 namespace drive {
43 namespace { 43 namespace {
44 44
45 const int64 kLotsOfSpace = internal::kMinFreeSpace * 10; 45 const int64 kLotsOfSpace = internal::kMinFreeSpace * 10;
46 46
47 // Counts the number of invocation, and if it increased up to |expected_counter| 47 // Counts the number of invocation, and if it increased up to |expected_counter|
48 // quits the current message loop. 48 // quits the current message loop.
49 void AsyncInitializationCallback( 49 void AsyncInitializationCallback(
50 int* counter, int expected_counter, MessageLoop* message_loop, 50 int* counter, int expected_counter, base::MessageLoop* message_loop,
51 FileError error, scoped_ptr<ResourceEntry> entry) { 51 FileError error, scoped_ptr<ResourceEntry> entry) {
52 if (error != FILE_ERROR_OK || !entry) { 52 if (error != FILE_ERROR_OK || !entry) {
53 // If we hit an error case, quit the message loop immediately. 53 // If we hit an error case, quit the message loop immediately.
54 // Then the expectation in the test case can find it because the actual 54 // Then the expectation in the test case can find it because the actual
55 // value of |counter| is different from the expected one. 55 // value of |counter| is different from the expected one.
56 message_loop->Quit(); 56 message_loop->Quit();
57 return; 57 return;
58 } 58 }
59 59
60 (*counter)++; 60 (*counter)++;
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 ASSERT_TRUE(value->GetAsDictionary(&dict_value)); 360 ASSERT_TRUE(value->GetAsDictionary(&dict_value));
361 361
362 std::string alternate_url, resource_id; 362 std::string alternate_url, resource_id;
363 EXPECT_TRUE(dict_value->GetString("url", &alternate_url)); 363 EXPECT_TRUE(dict_value->GetString("url", &alternate_url));
364 EXPECT_TRUE(dict_value->GetString("resource_id", &resource_id)); 364 EXPECT_TRUE(dict_value->GetString("resource_id", &resource_id));
365 365
366 EXPECT_EQ(entry.file_specific_info().alternate_url(), alternate_url); 366 EXPECT_EQ(entry.file_specific_info().alternate_url(), alternate_url);
367 EXPECT_EQ(entry.resource_id(), resource_id); 367 EXPECT_EQ(entry.resource_id(), resource_id);
368 } 368 }
369 369
370 MessageLoopForUI message_loop_; 370 base::MessageLoopForUI message_loop_;
371 content::TestBrowserThread ui_thread_; 371 content::TestBrowserThread ui_thread_;
372 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; 372 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
373 scoped_ptr<TestingProfile> profile_; 373 scoped_ptr<TestingProfile> profile_;
374 374
375 scoped_ptr<internal::FileCache, test_util::DestroyHelperForTests> cache_; 375 scoped_ptr<internal::FileCache, test_util::DestroyHelperForTests> cache_;
376 scoped_ptr<FileSystem> file_system_; 376 scoped_ptr<FileSystem> file_system_;
377 scoped_ptr<google_apis::FakeDriveService> fake_drive_service_; 377 scoped_ptr<google_apis::FakeDriveService> fake_drive_service_;
378 scoped_ptr<JobScheduler> scheduler_; 378 scoped_ptr<JobScheduler> scheduler_;
379 scoped_ptr<internal::ResourceMetadata, test_util::DestroyHelperForTests> 379 scoped_ptr<internal::ResourceMetadata, test_util::DestroyHelperForTests>
380 resource_metadata_; 380 resource_metadata_;
(...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1674 entry->resource_id(), 1674 entry->resource_id(),
1675 entry->file_specific_info().file_md5(), 1675 entry->file_specific_info().file_md5(),
1676 google_apis::test_util::CreateCopyResultCallback(&success, &cache_entry)); 1676 google_apis::test_util::CreateCopyResultCallback(&success, &cache_entry));
1677 google_apis::test_util::RunBlockingPoolTask(); 1677 google_apis::test_util::RunBlockingPoolTask();
1678 1678
1679 EXPECT_TRUE(success); 1679 EXPECT_TRUE(success);
1680 EXPECT_FALSE(cache_entry.is_mounted()); 1680 EXPECT_FALSE(cache_entry.is_mounted());
1681 } 1681 }
1682 1682
1683 } // namespace drive 1683 } // namespace drive
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698