Chromium Code Reviews| 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/drive_integration_service.h" | 5 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chromeos/drive/dummy_file_system.h" | 7 #include "chrome/browser/chromeos/drive/dummy_file_system.h" |
| 8 #include "chrome/browser/chromeos/drive/test_util.h" | 8 #include "chrome/browser/chromeos/drive/test_util.h" |
| 9 #include "chrome/browser/drive/dummy_drive_service.h" | 9 #include "chrome/browser/drive/dummy_drive_service.h" |
| 10 #include "chrome/test/base/testing_profile.h" | 10 #include "chrome/test/base/testing_profile.h" |
| 11 #include "content/public/test/test_browser_thread_bundle.h" | 11 #include "content/public/test/test_browser_thread_bundle.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace drive { | 14 namespace drive { |
| 15 | 15 |
| 16 class DriveIntegrationServiceTest : public testing::Test { | 16 class DriveIntegrationServiceTest : public testing::Test { |
| 17 public: | 17 public: |
| 18 virtual void SetUp() OVERRIDE { | 18 virtual void SetUp() OVERRIDE { |
| 19 profile_.reset(new TestingProfile); | 19 profile_.reset(new TestingProfile); |
| 20 integration_service_.reset(new DriveIntegrationService( | 20 integration_service_.reset(new DriveIntegrationService( |
| 21 profile_.get(), | 21 profile_.get(), |
| 22 new DummyDriveService, | 22 new DummyDriveService, |
| 23 base::FilePath(), | 23 base::FilePath(), |
| 24 new DummyFileSystem)); | 24 new DummyFileSystem)); |
| 25 } | 25 } |
| 26 | 26 |
| 27 virtual void TearDown() OVERRIDE { | |
| 28 integration_service_.reset(); | |
| 29 google_apis::test_util::RunBlockingPoolTask(); | |
| 30 profile_.reset(); | |
| 31 } | |
| 32 | |
| 33 protected: | 27 protected: |
| 34 content::TestBrowserThreadBundle thread_bundle_; | 28 content::TestBrowserThreadBundle thread_bundle_; |
| 35 scoped_ptr<TestingProfile> profile_; | 29 scoped_ptr<TestingProfile> profile_; |
| 36 scoped_ptr<DriveIntegrationService> integration_service_; | 30 scoped_ptr<DriveIntegrationService> integration_service_; |
| 37 }; | 31 }; |
| 38 | 32 |
| 39 TEST_F(DriveIntegrationServiceTest, InitializeAndShutdown) { | 33 TEST_F(DriveIntegrationServiceTest, InitializeAndShutdown) { |
| 40 integration_service_->Initialize(); | 34 integration_service_->Initialize(); |
| 41 google_apis::test_util::RunBlockingPoolTask(); | 35 google_apis::test_util::RunBlockingPoolTask(); |
| 42 integration_service_->Shutdown(); | 36 integration_service_->Shutdown(); |
| 37 google_apis::test_util::RunBlockingPoolTask(); | |
|
hashimoto
2013/07/03 07:58:47
Isn't the dtor of BrowserThread is responsible to
kinaba
2013/07/03 10:06:58
Done.
| |
| 43 } | 38 } |
| 44 | 39 |
| 45 } // namespace drive | 40 } // namespace drive |
| OLD | NEW |