| OLD | NEW |
| 1 // Copyright (c) 2011 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/string_util.h" | 6 #include "base/string_util.h" |
| 7 #include "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 9 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
| 10 #include "chrome/browser/content_settings/host_content_settings_map.h" | 10 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 11 #include "chrome/browser/instant/instant_controller.h" | 11 #include "chrome/browser/instant/instant_controller.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 22 #include "chrome/browser/ui/omnibox/location_bar.h" | 22 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 23 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 23 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
| 24 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 24 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 25 #include "chrome/common/chrome_notification_types.h" | 25 #include "chrome/common/chrome_notification_types.h" |
| 26 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
| 27 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
| 28 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
| 29 #include "chrome/test/base/in_process_browser_test.h" | 29 #include "chrome/test/base/in_process_browser_test.h" |
| 30 #include "chrome/test/base/ui_test_utils.h" | 30 #include "chrome/test/base/ui_test_utils.h" |
| 31 #include "content/browser/renderer_host/render_view_host.h" | 31 #include "content/browser/renderer_host/render_view_host.h" |
| 32 #include "content/browser/renderer_host/render_widget_host_view.h" | |
| 33 #include "content/public/browser/navigation_controller.h" | 32 #include "content/public/browser/navigation_controller.h" |
| 34 #include "content/public/browser/notification_service.h" | 33 #include "content/public/browser/notification_service.h" |
| 34 #include "content/public/browser/render_widget_host_view.h" |
| 35 #include "content/public/browser/web_contents.h" | 35 #include "content/public/browser/web_contents.h" |
| 36 #include "grit/generated_resources.h" | 36 #include "grit/generated_resources.h" |
| 37 #include "ui/base/l10n/l10n_util.h" | 37 #include "ui/base/l10n/l10n_util.h" |
| 38 | 38 |
| 39 using content::WebContents; | 39 using content::WebContents; |
| 40 | 40 |
| 41 // Tests are flaky on Linux because of http://crbug.com/80118. | 41 // Tests are flaky on Linux because of http://crbug.com/80118. |
| 42 #if defined(OS_LINUX) | 42 #if defined(OS_LINUX) |
| 43 #define MAYBE(TestName) DISABLED_ ## TestName | 43 #define MAYBE(TestName) DISABLED_ ## TestName |
| 44 #else | 44 #else |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 // used in this test (instant.html) doesn't support initScript, so we have to | 561 // used in this test (instant.html) doesn't support initScript, so we have to |
| 562 // trigger an onchange ourselves. | 562 // trigger an onchange ourselves. |
| 563 SearchAndWaitForPreviewToShow(); | 563 SearchAndWaitForPreviewToShow(); |
| 564 | 564 |
| 565 // We should now be showing the preview. | 565 // We should now be showing the preview. |
| 566 EXPECT_TRUE(preview()); | 566 EXPECT_TRUE(preview()); |
| 567 EXPECT_TRUE(loader()->ready()); | 567 EXPECT_TRUE(loader()->ready()); |
| 568 EXPECT_TRUE(instant()->is_displayable()); | 568 EXPECT_TRUE(instant()->is_displayable()); |
| 569 EXPECT_TRUE(instant()->IsCurrent()); | 569 EXPECT_TRUE(instant()->IsCurrent()); |
| 570 | 570 |
| 571 RenderWidgetHostView* rwhv = | 571 content::RenderWidgetHostView* rwhv = |
| 572 preview()->web_contents()->GetRenderWidgetHostView(); | 572 preview()->web_contents()->GetRenderWidgetHostView(); |
| 573 EXPECT_TRUE(rwhv); | 573 EXPECT_TRUE(rwhv); |
| 574 EXPECT_TRUE(rwhv->IsShowing()); | 574 EXPECT_TRUE(rwhv->IsShowing()); |
| 575 } | 575 } |
| 576 | 576 |
| 577 // Transition from search to non-search and make sure instant isn't displayable. | 577 // Transition from search to non-search and make sure instant isn't displayable. |
| 578 // See bug http://crbug.com/100368 for details. | 578 // See bug http://crbug.com/100368 for details. |
| 579 IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE(SearchToNonSearch)) { | 579 IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE(SearchToNonSearch)) { |
| 580 ASSERT_TRUE(test_server()->Start()); | 580 ASSERT_TRUE(test_server()->Start()); |
| 581 EnableInstant(); | 581 EnableInstant(); |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1001 // Press <Enter> in the omnibox, causing the preview to be committed. | 1001 // Press <Enter> in the omnibox, causing the preview to be committed. |
| 1002 WebContents* preview_tab = preview()->web_contents(); | 1002 WebContents* preview_tab = preview()->web_contents(); |
| 1003 ASSERT_TRUE(PressEnter()); | 1003 ASSERT_TRUE(PressEnter()); |
| 1004 | 1004 |
| 1005 // The preview contents should now be the active tab contents. | 1005 // The preview contents should now be the active tab contents. |
| 1006 EXPECT_FALSE(preview()); | 1006 EXPECT_FALSE(preview()); |
| 1007 EXPECT_FALSE(instant()->is_displayable()); | 1007 EXPECT_FALSE(instant()->is_displayable()); |
| 1008 EXPECT_FALSE(instant()->IsCurrent()); | 1008 EXPECT_FALSE(instant()->IsCurrent()); |
| 1009 EXPECT_EQ(preview_tab, browser()->GetSelectedWebContents()); | 1009 EXPECT_EQ(preview_tab, browser()->GetSelectedWebContents()); |
| 1010 } | 1010 } |
| OLD | NEW |