OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "content/browser/loader/cross_site_resource_handler.h" | 7 #include "content/browser/loader/cross_site_resource_handler.h" |
8 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 8 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
9 #include "content/browser/loader/resource_request_info_impl.h" | 9 #include "content/browser/loader/resource_request_info_impl.h" |
10 #include "content/browser/transition_request_manager.h" | 10 #include "content/browser/transition_request_manager.h" |
11 #include "content/browser/web_contents/web_contents_impl.h" | 11 #include "content/browser/web_contents/web_contents_impl.h" |
12 #include "content/public/browser/web_contents_observer.h" | 12 #include "content/public/browser/web_contents_observer.h" |
13 #include "content/public/common/content_switches.h" | 13 #include "content/public/common/content_switches.h" |
14 #include "content/public/test/browser_test_utils.h" | 14 #include "content/public/test/browser_test_utils.h" |
15 #include "content/public/test/content_browser_test.h" | 15 #include "content/public/test/content_browser_test.h" |
16 #include "content/public/test/content_browser_test_utils.h" | 16 #include "content/public/test/content_browser_test_utils.h" |
17 #include "content/public/test/test_utils.h" | 17 #include "content/public/test/test_utils.h" |
18 #include "content/shell/browser/shell.h" | 18 #include "content/shell/browser/shell.h" |
19 #include "content/shell/browser/shell_resource_dispatcher_host_delegate.h" | 19 #include "content/shell/browser/shell_resource_dispatcher_host_delegate.h" |
20 #include "net/test/embedded_test_server/embedded_test_server.h" | 20 #include "net/test/embedded_test_server/embedded_test_server.h" |
21 #include "net/url_request/url_request.h" | 21 #include "net/url_request/url_request.h" |
22 | 22 |
23 namespace content { | 23 namespace content { |
24 | 24 |
25 class TransitionBrowserTest : public ContentBrowserTest { | 25 class TransitionBrowserTest : public ContentBrowserTest { |
26 public: | 26 public: |
27 TransitionBrowserTest() {} | 27 TransitionBrowserTest() {} |
28 | 28 |
29 void SetUpCommandLine(CommandLine* command_line) override { | 29 void SetUpCommandLine(base::CommandLine* command_line) override { |
30 command_line->AppendSwitch( | 30 command_line->AppendSwitch( |
31 switches::kEnableExperimentalWebPlatformFeatures); | 31 switches::kEnableExperimentalWebPlatformFeatures); |
32 } | 32 } |
33 | 33 |
34 private: | 34 private: |
35 DISALLOW_COPY_AND_ASSIGN(TransitionBrowserTest); | 35 DISALLOW_COPY_AND_ASSIGN(TransitionBrowserTest); |
36 }; | 36 }; |
37 | 37 |
38 class TransitionBrowserTestObserver | 38 class TransitionBrowserTestObserver |
39 : public WebContentsObserver, | 39 : public WebContentsObserver, |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 ResourceDispatcherHost::Get()->SetDelegate(observer.get()); | 182 ResourceDispatcherHost::Get()->SetDelegate(observer.get()); |
183 observer->set_pending_transition_request(true); | 183 observer->set_pending_transition_request(true); |
184 | 184 |
185 NavigateToURL(shell(), embedded_test_server()->GetURL("/title1.html")); | 185 NavigateToURL(shell(), embedded_test_server()->GetURL("/title1.html")); |
186 WaitForLoadStop(shell()->web_contents()); | 186 WaitForLoadStop(shell()->web_contents()); |
187 | 187 |
188 EXPECT_TRUE(observer->did_clear_data()); | 188 EXPECT_TRUE(observer->did_clear_data()); |
189 } | 189 } |
190 | 190 |
191 } // namespace content | 191 } // namespace content |
OLD | NEW |