| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/app_list/app_list_service.h" | 5 #include "chrome/browser/ui/app_list/app_list_service.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/prefs/pref_registry_simple.h" | |
| 14 #include "base/prefs/pref_service.h" | |
| 15 #include "base/prefs/pref_service_factory.h" | |
| 16 #include "base/prefs/testing_pref_store.h" | |
| 17 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/profiles/profiles_state.h" | 14 #include "chrome/browser/profiles/profiles_state.h" |
| 19 #include "chrome/browser/ui/app_list/app_list_service_impl.h" | 15 #include "chrome/browser/ui/app_list/app_list_service_impl.h" |
| 20 #include "chrome/browser/ui/app_list/test/fake_profile.h" | 16 #include "chrome/browser/ui/app_list/test/fake_profile.h" |
| 21 #include "chrome/browser/ui/app_list/test/fake_profile_store.h" | 17 #include "chrome/browser/ui/app_list/test/fake_profile_store.h" |
| 22 #include "chrome/common/chrome_constants.h" | 18 #include "chrome/common/chrome_constants.h" |
| 23 #include "chrome/common/pref_names.h" | 19 #include "chrome/common/pref_names.h" |
| 20 #include "components/prefs/pref_registry_simple.h" |
| 21 #include "components/prefs/pref_service.h" |
| 22 #include "components/prefs/pref_service_factory.h" |
| 23 #include "components/prefs/testing_pref_store.h" |
| 24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
| 25 #include "ui/app_list/app_list_switches.h" | 25 #include "ui/app_list/app_list_switches.h" |
| 26 | 26 |
| 27 class TestingAppListServiceImpl : public AppListServiceImpl { | 27 class TestingAppListServiceImpl : public AppListServiceImpl { |
| 28 public: | 28 public: |
| 29 TestingAppListServiceImpl(const base::CommandLine& command_line, | 29 TestingAppListServiceImpl(const base::CommandLine& command_line, |
| 30 PrefService* local_state, | 30 PrefService* local_state, |
| 31 scoped_ptr<ProfileStore> profile_store) | 31 scoped_ptr<ProfileStore> profile_store) |
| 32 : AppListServiceImpl(command_line, local_state, std::move(profile_store)), | 32 : AppListServiceImpl(command_line, local_state, std::move(profile_store)), |
| 33 showing_for_profile_(NULL), | 33 showing_for_profile_(NULL), |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 EXPECT_EQ(AppListService::ENABLE_FOR_APP_INSTALL, | 270 EXPECT_EQ(AppListService::ENABLE_FOR_APP_INSTALL, |
| 271 local_state_->GetInteger(prefs::kAppListEnableMethod)); | 271 local_state_->GetInteger(prefs::kAppListEnableMethod)); |
| 272 EXPECT_NE(0, local_state_->GetInt64(prefs::kAppListEnableTime)); | 272 EXPECT_NE(0, local_state_->GetInt64(prefs::kAppListEnableTime)); |
| 273 | 273 |
| 274 // An auto-show here should update the enable method to prevent recording it | 274 // An auto-show here should update the enable method to prevent recording it |
| 275 // as ENABLE_FOR_APP_INSTALL. | 275 // as ENABLE_FOR_APP_INSTALL. |
| 276 service_->ShowForAppInstall(profile1_.get(), "", false); | 276 service_->ShowForAppInstall(profile1_.get(), "", false); |
| 277 EXPECT_EQ(AppListService::ENABLE_SHOWN_UNDISCOVERED, | 277 EXPECT_EQ(AppListService::ENABLE_SHOWN_UNDISCOVERED, |
| 278 local_state_->GetInteger(prefs::kAppListEnableMethod)); | 278 local_state_->GetInteger(prefs::kAppListEnableMethod)); |
| 279 } | 279 } |
| OLD | NEW |