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

Side by Side Diff: content/browser/speech/speech_recognition_browsertest.cc

Issue 959123004: Remove usage of WebContents::GetURL from speech recognition test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <list> 5 #include <list>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 GetGoodSpeechResult()); 87 GetGoodSpeechResult());
88 } 88 }
89 89
90 // Helper methods used by test fixtures. 90 // Helper methods used by test fixtures.
91 GURL GetTestUrlFromFragment(const std::string fragment) { 91 GURL GetTestUrlFromFragment(const std::string fragment) {
92 return GURL(GetTestUrl("speech", "web_speech_recognition.html").spec() + 92 return GURL(GetTestUrl("speech", "web_speech_recognition.html").spec() +
93 "#" + fragment); 93 "#" + fragment);
94 } 94 }
95 95
96 std::string GetPageFragment() { 96 std::string GetPageFragment() {
97 return shell()->web_contents()->GetURL().ref(); 97 return shell()->web_contents()->GetLastCommittedURL().ref();
98 } 98 }
99 99
100 const StreamingServerState &streaming_server_state() { 100 const StreamingServerState &streaming_server_state() {
101 return streaming_server_state_; 101 return streaming_server_state_;
102 } 102 }
103 103
104 protected: 104 protected:
105 // ContentBrowserTest methods. 105 // ContentBrowserTest methods.
106 void SetUpInProcessBrowserTestFixture() override { 106 void SetUpInProcessBrowserTestFixture() override {
107 test_audio_input_controller_factory_.set_delegate(this); 107 test_audio_input_controller_factory_.set_delegate(this);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 IN_PROC_BROWSER_TEST_F(SpeechRecognitionBrowserTest, OneShotRecognition) { 200 IN_PROC_BROWSER_TEST_F(SpeechRecognitionBrowserTest, OneShotRecognition) {
201 NavigateToURLBlockUntilNavigationsComplete( 201 NavigateToURLBlockUntilNavigationsComplete(
202 shell(), GetTestUrlFromFragment("oneshot"), 2); 202 shell(), GetTestUrlFromFragment("oneshot"), 2);
203 203
204 EXPECT_EQ(kClientDisconnected, streaming_server_state()); 204 EXPECT_EQ(kClientDisconnected, streaming_server_state());
205 EXPECT_EQ("goodresult1", GetPageFragment()); 205 EXPECT_EQ("goodresult1", GetPageFragment());
206 } 206 }
207 207
208 } // namespace content 208 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698