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/drive/dummy_drive_service.h" | 8 #include "chrome/browser/drive/dummy_drive_service.h" |
9 #include "chrome/test/base/testing_browser_process.h" | 9 #include "chrome/test/base/testing_browser_process.h" |
10 #include "chrome/test/base/testing_profile.h" | 10 #include "chrome/test/base/testing_profile.h" |
11 #include "chrome/test/base/testing_profile_manager.h" | 11 #include "chrome/test/base/testing_profile_manager.h" |
12 #include "content/public/test/test_browser_thread_bundle.h" | 12 #include "content/public/test/test_browser_thread_bundle.h" |
13 #include "content/public/test/test_utils.h" | 13 #include "content/public/test/test_utils.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 namespace drive { | 16 namespace drive { |
17 | 17 |
18 namespace{ | 18 namespace{ |
19 const char kTestProfileName[] = "test-profile"; | 19 const char kTestProfileName[] = "test-profile"; |
20 } | 20 } |
21 | 21 |
22 class DriveIntegrationServiceTest : public testing::Test { | 22 class DriveIntegrationServiceTest : public testing::Test { |
23 public: | 23 public: |
24 DriveIntegrationServiceTest() | 24 DriveIntegrationServiceTest() |
25 : profile_manager_(TestingBrowserProcess::GetGlobal()) {} | 25 : profile_manager_(TestingBrowserProcess::GetGlobal()) {} |
26 | 26 |
27 virtual void SetUp() OVERRIDE { | 27 virtual void SetUp() override { |
28 ASSERT_TRUE(profile_manager_.SetUp()); | 28 ASSERT_TRUE(profile_manager_.SetUp()); |
29 } | 29 } |
30 | 30 |
31 protected: | 31 protected: |
32 content::TestBrowserThreadBundle thread_bundle_; | 32 content::TestBrowserThreadBundle thread_bundle_; |
33 // DriveIntegrationService depends on DriveNotificationManager which depends | 33 // DriveIntegrationService depends on DriveNotificationManager which depends |
34 // on InvalidationService. On Chrome OS, the InvalidationServiceFactory | 34 // on InvalidationService. On Chrome OS, the InvalidationServiceFactory |
35 // uses chromeos::ProfileHelper, which needs the ProfileManager or a | 35 // uses chromeos::ProfileHelper, which needs the ProfileManager or a |
36 // TestProfileManager to be running. | 36 // TestProfileManager to be running. |
37 TestingProfileManager profile_manager_; | 37 TestingProfileManager profile_manager_; |
(...skipping 24 matching lines...) Expand all Loading... |
62 EXPECT_EQ(DriveIntegrationServiceFactory::GetForProfile(user1), | 62 EXPECT_EQ(DriveIntegrationServiceFactory::GetForProfile(user1), |
63 DriveIntegrationServiceFactory::GetForProfile(user1_incognito)); | 63 DriveIntegrationServiceFactory::GetForProfile(user1_incognito)); |
64 | 64 |
65 // For different profiles, different services are running. | 65 // For different profiles, different services are running. |
66 TestingProfile* user2 = profile_manager_.CreateTestingProfile("user2"); | 66 TestingProfile* user2 = profile_manager_.CreateTestingProfile("user2"); |
67 EXPECT_NE(DriveIntegrationServiceFactory::GetForProfile(user1), | 67 EXPECT_NE(DriveIntegrationServiceFactory::GetForProfile(user1), |
68 DriveIntegrationServiceFactory::GetForProfile(user2)); | 68 DriveIntegrationServiceFactory::GetForProfile(user2)); |
69 } | 69 } |
70 | 70 |
71 } // namespace drive | 71 } // namespace drive |
OLD | NEW |