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 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1468 EXPECT_TRUE(UpdateSearchState(overlay)); | 1468 EXPECT_TRUE(UpdateSearchState(overlay)); |
1469 EXPECT_EQ(0, on_native_suggestions_calls_); | 1469 EXPECT_EQ(0, on_native_suggestions_calls_); |
1470 | 1470 |
1471 SetOmniboxTextAndWaitForOverlayToShow("railroad"); | 1471 SetOmniboxTextAndWaitForOverlayToShow("railroad"); |
1472 | 1472 |
1473 EXPECT_EQ(overlay, instant()->GetOverlayContents()); | 1473 EXPECT_EQ(overlay, instant()->GetOverlayContents()); |
1474 EXPECT_TRUE(UpdateSearchState(overlay)); | 1474 EXPECT_TRUE(UpdateSearchState(overlay)); |
1475 EXPECT_EQ(1, on_native_suggestions_calls_); | 1475 EXPECT_EQ(1, on_native_suggestions_calls_); |
1476 } | 1476 } |
1477 | 1477 |
1478 // Test that the local NTP doesn't end up with the local overlay's URL. | 1478 // Test that the local NTP is not preloaded. |
1479 IN_PROC_BROWSER_TEST_F(InstantExtendedTest, LocalNTPIsNotLocalOverlay) { | 1479 IN_PROC_BROWSER_TEST_F(InstantExtendedTest, LocalNTPIsNotPreloaded) { |
1480 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); | 1480 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); |
1481 | 1481 |
1482 EXPECT_EQ(instant_url(), instant()->ntp_->contents()->GetURL()); | 1482 EXPECT_EQ(instant_url(), instant()->ntp_->contents()->GetURL()); |
1483 | 1483 |
1484 // The second argument says to use only the local overlay. | 1484 // The second argument says to use only the local overlay and NTP. |
1485 instant()->SetInstantEnabled(false, true); | 1485 instant()->SetInstantEnabled(false, true); |
1486 | 1486 |
1487 EXPECT_EQ(GURL(chrome::kChromeSearchLocalNtpUrl), | 1487 EXPECT_EQ(NULL, instant()->ntp()); |
1488 instant()->ntp_->contents()->GetURL()); | |
1489 } | 1488 } |
1490 | 1489 |
1491 // Verify top bars visibility when searching on |DEFAULT| pages and switching | 1490 // Verify top bars visibility when searching on |DEFAULT| pages and switching |
1492 // between tabs. Only implemented in Views and Mac currently. | 1491 // between tabs. Only implemented in Views and Mac currently. |
1493 #if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_MACOSX) | 1492 #if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_MACOSX) |
1494 #define MAYBE_TopBarsVisibilityWhenSwitchingTabs \ | 1493 #define MAYBE_TopBarsVisibilityWhenSwitchingTabs \ |
1495 TopBarsVisibilityWhenSwitchingTabs | 1494 TopBarsVisibilityWhenSwitchingTabs |
1496 #else | 1495 #else |
1497 #define MAYBE_TopBarsVisibilityWhenSwitchingTabs \ | 1496 #define MAYBE_TopBarsVisibilityWhenSwitchingTabs \ |
1498 DISABLED_TopBarsVisibilityWhenSwitchingTabs | 1497 DISABLED_TopBarsVisibilityWhenSwitchingTabs |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1728 SendEscape(); | 1727 SendEscape(); |
1729 EXPECT_TRUE(GetStringFromJS(contents, "chrome.embeddedSearch.searchBox.value", | 1728 EXPECT_TRUE(GetStringFromJS(contents, "chrome.embeddedSearch.searchBox.value", |
1730 &query)); | 1729 &query)); |
1731 EXPECT_EQ("", query); | 1730 EXPECT_EQ("", query); |
1732 EXPECT_EQ("", GetOmniboxText()); | 1731 EXPECT_EQ("", GetOmniboxText()); |
1733 | 1732 |
1734 EXPECT_TRUE(UpdateSearchState(contents)); | 1733 EXPECT_TRUE(UpdateSearchState(contents)); |
1735 EXPECT_LT(0, on_change_calls_); | 1734 EXPECT_LT(0, on_change_calls_); |
1736 EXPECT_EQ(0, submit_count_); | 1735 EXPECT_EQ(0, submit_count_); |
1737 } | 1736 } |
OLD | NEW |