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" |
11 #include "chrome/common/render_messages.h" | 11 #include "chrome/common/render_messages.h" |
12 #include "chrome/test/base/chrome_render_view_test.h" | 12 #include "chrome/test/base/chrome_render_view_test.h" |
13 #include "url/gurl.h" | 13 #include "url/gurl.h" |
14 | 14 |
15 namespace chrome { | |
16 | |
17 typedef ChromeRenderViewTest InstantProcessNavigationTest; | 15 typedef ChromeRenderViewTest InstantProcessNavigationTest; |
18 | 16 |
19 // Tests that renderer-initiated navigations from an Instant render process get | 17 // Tests that renderer-initiated navigations from an Instant render process get |
20 // bounced back to the browser to be rebucketed into a non-Instant renderer if | 18 // bounced back to the browser to be rebucketed into a non-Instant renderer if |
21 // necessary. | 19 // necessary. |
22 TEST_F(InstantProcessNavigationTest, ForkForNavigationsFromInstantProcess) { | 20 TEST_F(InstantProcessNavigationTest, ForkForNavigationsFromInstantProcess) { |
23 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kInstantProcess); | 21 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kInstantProcess); |
24 bool unused; | 22 bool unused; |
25 EXPECT_TRUE(chrome_content_renderer_client_.ShouldFork( | 23 EXPECT_TRUE(chrome_content_renderer_client_.ShouldFork( |
26 GetMainFrame(), GURL("http://foo"), "GET", false, false, &unused)); | 24 GetMainFrame(), GURL("http://foo"), "GET", false, false, &unused)); |
(...skipping 12 matching lines...) Expand all Loading... |
39 EXPECT_TRUE(chrome_content_renderer_client_.ShouldFork( | 37 EXPECT_TRUE(chrome_content_renderer_client_.ShouldFork( |
40 GetMainFrame(), GURL("http://example.com/newtab"), "GET", false, false, | 38 GetMainFrame(), GURL("http://example.com/newtab"), "GET", false, false, |
41 &unused)); | 39 &unused)); |
42 EXPECT_TRUE(chrome_content_renderer_client_.ShouldFork( | 40 EXPECT_TRUE(chrome_content_renderer_client_.ShouldFork( |
43 GetMainFrame(), GURL("http://example.com/search?q=foo"), "GET", false, | 41 GetMainFrame(), GURL("http://example.com/search?q=foo"), "GET", false, |
44 false, &unused)); | 42 false, &unused)); |
45 EXPECT_FALSE(chrome_content_renderer_client_.ShouldFork( | 43 EXPECT_FALSE(chrome_content_renderer_client_.ShouldFork( |
46 GetMainFrame(), GURL("http://example.com/"), "GET", false, false, | 44 GetMainFrame(), GURL("http://example.com/"), "GET", false, false, |
47 &unused)); | 45 &unused)); |
48 } | 46 } |
49 | |
50 } // namespace chrome | |
OLD | NEW |