drive_integration_service_unittest.cc revision 90dce4d38c5ff5333bea97d859d4e484e27edf0c
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 3// found in the LICENSE file. 4 5#include "chrome/browser/chromeos/drive/drive_integration_service.h" 6 7#include "base/message_loop.h" 8#include "chrome/browser/chromeos/drive/dummy_file_system.h" 9#include "chrome/browser/chromeos/drive/test_util.h" 10#include "chrome/browser/google_apis/dummy_drive_service.h" 11#include "chrome/test/base/testing_profile.h" 12#include "content/public/test/test_browser_thread.h" 13#include "testing/gtest/include/gtest/gtest.h" 14 15namespace drive { 16 17class DriveIntegrationServiceTest : public testing::Test { 18 public: 19 DriveIntegrationServiceTest() : 20 ui_thread_(content::BrowserThread::UI, &message_loop_), 21 integration_service_(NULL) {} 22 23 virtual void SetUp() OVERRIDE { 24 profile_.reset(new TestingProfile); 25 integration_service_.reset(new DriveIntegrationService( 26 profile_.get(), 27 new google_apis::DummyDriveService, 28 base::FilePath(), 29 new DummyFileSystem)); 30 } 31 32 virtual void TearDown() OVERRIDE { 33 integration_service_.reset(); 34 google_apis::test_util::RunBlockingPoolTask(); 35 profile_.reset(); 36 } 37 38 protected: 39 base::MessageLoopForUI message_loop_; 40 content::TestBrowserThread ui_thread_; 41 scoped_ptr<TestingProfile> profile_; 42 scoped_ptr<DriveIntegrationService> integration_service_; 43}; 44 45TEST_F(DriveIntegrationServiceTest, InitializeAndShutdown) { 46 integration_service_->Initialize(); 47 google_apis::test_util::RunBlockingPoolTask(); 48 integration_service_->Shutdown(); 49} 50 51} // namespace drive 52