OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/stringprintf.h" | 6 #include "base/stringprintf.h" |
7 #include "chrome/browser/content_settings/host_content_settings_map.h" | 7 #include "chrome/browser/content_settings/host_content_settings_map.h" |
8 #include "chrome/browser/history/history.h" | 8 #include "chrome/browser/history/history.h" |
9 #include "chrome/browser/history/history_service_factory.h" | 9 #include "chrome/browser/history/history_service_factory.h" |
10 #include "chrome/browser/instant/instant_controller.h" | 10 #include "chrome/browser/instant/instant_controller.h" |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 // is sent, since query hasn't changed. | 576 // is sent, since query hasn't changed. |
577 SetOmniboxText("search"); | 577 SetOmniboxText("search"); |
578 EXPECT_TRUE(instant()->GetPreviewContents()); | 578 EXPECT_TRUE(instant()->GetPreviewContents()); |
579 EXPECT_TRUE(instant()->IsCurrent()); | 579 EXPECT_TRUE(instant()->IsCurrent()); |
580 EXPECT_TRUE(instant()->is_showing()); | 580 EXPECT_TRUE(instant()->is_showing()); |
581 EXPECT_TRUE(UpdateSearchState(instant()->GetPreviewContents())); | 581 EXPECT_TRUE(UpdateSearchState(instant()->GetPreviewContents())); |
582 EXPECT_EQ(2, onchangecalls_); | 582 EXPECT_EQ(2, onchangecalls_); |
583 } | 583 } |
584 | 584 |
585 // Test that Instant can't be fooled into committing a URL. | 585 // Test that Instant can't be fooled into committing a URL. |
586 // Disabled: http://crbug.com/143207 | 586 IN_PROC_BROWSER_TEST_F(InstantTest, DoesNotCommitURLs) { |
587 IN_PROC_BROWSER_TEST_F(InstantTest, DISABLED_DoesNotCommitURLs) { | |
588 ASSERT_NO_FATAL_FAILURE(SetupInstant("instant.html")); | 587 ASSERT_NO_FATAL_FAILURE(SetupInstant("instant.html")); |
589 EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | 588 EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
590 | 589 |
591 // Type a URL. No Instant. | 590 // Type a URL. No Instant. |
592 SetOmniboxText("http://deadly/nadder"); | 591 SetOmniboxText("http://deadly/nadder"); |
593 EXPECT_FALSE(instant()->GetPreviewContents()); | 592 EXPECT_FALSE(instant()->GetPreviewContents()); |
594 | 593 |
595 // Unfocus and refocus the omnibox. | 594 // Unfocus and refocus the omnibox. |
596 ui_test_utils::ClickOnView(browser(), VIEW_ID_TAB_CONTAINER); | 595 ui_test_utils::ClickOnView(browser(), VIEW_ID_TAB_CONTAINER); |
597 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_TAB_CONTAINER)); | 596 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_TAB_CONTAINER)); |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 content::WindowedNotificationObserver observer( | 818 content::WindowedNotificationObserver observer( |
820 chrome::NOTIFICATION_INSTANT_CONTROLLER_HIDDEN, | 819 chrome::NOTIFICATION_INSTANT_CONTROLLER_HIDDEN, |
821 content::NotificationService::AllSources()); | 820 content::NotificationService::AllSources()); |
822 chrome::NewEmptyWindow(browser()->profile()); | 821 chrome::NewEmptyWindow(browser()->profile()); |
823 observer.Wait(); | 822 observer.Wait(); |
824 EXPECT_TRUE(instant()->GetPreviewContents()); | 823 EXPECT_TRUE(instant()->GetPreviewContents()); |
825 EXPECT_FALSE(instant()->IsCurrent()); | 824 EXPECT_FALSE(instant()->IsCurrent()); |
826 EXPECT_FALSE(instant()->is_showing()); | 825 EXPECT_FALSE(instant()->is_showing()); |
827 } | 826 } |
828 #endif | 827 #endif |
OLD | NEW |