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

Unified Diff: chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc

Issue 148343008: Speech Recognition API: Safeguarding against page closes during startup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments Created 6 years, 10 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
Index: chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc
diff --git a/chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc b/chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc
index 0ee92b6e4492f2b2e759d1af8633b8d91015d3f4..80f2de7fbc38646a2905bc4198410a341cdbb2a6 100644
--- a/chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc
+++ b/chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc
@@ -11,10 +11,13 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "chrome/test/base/testing_profile.h"
+#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/render_view_host.h"
#include "content/public/test/test_browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/rect.h"
+
using content::BrowserThread;
using content::WebContents;
@@ -30,10 +33,9 @@ class MockSpeechRecognitionBubble : public SpeechRecognitionBubbleBase {
BUBBLE_TEST_CLICK_TRY_AGAIN,
};
- MockSpeechRecognitionBubble(WebContents* web_contents,
- Delegate* delegate,
- const gfx::Rect&)
- : SpeechRecognitionBubbleBase(web_contents) {
+ MockSpeechRecognitionBubble(int render_process_id, int render_view_id,
+ Delegate* delegate, const gfx::Rect&)
+ : SpeechRecognitionBubbleBase(render_process_id, render_view_id) {
VLOG(1) << "MockSpeechRecognitionBubble created";
base::MessageLoop::current()->PostTask(
FROM_HERE, base::Bind(&InvokeDelegate, delegate));
@@ -141,15 +143,7 @@ class SpeechRecognitionBubbleControllerTest
base::MessageLoop::current()->PostTask(FROM_HERE,
base::Bind(&ActivateBubble));
- // The |web_contents| parameter would be NULL since the dummy session id
- // passed to CreateBubble would not have matched any active tab. So get a
- // real WebContents pointer from the test fixture and pass that, because
- // the bubble controller registers for tab close notifications which need
- // a valid WebContents.
- web_contents =
- test_fixture_->browser()->tab_strip_model()->GetActiveWebContents();
- return new MockSpeechRecognitionBubble(web_contents, delegate,
- element_rect);
+ return new MockSpeechRecognitionBubble(0, 0, delegate, element_rect);
}
protected:

Powered by Google App Engine
This is Rietveld 408576698