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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/metrics/field_trial.h" | 7 #include "base/metrics/field_trial.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/extensions/extension_service_test_base.h" | 10 #include "chrome/browser/extensions/extension_service_test_base.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 #if defined(OS_CHROMEOS) | 88 #if defined(OS_CHROMEOS) |
89 // On ChromeOS locale is per-profile. | 89 // On ChromeOS locale is per-profile. |
90 profile->GetPrefs()->SetString(prefs::kApplicationLocale, new_locale); | 90 profile->GetPrefs()->SetString(prefs::kApplicationLocale, new_locale); |
91 #else | 91 #else |
92 g_browser_process->SetApplicationLocale(new_locale); | 92 g_browser_process->SetApplicationLocale(new_locale); |
93 #endif | 93 #endif |
94 } | 94 } |
95 | 95 |
96 void SetUp() override { | 96 void SetUp() override { |
97 extension_id_ = GetParam(); | 97 extension_id_ = GetParam(); |
98 if (extension_id_ == extension_misc::kHotwordSharedModuleId) { | 98 if (extension_id_ == extension_misc::kHotwordExtensionId) { |
99 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 99 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
100 switches::kEnableExperimentalHotwording); | 100 switches::kDisableExperimentalHotwording); |
101 } | 101 } |
102 | 102 |
103 extensions::ExtensionServiceTestBase::SetUp(); | 103 extensions::ExtensionServiceTestBase::SetUp(); |
104 } | 104 } |
105 | 105 |
106 base::FieldTrialList field_trial_list_; | 106 base::FieldTrialList field_trial_list_; |
107 std::string extension_id_; | 107 std::string extension_id_; |
108 }; | 108 }; |
109 | 109 |
110 INSTANTIATE_TEST_CASE_P(HotwordServiceTests, | 110 INSTANTIATE_TEST_CASE_P(HotwordServiceTests, |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 | 493 |
494 // Set pref. | 494 // Set pref. |
495 profile()->GetPrefs()->SetBoolean(prefs::kHotwordSearchEnabled, true); | 495 profile()->GetPrefs()->SetBoolean(prefs::kHotwordSearchEnabled, true); |
496 EXPECT_FALSE(hotword_service->IsSometimesOnEnabled()); | 496 EXPECT_FALSE(hotword_service->IsSometimesOnEnabled()); |
497 | 497 |
498 // Disable always-on. | 498 // Disable always-on. |
499 profile()->GetPrefs()->SetBoolean(prefs::kHotwordAlwaysOnSearchEnabled, | 499 profile()->GetPrefs()->SetBoolean(prefs::kHotwordAlwaysOnSearchEnabled, |
500 false); | 500 false); |
501 EXPECT_FALSE(hotword_service->IsSometimesOnEnabled()); | 501 EXPECT_FALSE(hotword_service->IsSometimesOnEnabled()); |
502 } | 502 } |
OLD | NEW |