| 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 147 |
| 148 DISALLOW_COPY_AND_ASSIGN(TrackingResourceDispatcherHostDelegate); | 148 DISALLOW_COPY_AND_ASSIGN(TrackingResourceDispatcherHostDelegate); |
| 149 }; | 149 }; |
| 150 | 150 |
| 151 // WebContentsDelegate that fails to open a URL when there's a request that | 151 // WebContentsDelegate that fails to open a URL when there's a request that |
| 152 // needs to be transferred between renderers. | 152 // needs to be transferred between renderers. |
| 153 class NoTransferRequestDelegate : public WebContentsDelegate { | 153 class NoTransferRequestDelegate : public WebContentsDelegate { |
| 154 public: | 154 public: |
| 155 NoTransferRequestDelegate() {} | 155 NoTransferRequestDelegate() {} |
| 156 | 156 |
| 157 bool ShouldTransferNavigation() override { | 157 bool ShouldTransferNavigation(bool is_main_frame_navigation) override { |
| 158 // Intentionally cancel the transfer. | 158 // Intentionally cancel the transfer. |
| 159 return false; | 159 return false; |
| 160 } | 160 } |
| 161 | 161 |
| 162 private: | 162 private: |
| 163 DISALLOW_COPY_AND_ASSIGN(NoTransferRequestDelegate); | 163 DISALLOW_COPY_AND_ASSIGN(NoTransferRequestDelegate); |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 class CrossSiteTransferTest : public ContentBrowserTest { | 166 class CrossSiteTransferTest : public ContentBrowserTest { |
| 167 public: | 167 public: |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 "document.getElementsByTagName('pre')[0].innerText);", | 489 "document.getElementsByTagName('pre')[0].innerText);", |
| 490 &actual_page_body)); | 490 &actual_page_body)); |
| 491 EXPECT_THAT(actual_page_body, ::testing::HasSubstr(file_content)); | 491 EXPECT_THAT(actual_page_body, ::testing::HasSubstr(file_content)); |
| 492 EXPECT_THAT(actual_page_body, | 492 EXPECT_THAT(actual_page_body, |
| 493 ::testing::HasSubstr(file_path.BaseName().AsUTF8Unsafe())); | 493 ::testing::HasSubstr(file_path.BaseName().AsUTF8Unsafe())); |
| 494 EXPECT_THAT(actual_page_body, | 494 EXPECT_THAT(actual_page_body, |
| 495 ::testing::HasSubstr("form-data; name=\"file\"")); | 495 ::testing::HasSubstr("form-data; name=\"file\"")); |
| 496 } | 496 } |
| 497 | 497 |
| 498 } // namespace content | 498 } // namespace content |
| OLD | NEW |