| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/apps/drive/drive_app_mapping.h" | 5 #include "chrome/browser/apps/drive/drive_app_mapping.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/test/base/testing_pref_service_syncable.h" | 9 #include "chrome/test/base/testing_pref_service_syncable.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 |
| 12 class DriveAppMappingTest : public testing::Test { | 12 class DriveAppMappingTest : public testing::Test { |
| 13 public: | 13 public: |
| 14 DriveAppMappingTest() {} | 14 DriveAppMappingTest() {} |
| 15 virtual ~DriveAppMappingTest() {} | 15 ~DriveAppMappingTest() override {} |
| 16 | 16 |
| 17 // testing::Test: | 17 // testing::Test: |
| 18 virtual void SetUp() override { | 18 void SetUp() override { |
| 19 pref_service_.reset(new TestingPrefServiceSyncable); | 19 pref_service_.reset(new TestingPrefServiceSyncable); |
| 20 DriveAppMapping::RegisterProfilePrefs(pref_service_->registry()); | 20 DriveAppMapping::RegisterProfilePrefs(pref_service_->registry()); |
| 21 | 21 |
| 22 mapping_.reset(new DriveAppMapping(pref_service_.get())); | 22 mapping_.reset(new DriveAppMapping(pref_service_.get())); |
| 23 } | 23 } |
| 24 | 24 |
| 25 DriveAppMapping* mapping() { return mapping_.get(); } | 25 DriveAppMapping* mapping() { return mapping_.get(); } |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 scoped_ptr<TestingPrefServiceSyncable> pref_service_; | 28 scoped_ptr<TestingPrefServiceSyncable> pref_service_; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 TEST_F(DriveAppMappingTest, TrackUninstall) { | 118 TEST_F(DriveAppMappingTest, TrackUninstall) { |
| 119 const std::string drive_app_id = "drive-1"; | 119 const std::string drive_app_id = "drive-1"; |
| 120 | 120 |
| 121 mapping()->AddUninstalledDriveApp(drive_app_id); | 121 mapping()->AddUninstalledDriveApp(drive_app_id); |
| 122 EXPECT_TRUE(mapping()->IsUninstalledDriveApp(drive_app_id)); | 122 EXPECT_TRUE(mapping()->IsUninstalledDriveApp(drive_app_id)); |
| 123 | 123 |
| 124 mapping()->RemoveUninstalledDriveApp(drive_app_id); | 124 mapping()->RemoveUninstalledDriveApp(drive_app_id); |
| 125 EXPECT_FALSE(mapping()->IsUninstalledDriveApp(drive_app_id)); | 125 EXPECT_FALSE(mapping()->IsUninstalledDriveApp(drive_app_id)); |
| 126 } | 126 } |
| OLD | NEW |