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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 EXPECT_TRUE(client->ShouldFork( | 45 EXPECT_TRUE(client->ShouldFork( |
46 GetMainFrame(), GURL("http://foo"), "GET", false, false, &unused)); | 46 GetMainFrame(), GURL("http://foo"), "GET", false, false, &unused)); |
47 } | 47 } |
48 | 48 |
49 // Tests that renderer-initiated navigations from a non-Instant render process | 49 // Tests that renderer-initiated navigations from a non-Instant render process |
50 // to potentially Instant URLs get bounced back to the browser to be rebucketed | 50 // to potentially Instant URLs get bounced back to the browser to be rebucketed |
51 // into an Instant renderer if necessary. | 51 // into an Instant renderer if necessary. |
52 TEST_F(InstantProcessNavigationTest, ForkForNavigationsToSearchURLs) { | 52 TEST_F(InstantProcessNavigationTest, ForkForNavigationsToSearchURLs) { |
53 ChromeContentRendererClient* client = | 53 ChromeContentRendererClient* client = |
54 static_cast<ChromeContentRendererClient*>(content_renderer_client_.get()); | 54 static_cast<ChromeContentRendererClient*>(content_renderer_client_.get()); |
55 chrome_render_thread_->set_io_message_loop_proxy( | 55 chrome_render_thread_->set_io_task_runner( |
56 base::ThreadTaskRunnerHandle::Get()); | 56 base::ThreadTaskRunnerHandle::Get()); |
57 client->RenderThreadStarted(); | 57 client->RenderThreadStarted(); |
58 std::vector<GURL> search_urls; | 58 std::vector<GURL> search_urls; |
59 search_urls.push_back(GURL("http://example.com/search")); | 59 search_urls.push_back(GURL("http://example.com/search")); |
60 chrome_render_thread_->Send(new ChromeViewMsg_SetSearchURLs( | 60 chrome_render_thread_->Send(new ChromeViewMsg_SetSearchURLs( |
61 search_urls, GURL("http://example.com/newtab"))); | 61 search_urls, GURL("http://example.com/newtab"))); |
62 bool unused; | 62 bool unused; |
63 EXPECT_TRUE(client->ShouldFork( | 63 EXPECT_TRUE(client->ShouldFork( |
64 GetMainFrame(), GURL("http://example.com/newtab"), "GET", false, false, | 64 GetMainFrame(), GURL("http://example.com/newtab"), "GET", false, false, |
65 &unused)); | 65 &unused)); |
66 EXPECT_TRUE(client->ShouldFork( | 66 EXPECT_TRUE(client->ShouldFork( |
67 GetMainFrame(), GURL("http://example.com/search?q=foo"), "GET", false, | 67 GetMainFrame(), GURL("http://example.com/search?q=foo"), "GET", false, |
68 false, &unused)); | 68 false, &unused)); |
69 EXPECT_FALSE(client->ShouldFork( | 69 EXPECT_FALSE(client->ShouldFork( |
70 GetMainFrame(), GURL("http://example.com/"), "GET", false, false, | 70 GetMainFrame(), GURL("http://example.com/"), "GET", false, false, |
71 &unused)); | 71 &unused)); |
72 } | 72 } |
OLD | NEW |