| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/public/browser/resource_dispatcher_host.h" | 5 #include "content/public/browser/resource_dispatcher_host.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 // already has LOFI_OFF. | 794 // already has LOFI_OFF. |
| 795 IN_PROC_BROWSER_TEST_F(PreviewsStateResourceDispatcherHostBrowserTest, | 795 IN_PROC_BROWSER_TEST_F(PreviewsStateResourceDispatcherHostBrowserTest, |
| 796 ShouldEnableLoFiModeReloadDisableLoFi) { | 796 ShouldEnableLoFiModeReloadDisableLoFi) { |
| 797 // Navigate with GetPreviewsState returning SERVER_LOFI_ON. | 797 // Navigate with GetPreviewsState returning SERVER_LOFI_ON. |
| 798 Reset(SERVER_LOFI_ON); | 798 Reset(SERVER_LOFI_ON); |
| 799 NavigateToURLBlockUntilNavigationsComplete( | 799 NavigateToURLBlockUntilNavigationsComplete( |
| 800 shell(), embedded_test_server()->GetURL("/page_with_iframe.html"), 1); | 800 shell(), embedded_test_server()->GetURL("/page_with_iframe.html"), 1); |
| 801 CheckResourcesRequested(true); | 801 CheckResourcesRequested(true); |
| 802 | 802 |
| 803 // Reload with Lo-Fi disabled. | 803 // Reload with Lo-Fi disabled. |
| 804 Reset(PREVIEWS_NO_TRANSFORM); | 804 Reset(PREVIEWS_OFF); |
| 805 TestNavigationObserver tab_observer(shell()->web_contents(), 1); | 805 TestNavigationObserver tab_observer(shell()->web_contents(), 1); |
| 806 shell()->web_contents()->GetController().Reload(ReloadType::DISABLE_LOFI_MODE, | 806 shell()->web_contents()->GetController().Reload(ReloadType::DISABLE_LOFI_MODE, |
| 807 true); | 807 true); |
| 808 tab_observer.Wait(); | 808 tab_observer.Wait(); |
| 809 CheckResourcesRequested(false); | 809 CheckResourcesRequested(false); |
| 810 } | 810 } |
| 811 | 811 |
| 812 namespace { | 812 namespace { |
| 813 | 813 |
| 814 struct RequestDataForDelegate { | 814 struct RequestDataForDelegate { |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1137 EXPECT_EQ(top_origin, delegate_->data()[2]->initiator); | 1137 EXPECT_EQ(top_origin, delegate_->data()[2]->initiator); |
| 1138 | 1138 |
| 1139 // Cross-origin subresource requests have a unique first-party, and an | 1139 // Cross-origin subresource requests have a unique first-party, and an |
| 1140 // initiator that matches the document in which they're embedded. | 1140 // initiator that matches the document in which they're embedded. |
| 1141 EXPECT_EQ(nested_js_url, delegate_->data()[3]->url); | 1141 EXPECT_EQ(nested_js_url, delegate_->data()[3]->url); |
| 1142 EXPECT_EQ(kURLWithUniqueOrigin, delegate_->data()[3]->first_party); | 1142 EXPECT_EQ(kURLWithUniqueOrigin, delegate_->data()[3]->first_party); |
| 1143 EXPECT_EQ(nested_origin, delegate_->data()[3]->initiator); | 1143 EXPECT_EQ(nested_origin, delegate_->data()[3]->initiator); |
| 1144 } | 1144 } |
| 1145 | 1145 |
| 1146 } // namespace content | 1146 } // namespace content |
| OLD | NEW |