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

Side by Side Diff: chrome/browser/ui/app_list/speech_recognizer_browsertest.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/search/hotword_service_unittest.cc ('k') | chrome/common/chrome_switches.h » ('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 "chrome/browser/ui/app_list/speech_recognizer.h" 5 #include "chrome/browser/ui/app_list/speech_recognizer.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 fake_speech_recognition_manager_.reset( 52 fake_speech_recognition_manager_.reset(
53 new content::FakeSpeechRecognitionManager()); 53 new content::FakeSpeechRecognitionManager());
54 fake_speech_recognition_manager_->set_should_send_fake_response(true); 54 fake_speech_recognition_manager_->set_should_send_fake_response(true);
55 content::SpeechRecognitionManager::SetManagerForTesting( 55 content::SpeechRecognitionManager::SetManagerForTesting(
56 fake_speech_recognition_manager_.get()); 56 fake_speech_recognition_manager_.get());
57 mock_speech_delegate_.reset(new MockSpeechRecognizerDelegate()); 57 mock_speech_delegate_.reset(new MockSpeechRecognizerDelegate());
58 test_contents_.reset(content::WebContentsTester::CreateTestWebContents( 58 test_contents_.reset(content::WebContentsTester::CreateTestWebContents(
59 browser()->profile(), NULL)); 59 browser()->profile(), NULL));
60 } 60 }
61 61
62 void SetUpCommandLine(base::CommandLine* command_line) override {
63 command_line->AppendSwitch(switches::kEnableExperimentalHotwording);
64 }
65
66 void TearDownOnMainThread() override { 62 void TearDownOnMainThread() override {
67 // This puts stuff on the IO loop which needs to be executed. 63 // This puts stuff on the IO loop which needs to be executed.
68 test_contents_.reset(); 64 test_contents_.reset();
69 65
70 // Poor-person's way of ensuring IO loop is idle. 66 // Poor-person's way of ensuring IO loop is idle.
71 auto io_loop = content::BrowserThread::UnsafeGetMessageLoopForThread( 67 auto io_loop = content::BrowserThread::UnsafeGetMessageLoopForThread(
72 content::BrowserThread::IO); 68 content::BrowserThread::IO);
73 ASSERT_TRUE(io_loop); 69 ASSERT_TRUE(io_loop);
74 while (!io_loop->IsIdleForTesting()) { 70 while (!io_loop->IsIdleForTesting()) {
75 // Sleep for a little bit, allowing the IO thread to obtain any locks 71 // Sleep for a little bit, allowing the IO thread to obtain any locks
(...skipping 26 matching lines...) Expand all
102 EXPECT_CALL(*mock_speech_delegate_, 98 EXPECT_CALL(*mock_speech_delegate_,
103 OnSpeechRecognitionStateChanged(SPEECH_RECOGNITION_READY)) 99 OnSpeechRecognitionStateChanged(SPEECH_RECOGNITION_READY))
104 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); 100 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit));
105 recognizer.Start(); 101 recognizer.Start();
106 run_loop.Run(); 102 run_loop.Run();
107 } 103 }
108 104
109 } // namespace app_list 105 } // namespace app_list
110 106
111 107
OLDNEW
« no previous file with comments | « chrome/browser/search/hotword_service_unittest.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698