| 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/stringprintf.h" | 5 #include "base/stringprintf.h" |
| 6 #include "chrome/browser/content_settings/host_content_settings_map.h" | 6 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 7 #include "chrome/browser/history/history_service_factory.h" | 7 #include "chrome/browser/history/history_service_factory.h" |
| 8 #include "chrome/browser/instant/instant_controller.h" | 8 #include "chrome/browser/instant/instant_controller.h" |
| 9 #include "chrome/browser/instant/instant_loader.h" | 9 #include "chrome/browser/instant/instant_loader.h" |
| 10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| (...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 base::Bind(&KeywordQueryDone, &run_loop3, &queries)); | 814 base::Bind(&KeywordQueryDone, &run_loop3, &queries)); |
| 815 run_loop3.Run(); | 815 run_loop3.Run(); |
| 816 ASSERT_TRUE(queries.size()); | 816 ASSERT_TRUE(queries.size()); |
| 817 EXPECT_EQ(ASCIIToUTF16("search"), queries[0]); | 817 EXPECT_EQ(ASCIIToUTF16("search"), queries[0]); |
| 818 } | 818 } |
| 819 | 819 |
| 820 // Test that creating a new window hides any currently showing Instant preview. | 820 // Test that creating a new window hides any currently showing Instant preview. |
| 821 IN_PROC_BROWSER_TEST_F(InstantTest, NewWindowDismissesInstant) { | 821 IN_PROC_BROWSER_TEST_F(InstantTest, NewWindowDismissesInstant) { |
| 822 ASSERT_NO_FATAL_FAILURE(SetupInstant("instant.html")); | 822 ASSERT_NO_FATAL_FAILURE(SetupInstant("instant.html")); |
| 823 EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | 823 EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
| 824 base::RunLoop().RunUntilIdle(); | |
| 825 SetOmniboxTextAndWaitForInstantToShow("search"); | 824 SetOmniboxTextAndWaitForInstantToShow("search"); |
| 826 | 825 |
| 827 Browser* previous_window = browser(); | 826 Browser* previous_window = browser(); |
| 828 EXPECT_TRUE(instant()->IsCurrent()); | 827 EXPECT_TRUE(instant()->IsCurrent()); |
| 829 EXPECT_TRUE(instant()->is_showing()); | 828 EXPECT_TRUE(instant()->is_showing()); |
| 830 | 829 |
| 831 content::WindowedNotificationObserver instant_hidden_observer( | 830 content::WindowedNotificationObserver instant_hidden_observer( |
| 832 chrome::NOTIFICATION_INSTANT_CONTROLLER_HIDDEN, | 831 chrome::NOTIFICATION_INSTANT_CONTROLLER_HIDDEN, |
| 833 content::NotificationService::AllSources()); | 832 content::NotificationService::AllSources()); |
| 834 chrome::NewEmptyWindow(browser()->profile()); | 833 chrome::NewEmptyWindow(browser()->profile()); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 EXPECT_EQ(WideToUTF16(L"\u0130NSTANT"), omnibox()->GetText()); | 905 EXPECT_EQ(WideToUTF16(L"\u0130NSTANT"), omnibox()->GetText()); |
| 907 | 906 |
| 908 instant()->Hide(); | 907 instant()->Hide(); |
| 909 SetOmniboxTextAndWaitForInstantToShow("in"); | 908 SetOmniboxTextAndWaitForInstantToShow("in"); |
| 910 EXPECT_EQ(ASCIIToUTF16("in"), omnibox()->GetText()); | 909 EXPECT_EQ(ASCIIToUTF16("in"), omnibox()->GetText()); |
| 911 | 910 |
| 912 instant()->Hide(); | 911 instant()->Hide(); |
| 913 SetOmniboxTextAndWaitForInstantToShow("IN"); | 912 SetOmniboxTextAndWaitForInstantToShow("IN"); |
| 914 EXPECT_EQ(ASCIIToUTF16("IN"), omnibox()->GetText()); | 913 EXPECT_EQ(ASCIIToUTF16("IN"), omnibox()->GetText()); |
| 915 } | 914 } |
| OLD | NEW |