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

Side by Side Diff: chrome/browser/extensions/api/hotword_private/hotword_private_apitest.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
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/extensions/hotword_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/prefs/pref_service.h" 6 #include "base/prefs/pref_service.h"
7 #include "chrome/browser/extensions/api/hotword_private/hotword_private_api.h" 7 #include "chrome/browser/extensions/api/hotword_private/hotword_private_api.h"
8 #include "chrome/browser/extensions/extension_apitest.h" 8 #include "chrome/browser/extensions/extension_apitest.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/history/web_history_service.h" 10 #include "chrome/browser/history/web_history_service.h"
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 { 263 {
264 ExtensionTestMessageListener listener("alwaysOnEnabled: true", 264 ExtensionTestMessageListener listener("alwaysOnEnabled: true",
265 false); 265 false);
266 ASSERT_TRUE(RunComponentExtensionTest("alwaysOnEnabled")) 266 ASSERT_TRUE(RunComponentExtensionTest("alwaysOnEnabled"))
267 << message_; 267 << message_;
268 EXPECT_TRUE(listener.WaitUntilSatisfied()); 268 EXPECT_TRUE(listener.WaitUntilSatisfied());
269 } 269 }
270 } 270 }
271 271
272 IN_PROC_BROWSER_TEST_F(HotwordPrivateApiTest, ExperimentalHotwordEnabled) { 272 IN_PROC_BROWSER_TEST_F(HotwordPrivateApiTest, ExperimentalHotwordEnabled) {
273 // Disabled by default. 273 // Enabled by default.
274 ExtensionTestMessageListener listener("experimentalHotwordEnabled: false", 274 ExtensionTestMessageListener listener("experimentalHotwordEnabled: true",
275 false); 275 false);
276 ASSERT_TRUE(RunComponentExtensionTest("experimentalHotwordEnabled")) 276 ASSERT_TRUE(RunComponentExtensionTest("experimentalHotwordEnabled"))
277 << message_; 277 << message_;
278 EXPECT_TRUE(listener.WaitUntilSatisfied()); 278 EXPECT_TRUE(listener.WaitUntilSatisfied());
279 } 279 }
280 280
281 IN_PROC_BROWSER_TEST_F(HotwordPrivateApiTest, 281 IN_PROC_BROWSER_TEST_F(HotwordPrivateApiTest,
282 ExperimentalHotwordEnabled_Enabled) { 282 ExperimentalHotwordEnabled_Enabled) {
283 base::CommandLine::ForCurrentProcess()->AppendSwitch(
284 switches::kEnableExperimentalHotwording);
285 ExtensionTestMessageListener listener("experimentalHotwordEnabled: true", 283 ExtensionTestMessageListener listener("experimentalHotwordEnabled: true",
286 false); 284 false);
287 ASSERT_TRUE(RunComponentExtensionTest("experimentalHotwordEnabled")) 285 ASSERT_TRUE(RunComponentExtensionTest("experimentalHotwordEnabled"))
288 << message_; 286 << message_;
289 EXPECT_TRUE(listener.WaitUntilSatisfied()); 287 EXPECT_TRUE(listener.WaitUntilSatisfied());
290 } 288 }
291 289
292 IN_PROC_BROWSER_TEST_F(HotwordPrivateApiTest, OnEnabledChanged) { 290 IN_PROC_BROWSER_TEST_F(HotwordPrivateApiTest, OnEnabledChanged) {
293 // Trigger the pref registrar. 291 // Trigger the pref registrar.
294 extensions::HotwordPrivateEventService::GetFactoryInstance(); 292 extensions::HotwordPrivateEventService::GetFactoryInstance();
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 ExtensionTestMessageListener setListenerT("set AH: false failure", false); 466 ExtensionTestMessageListener setListenerT("set AH: false failure", false);
469 ExtensionTestMessageListener setListenerF("set AH: false failure", false); 467 ExtensionTestMessageListener setListenerF("set AH: false failure", false);
470 ExtensionTestMessageListener getListener("get AH: false failure", false); 468 ExtensionTestMessageListener getListener("get AH: false failure", false);
471 469
472 ASSERT_TRUE(RunComponentExtensionTest("audioHistory")) << message_; 470 ASSERT_TRUE(RunComponentExtensionTest("audioHistory")) << message_;
473 471
474 EXPECT_TRUE(setListenerT.WaitUntilSatisfied()); 472 EXPECT_TRUE(setListenerT.WaitUntilSatisfied());
475 EXPECT_TRUE(setListenerF.WaitUntilSatisfied()); 473 EXPECT_TRUE(setListenerF.WaitUntilSatisfied());
476 EXPECT_TRUE(getListener.WaitUntilSatisfied()); 474 EXPECT_TRUE(getListener.WaitUntilSatisfied());
477 } 475 }
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/extensions/hotword_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698