Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1110)

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 13877028: Renderer initiated navigations from non instant process should not fall into instant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing another recently added test. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/search/search.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 25 matching lines...) Expand all
36 #include "chrome/browser/media/media_capture_devices_dispatcher.h" 36 #include "chrome/browser/media/media_capture_devices_dispatcher.h"
37 #include "chrome/browser/media/media_stream_devices_controller.h" 37 #include "chrome/browser/media/media_stream_devices_controller.h"
38 #include "chrome/browser/metrics/variations/variations_service.h" 38 #include "chrome/browser/metrics/variations/variations_service.h"
39 #include "chrome/browser/net/url_request_mock_util.h" 39 #include "chrome/browser/net/url_request_mock_util.h"
40 #include "chrome/browser/plugins/plugin_prefs.h" 40 #include "chrome/browser/plugins/plugin_prefs.h"
41 #include "chrome/browser/policy/browser_policy_connector.h" 41 #include "chrome/browser/policy/browser_policy_connector.h"
42 #include "chrome/browser/policy/mock_configuration_policy_provider.h" 42 #include "chrome/browser/policy/mock_configuration_policy_provider.h"
43 #include "chrome/browser/policy/policy_map.h" 43 #include "chrome/browser/policy/policy_map.h"
44 #include "chrome/browser/prefs/session_startup_pref.h" 44 #include "chrome/browser/prefs/session_startup_pref.h"
45 #include "chrome/browser/profiles/profile.h" 45 #include "chrome/browser/profiles/profile.h"
46 #include "chrome/browser/search/instant_service.h"
47 #include "chrome/browser/search/instant_service_factory.h"
48 #include "chrome/browser/search/search.h" 46 #include "chrome/browser/search/search.h"
49 #include "chrome/browser/search_engines/template_url.h" 47 #include "chrome/browser/search_engines/template_url.h"
50 #include "chrome/browser/search_engines/template_url_service.h" 48 #include "chrome/browser/search_engines/template_url_service.h"
51 #include "chrome/browser/search_engines/template_url_service_factory.h" 49 #include "chrome/browser/search_engines/template_url_service_factory.h"
52 #include "chrome/browser/translate/translate_infobar_delegate.h" 50 #include "chrome/browser/translate/translate_infobar_delegate.h"
53 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" 51 #include "chrome/browser/ui/bookmarks/bookmark_bar.h"
54 #include "chrome/browser/ui/browser.h" 52 #include "chrome/browser/ui/browser.h"
55 #include "chrome/browser/ui/browser_commands.h" 53 #include "chrome/browser/ui/browser_commands.h"
56 #include "chrome/browser/ui/browser_list.h" 54 #include "chrome/browser/ui/browser_list.h"
57 #include "chrome/browser/ui/browser_tabstrip.h" 55 #include "chrome/browser/ui/browser_tabstrip.h"
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 UpdateProviderPolicy(policies); 873 UpdateProviderPolicy(policies);
876 default_search = service->GetDefaultSearchProvider(); 874 default_search = service->GetDefaultSearchProvider();
877 ASSERT_TRUE(default_search); 875 ASSERT_TRUE(default_search);
878 EXPECT_EQ(kKeyword, default_search->keyword()); 876 EXPECT_EQ(kKeyword, default_search->keyword());
879 EXPECT_EQ(kSearchURL, default_search->url()); 877 EXPECT_EQ(kSearchURL, default_search->url());
880 EXPECT_EQ(kInstantURL, default_search->instant_url()); 878 EXPECT_EQ(kInstantURL, default_search->instant_url());
881 EXPECT_EQ(2U, default_search->alternate_urls().size()); 879 EXPECT_EQ(2U, default_search->alternate_urls().size());
882 EXPECT_EQ(kAlternateURL0, default_search->alternate_urls()[0]); 880 EXPECT_EQ(kAlternateURL0, default_search->alternate_urls()[0]);
883 EXPECT_EQ(kAlternateURL1, default_search->alternate_urls()[1]); 881 EXPECT_EQ(kAlternateURL1, default_search->alternate_urls()[1]);
884 882
885 // Query terms replacement requires that the renderer process be a recognized
886 // Instant renderer. Fake it.
887 InstantService* instant_service =
888 InstantServiceFactory::GetForProfile(browser()->profile());
889 instant_service->AddInstantProcess(browser()->tab_strip_model()->
890 GetActiveWebContents()->GetRenderProcessHost()->GetID());
891
892 // Verify that searching from the omnibox does search term replacement with 883 // Verify that searching from the omnibox does search term replacement with
893 // first URL pattern. 884 // first URL pattern.
894 chrome::FocusLocationBar(browser()); 885 chrome::FocusLocationBar(browser());
895 LocationBar* location_bar = browser()->window()->GetLocationBar(); 886 LocationBar* location_bar = browser()->window()->GetLocationBar();
896 ui_test_utils::SendToOmniboxAndSubmit(location_bar, 887 ui_test_utils::SendToOmniboxAndSubmit(location_bar,
897 "https://www.google.com/?espv=1#q=foobar"); 888 "https://www.google.com/?espv=1#q=foobar");
898 OmniboxEditModel* model = location_bar->GetLocationEntry()->model(); 889 OmniboxEditModel* model = location_bar->GetLocationEntry()->model();
899 EXPECT_TRUE(model->CurrentMatch().destination_url.is_valid()); 890 EXPECT_TRUE(model->CurrentMatch().destination_url.is_valid());
900 EXPECT_EQ(ASCIIToUTF16("foobar"), model->CurrentMatch().contents); 891 EXPECT_EQ(ASCIIToUTF16("foobar"), model->CurrentMatch().contents);
901 892
(...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after
2080 chrome_variations::VariationsService::GetVariationsServerURL( 2071 chrome_variations::VariationsService::GetVariationsServerURL(
2081 g_browser_process->local_state()); 2072 g_browser_process->local_state());
2082 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); 2073 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true));
2083 std::string value; 2074 std::string value;
2084 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); 2075 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value));
2085 EXPECT_EQ("restricted", value); 2076 EXPECT_EQ("restricted", value);
2086 } 2077 }
2087 #endif 2078 #endif
2088 2079
2089 } // namespace policy 2080 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/search/search.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698