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

Side by Side Diff: chrome/renderer/chrome_content_renderer_client_browsertest.cc

Issue 23455047: InstantExtended: Send search URLs to renderers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 2 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
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/renderer/chrome_content_renderer_client.h"
6
7 #include <vector>
8
9 #include "base/command_line.h"
10 #include "chrome/common/chrome_switches.h"
11 #include "chrome/common/render_messages.h"
12 #include "chrome/test/base/chrome_render_view_test.h"
13 #include "url/gurl.h"
14
15 namespace chrome {
16
17 class InstantProcessNavigationTest : public ChromeRenderViewTest {
sky 2013/09/25 20:43:17 nit: use typedef
Jered 2013/09/25 22:23:38 Done.
18 };
19
20 TEST_F(InstantProcessNavigationTest, ForkForNavigationsFromInstantProcess) {
sky 2013/09/25 20:43:17 Add descriptions of what you're test is doing.
Jered 2013/09/25 22:23:38 Done.
21 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kInstantProcess);
22 bool unused;
23 EXPECT_TRUE(chrome_content_renderer_client_.ShouldFork(
24 GetMainFrame(), GURL("http://foo"), "GET", false, false, &unused));
25 }
26
27 TEST_F(InstantProcessNavigationTest, ForkForNavigationsToSearchURLs) {
28 chrome_content_renderer_client_.RenderThreadStarted();
29 std::vector<GURL> search_urls;
30 search_urls.push_back(GURL("http://example.com/search"));
31 chrome_render_thread_->Send(new ChromeViewMsg_SetSearchURLs(
32 search_urls, GURL("http://example.com/newtab")));
33 bool unused;
34 EXPECT_TRUE(chrome_content_renderer_client_.ShouldFork(
35 GetMainFrame(), GURL("http://example.com/newtab"), "GET", false, false,
36 &unused));
37 EXPECT_TRUE(chrome_content_renderer_client_.ShouldFork(
38 GetMainFrame(), GURL("http://example.com/search?q=foo"), "GET", false,
39 false, &unused));
40 EXPECT_FALSE(chrome_content_renderer_client_.ShouldFork(
41 GetMainFrame(), GURL("http://example.com/"), "GET", false, false,
42 &unused));
43 }
44
45 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698