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

Unified 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, 5 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/speech/enable_speech_input_switch_browsertest.cc
diff --git a/chrome/browser/speech/enable_speech_input_switch_browsertest.cc b/chrome/browser/speech/enable_speech_input_switch_browsertest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..018cc013e7399a306e24797b5c546162201fecf3
--- /dev/null
+++ b/chrome/browser/speech/enable_speech_input_switch_browsertest.cc
@@ -0,0 +1,36 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/command_line.h"
+#include "base/file_path.h"
+#include "chrome/browser/browser.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
+#include "chrome/common/chrome_switches.h"
+#include "chrome/test/in_process_browser_test.h"
+#include "chrome/test/ui_test_utils.h"
+
+class SpeechInputEnableSwitchTest : public InProcessBrowserTest {
+ public:
+ GURL testUrl(const FilePath::CharType* filename) {
+ const FilePath kTestDir(FILE_PATH_LITERAL("speech"));
+ return ui_test_utils::GetTestUrl(kTestDir, FilePath(filename));
+ }
+};
+
+IN_PROC_BROWSER_TEST_F(SpeechInputEnableSwitchTest, UnavailabilityTest) {
+ // Test that speech input is not available to a web page if
+ // the runtime switch is disabled.
+
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ bool has_switch = command_line.HasSwitch(switches::kEnableSpeechInput);
+ ASSERT_FALSE(has_switch) << "This test does not make sense if "
+ << "--enable-speech-input is set.";
+
+ GURL test_url = testUrl(
+ FILE_PATH_LITERAL("enable_speech_input_switch_test.html"));
+ ui_test_utils::NavigateToURL(browser(), test_url);
+ std::string status = browser()->GetSelectedTabContents()->GetURL().ref();
+ EXPECT_EQ("pass", status) << "Page detected speech input properties.";
+}
+
« 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