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

Side by Side Diff: chrome/browser/speech/enable_speech_input_switch_browsertest.cc

Issue 3064017: Add --enable-speech-input switch and set ENABLE_INPUT_SPEECH=1 (Closed)
Patch Set: Added button images to test shell and set flag. Created 10 years, 4 months 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/renderer_host/browser_render_process_host.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/command_line.h"
6 #include "base/file_path.h"
7 #include "chrome/browser/browser.h"
8 #include "chrome/browser/tab_contents/tab_contents.h"
9 #include "chrome/common/chrome_switches.h"
10 #include "chrome/test/in_process_browser_test.h"
11 #include "chrome/test/ui_test_utils.h"
12
13 class SpeechInputEnableSwitchTest : public InProcessBrowserTest {
14 public:
15 GURL testUrl(const FilePath::CharType* filename) {
16 const FilePath kTestDir(FILE_PATH_LITERAL("speech"));
17 return ui_test_utils::GetTestUrl(kTestDir, FilePath(filename));
18 }
19 };
20
21 IN_PROC_BROWSER_TEST_F(SpeechInputEnableSwitchTest, UnavailabilityTest) {
22 // Test that speech input is not available to a web page if
23 // the runtime switch is disabled.
24
25 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
26 bool has_switch = command_line.HasSwitch(switches::kEnableSpeechInput);
27 ASSERT_FALSE(has_switch) << "This test does not make sense if "
28 << "--enable-speech-input is set.";
29
30 GURL test_url = testUrl(
31 FILE_PATH_LITERAL("enable_speech_input_switch_test.html"));
32 ui_test_utils::NavigateToURL(browser(), test_url);
33 std::string status = browser()->GetSelectedTabContents()->GetURL().ref();
34 EXPECT_EQ("pass", status) << "Page detected speech input properties.";
35 }
36
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/browser_render_process_host.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698