OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/content_settings/host_content_settings_map.h" | 5 #include "chrome/browser/content_settings/host_content_settings_map.h" |
6 #include "chrome/browser/history/history_service_factory.h" | 6 #include "chrome/browser/history/history_service_factory.h" |
7 #include "chrome/browser/instant/instant_overlay.h" | 7 #include "chrome/browser/instant/instant_overlay.h" |
8 #include "chrome/browser/instant/instant_service.h" | 8 #include "chrome/browser/instant/instant_service.h" |
9 #include "chrome/browser/instant/instant_service_factory.h" | 9 #include "chrome/browser/instant/instant_service_factory.h" |
10 #include "chrome/browser/instant/instant_test_utils.h" | 10 #include "chrome/browser/instant/instant_test_utils.h" |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 } | 396 } |
397 | 397 |
398 // Test that Instant doesn't process URLs. | 398 // Test that Instant doesn't process URLs. |
399 IN_PROC_BROWSER_TEST_F(InstantTest, RejectsURLs) { | 399 IN_PROC_BROWSER_TEST_F(InstantTest, RejectsURLs) { |
400 ASSERT_NO_FATAL_FAILURE(SetupInstant()); | 400 ASSERT_NO_FATAL_FAILURE(SetupInstant()); |
401 FocusOmniboxAndWaitForInstantSupport(); | 401 FocusOmniboxAndWaitForInstantSupport(); |
402 | 402 |
403 // Note that we are not actually navigating to these URLs yet. We are just | 403 // Note that we are not actually navigating to these URLs yet. We are just |
404 // typing them into the omnibox (without pressing Enter) and checking that | 404 // typing them into the omnibox (without pressing Enter) and checking that |
405 // Instant doesn't try to process them. | 405 // Instant doesn't try to process them. |
406 SetOmniboxText(chrome::kChromeUICrashURL); | 406 SetOmniboxText(content::kChromeUICrashURL); |
407 EXPECT_FALSE(instant()->IsPreviewingSearchResults()); | 407 EXPECT_FALSE(instant()->IsPreviewingSearchResults()); |
408 EXPECT_TRUE(instant()->model()->mode().is_default()); | 408 EXPECT_TRUE(instant()->model()->mode().is_default()); |
409 | 409 |
410 SetOmniboxText(chrome::kChromeUIHangURL); | 410 SetOmniboxText(content::kChromeUIHangURL); |
411 EXPECT_FALSE(instant()->IsPreviewingSearchResults()); | 411 EXPECT_FALSE(instant()->IsPreviewingSearchResults()); |
412 EXPECT_TRUE(instant()->model()->mode().is_default()); | 412 EXPECT_TRUE(instant()->model()->mode().is_default()); |
413 | 413 |
414 SetOmniboxText(chrome::kChromeUIKillURL); | 414 SetOmniboxText(content::kChromeUIKillURL); |
415 EXPECT_FALSE(instant()->IsPreviewingSearchResults()); | 415 EXPECT_FALSE(instant()->IsPreviewingSearchResults()); |
416 EXPECT_TRUE(instant()->model()->mode().is_default()); | 416 EXPECT_TRUE(instant()->model()->mode().is_default()); |
417 | 417 |
418 // Make sure that the URLs were never sent to the preview page. | 418 // Make sure that the URLs were never sent to the preview page. |
419 EXPECT_TRUE(UpdateSearchState(instant()->GetPreviewContents())); | 419 EXPECT_TRUE(UpdateSearchState(instant()->GetPreviewContents())); |
420 EXPECT_EQ("", value_); | 420 EXPECT_EQ("", value_); |
421 } | 421 } |
422 | 422 |
423 // Test that Instant doesn't fire for intranet paths that look like searches. | 423 // Test that Instant doesn't fire for intranet paths that look like searches. |
424 // http://crbug.com/99836 | 424 // http://crbug.com/99836 |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 content::WebContents* active_tab = | 1000 content::WebContents* active_tab = |
1001 browser()->tab_strip_model()->GetActiveWebContents(); | 1001 browser()->tab_strip_model()->GetActiveWebContents(); |
1002 EXPECT_TRUE(instant_service->IsInstantProcess( | 1002 EXPECT_TRUE(instant_service->IsInstantProcess( |
1003 active_tab->GetRenderProcessHost()->GetID())); | 1003 active_tab->GetRenderProcessHost()->GetID())); |
1004 | 1004 |
1005 // Navigating away should change the process. | 1005 // Navigating away should change the process. |
1006 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); | 1006 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); |
1007 EXPECT_FALSE(instant_service->IsInstantProcess( | 1007 EXPECT_FALSE(instant_service->IsInstantProcess( |
1008 active_tab->GetRenderProcessHost()->GetID())); | 1008 active_tab->GetRenderProcessHost()->GetID())); |
1009 } | 1009 } |
OLD | NEW |