Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "chrome/browser/instant/instant_loader.h" | 5 #include "chrome/browser/instant/instant_loader.h" |
| 6 #include "chrome/browser/instant/instant_test_utils.h" | 6 #include "chrome/browser/instant/instant_test_utils.h" |
| 7 #include "chrome/browser/ui/search/search.h" | 7 #include "chrome/browser/ui/search/search.h" |
| 8 #include "chrome/browser/ui/tabs/tab_strip_model.h" | |
| 8 #include "chrome/test/base/interactive_test_utils.h" | 9 #include "chrome/test/base/interactive_test_utils.h" |
| 9 #include "chrome/test/base/ui_test_utils.h" | 10 #include "chrome/test/base/ui_test_utils.h" |
| 10 | 11 |
| 11 class InstantExtendedTest : public InstantTestBase { | 12 class InstantExtendedTest : public InstantTestBase { |
| 12 protected: | 13 protected: |
| 13 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 14 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 14 chrome::search::EnableInstantExtendedAPIForTesting(); | 15 chrome::search::EnableInstantExtendedAPIForTesting(); |
| 15 ASSERT_TRUE(test_server()->Start()); | 16 ASSERT_TRUE(test_server()->Start()); |
| 16 instant_url_ = test_server()->GetURL("files/instant_extended.html"); | 17 instant_url_ = test_server()->GetURL("files/instant_extended.html"); |
| 17 } | 18 } |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 content::WebContents* preview_tab = instant()->GetPreviewContents(); | 74 content::WebContents* preview_tab = instant()->GetPreviewContents(); |
| 74 EXPECT_TRUE(preview_tab); | 75 EXPECT_TRUE(preview_tab); |
| 75 EXPECT_FALSE(instant()->IsPreviewingSearchResults()); | 76 EXPECT_FALSE(instant()->IsPreviewingSearchResults()); |
| 76 EXPECT_TRUE(instant()->model()->mode().is_default()); | 77 EXPECT_TRUE(instant()->model()->mode().is_default()); |
| 77 | 78 |
| 78 // Typing in the omnibox should show the overlay. | 79 // Typing in the omnibox should show the overlay. |
| 79 SetOmniboxTextAndWaitForInstantToShow("query"); | 80 SetOmniboxTextAndWaitForInstantToShow("query"); |
| 80 EXPECT_TRUE(instant()->model()->mode().is_search_suggestions()); | 81 EXPECT_TRUE(instant()->model()->mode().is_search_suggestions()); |
| 81 EXPECT_EQ(preview_tab, instant()->GetPreviewContents()); | 82 EXPECT_EQ(preview_tab, instant()->GetPreviewContents()); |
| 82 } | 83 } |
| 84 | |
| 85 // Test that middle clicking on a suggestion opens the result in a new tab. | |
| 86 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.
| |
| 87 ASSERT_NO_FATAL_FAILURE(SetupInstant()); | |
| 88 FocusOmniboxAndWaitForInstantSupport(); | |
| 89 | |
| 90 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.
| |
| 91 instant()->NavigateToURL(url, content::PAGE_TRANSITION_TYPED, NEW_BACKGROUND_T AB); | |
|
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.
| |
| 92 | |
| 93 // Check that we have two tabs and that the new active tab is indeed what was | |
| 94 // once the preview. The preview tab should have just one navigation entry, | |
| 95 // for the Instant search that was committed. | |
| 96 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.
| |
| 97 } | |
| OLD | NEW |