OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kInstantProcess); | 21 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kInstantProcess); |
22 bool unused; | 22 bool unused; |
23 EXPECT_TRUE(chrome_content_renderer_client_.ShouldFork( | 23 EXPECT_TRUE(chrome_content_renderer_client_.ShouldFork( |
24 GetMainFrame(), GURL("http://foo"), "GET", false, false, &unused)); | 24 GetMainFrame(), GURL("http://foo"), "GET", false, false, &unused)); |
25 } | 25 } |
26 | 26 |
27 // Tests that renderer-initiated navigations from a non-Instant render process | 27 // Tests that renderer-initiated navigations from a non-Instant render process |
28 // to potentially Instant URLs get bounced back to the browser to be rebucketed | 28 // to potentially Instant URLs get bounced back to the browser to be rebucketed |
29 // into an Instant renderer if necessary. | 29 // into an Instant renderer if necessary. |
30 TEST_F(InstantProcessNavigationTest, ForkForNavigationsToSearchURLs) { | 30 TEST_F(InstantProcessNavigationTest, ForkForNavigationsToSearchURLs) { |
| 31 chrome_render_thread_->set_io_message_loop_proxy( |
| 32 base::MessageLoopProxy::current()); |
31 chrome_content_renderer_client_.RenderThreadStarted(); | 33 chrome_content_renderer_client_.RenderThreadStarted(); |
32 std::vector<GURL> search_urls; | 34 std::vector<GURL> search_urls; |
33 search_urls.push_back(GURL("http://example.com/search")); | 35 search_urls.push_back(GURL("http://example.com/search")); |
34 chrome_render_thread_->Send(new ChromeViewMsg_SetSearchURLs( | 36 chrome_render_thread_->Send(new ChromeViewMsg_SetSearchURLs( |
35 search_urls, GURL("http://example.com/newtab"))); | 37 search_urls, GURL("http://example.com/newtab"))); |
36 bool unused; | 38 bool unused; |
37 EXPECT_TRUE(chrome_content_renderer_client_.ShouldFork( | 39 EXPECT_TRUE(chrome_content_renderer_client_.ShouldFork( |
38 GetMainFrame(), GURL("http://example.com/newtab"), "GET", false, false, | 40 GetMainFrame(), GURL("http://example.com/newtab"), "GET", false, false, |
39 &unused)); | 41 &unused)); |
40 EXPECT_TRUE(chrome_content_renderer_client_.ShouldFork( | 42 EXPECT_TRUE(chrome_content_renderer_client_.ShouldFork( |
41 GetMainFrame(), GURL("http://example.com/search?q=foo"), "GET", false, | 43 GetMainFrame(), GURL("http://example.com/search?q=foo"), "GET", false, |
42 false, &unused)); | 44 false, &unused)); |
43 EXPECT_FALSE(chrome_content_renderer_client_.ShouldFork( | 45 EXPECT_FALSE(chrome_content_renderer_client_.ShouldFork( |
44 GetMainFrame(), GURL("http://example.com/"), "GET", false, false, | 46 GetMainFrame(), GURL("http://example.com/"), "GET", false, false, |
45 &unused)); | 47 &unused)); |
46 } | 48 } |
OLD | NEW |