| 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 <sstream> | 5 #include <sstream> |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 } | 80 } |
| 81 protected: | 81 protected: |
| 82 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 82 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 83 chrome::EnableInstantExtendedAPIForTesting(); | 83 chrome::EnableInstantExtendedAPIForTesting(); |
| 84 ASSERT_TRUE(https_test_server().Start()); | 84 ASSERT_TRUE(https_test_server().Start()); |
| 85 GURL instant_url = https_test_server().GetURL( | 85 GURL instant_url = https_test_server().GetURL( |
| 86 "files/instant_extended.html?strk=1&"); | 86 "files/instant_extended.html?strk=1&"); |
| 87 InstantTestBase::Init(instant_url); | 87 InstantTestBase::Init(instant_url); |
| 88 } | 88 } |
| 89 | 89 |
| 90 virtual void SetUpOnMainThread() OVERRIDE { |
| 91 browser()->toolbar_model()->SetSupportsExtractionOfURLLikeSearchTerms(true); |
| 92 } |
| 93 |
| 90 std::string GetOmniboxText() { | 94 std::string GetOmniboxText() { |
| 91 return UTF16ToUTF8(omnibox()->GetText()); | 95 return UTF16ToUTF8(omnibox()->GetText()); |
| 92 } | 96 } |
| 93 | 97 |
| 94 void SendDownArrow() { | 98 void SendDownArrow() { |
| 95 omnibox()->model()->OnUpOrDownKeyPressed(1); | 99 omnibox()->model()->OnUpOrDownKeyPressed(1); |
| 96 // Wait for JavaScript to run the key handler by executing a blank script. | 100 // Wait for JavaScript to run the key handler by executing a blank script. |
| 97 EXPECT_TRUE(ExecuteScript(std::string())); | 101 EXPECT_TRUE(ExecuteScript(std::string())); |
| 98 } | 102 } |
| 99 | 103 |
| (...skipping 1678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1778 | 1782 |
| 1779 SendDownArrow(); | 1783 SendDownArrow(); |
| 1780 EXPECT_EQ("result 1", GetOmniboxText()); | 1784 EXPECT_EQ("result 1", GetOmniboxText()); |
| 1781 | 1785 |
| 1782 // Press Enter. | 1786 // Press Enter. |
| 1783 browser()->window()->GetLocationBar()->AcceptInput(); | 1787 browser()->window()->GetLocationBar()->AcceptInput(); |
| 1784 | 1788 |
| 1785 // Confirm that the Instant overlay was NOT committed. | 1789 // Confirm that the Instant overlay was NOT committed. |
| 1786 EXPECT_NE(overlay, browser()->tab_strip_model()->GetActiveWebContents()); | 1790 EXPECT_NE(overlay, browser()->tab_strip_model()->GetActiveWebContents()); |
| 1787 } | 1791 } |
| OLD | NEW |