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

Unified Diff: chrome/browser/instant/instant_extended_browsertest.cc

Issue 11644009: Added support for passing WindowOpenDisposition into BrowserInstantController::OpenURL() from the o… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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/instant/instant_extended_browsertest.cc
diff --git a/chrome/browser/instant/instant_extended_browsertest.cc b/chrome/browser/instant/instant_extended_browsertest.cc
index 08f8b4d094579c90ea12e3e047faf8820e4c4b55..dbafa7c3bea955714b5779da19127a0094ae5b37 100644
--- a/chrome/browser/instant/instant_extended_browsertest.cc
+++ b/chrome/browser/instant/instant_extended_browsertest.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/instant/instant_loader.h"
#include "chrome/browser/instant/instant_test_utils.h"
#include "chrome/browser/ui/search/search.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -80,3 +81,17 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, InputShowsOverlay) {
EXPECT_TRUE(instant()->model()->mode().is_search_suggestions());
EXPECT_EQ(preview_tab, instant()->GetPreviewContents());
}
+
+// Test that middle clicking on a suggestion opens the result in a new tab.
+IN_PROC_BROWSER_TEST_F(InstantExtendedTest, MiddleClickOnSuggestionOpensInNewTab) {
sreeram 2013/01/24 19:13:48 80 column limit
dougw 2013/02/06 21:42:11 Done.
+ ASSERT_NO_FATAL_FAILURE(SetupInstant());
+ FocusOmniboxAndWaitForInstantSupport();
+
+ GURL url(std::string("http://google.com"));
sreeram 2013/01/24 19:13:48 You should assert here, before the navigation, tha
dougw 2013/02/06 21:42:11 Done.
+ instant()->NavigateToURL(url, content::PAGE_TRANSITION_TYPED, NEW_BACKGROUND_TAB);
sreeram 2013/01/24 19:13:48 80 column limit
sreeram 2013/01/24 19:13:48 I think you should actually click on the page so t
dougw 2013/02/06 21:42:11 Done.
dougw 2013/02/20 21:46:56 Done.
dougw 2013/02/20 21:46:56 Done.
+
+ // Check that we have two tabs and that the new active tab is indeed what was
+ // once the preview. The preview tab should have just one navigation entry,
+ // for the Instant search that was committed.
+ EXPECT_EQ(2, browser()->tab_strip_model()->count());
sreeram 2013/01/24 19:13:48 You're not EXPECT()ing all the things the comment
dougw 2013/02/06 21:42:11 Done.
+}

Powered by Google App Engine
This is Rietveld 408576698