Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(746)

Side by Side Diff: chrome/browser/search/hotword_service_unittest.cc

Issue 774003002: [Hotword] Reverse the experimental flag so that it is on by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix browser test Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/search/hotword_service.cc ('k') | chrome/browser/ui/app_list/speech_recognizer_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698