| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1949 // JPEG image. The resource also has Cache-Control: no-cache set, | 1949 // JPEG image. The resource also has Cache-Control: no-cache set, |
| 1950 // which normally requires revalidation each time. | 1950 // which normally requires revalidation each time. |
| 1951 GURL jpeg_url = test_server()->GetURL("files/post/downloads/image.jpg"); | 1951 GURL jpeg_url = test_server()->GetURL("files/post/downloads/image.jpg"); |
| 1952 ASSERT_TRUE(jpeg_url.is_valid()); | 1952 ASSERT_TRUE(jpeg_url.is_valid()); |
| 1953 WebContents* web_contents = browser()->GetSelectedWebContents(); | 1953 WebContents* web_contents = browser()->GetSelectedWebContents(); |
| 1954 ASSERT_TRUE(web_contents != NULL); | 1954 ASSERT_TRUE(web_contents != NULL); |
| 1955 ui_test_utils::WindowedNotificationObserver observer( | 1955 ui_test_utils::WindowedNotificationObserver observer( |
| 1956 content::NOTIFICATION_NAV_ENTRY_COMMITTED, | 1956 content::NOTIFICATION_NAV_ENTRY_COMMITTED, |
| 1957 content::Source<content::NavigationController>( | 1957 content::Source<content::NavigationController>( |
| 1958 &web_contents->GetController())); | 1958 &web_contents->GetController())); |
| 1959 RenderViewHost* render_view_host = web_contents->GetRenderViewHost(); | 1959 content::RenderViewHost* render_view_host = web_contents->GetRenderViewHost(); |
| 1960 ASSERT_TRUE(render_view_host != NULL); | 1960 ASSERT_TRUE(render_view_host != NULL); |
| 1961 render_view_host->ExecuteJavascriptInWebFrame( | 1961 render_view_host->ExecuteJavascriptInWebFrame( |
| 1962 string16(), ASCIIToUTF16("SubmitForm()")); | 1962 string16(), ASCIIToUTF16("SubmitForm()")); |
| 1963 observer.Wait(); | 1963 observer.Wait(); |
| 1964 EXPECT_EQ(jpeg_url, web_contents->GetURL()); | 1964 EXPECT_EQ(jpeg_url, web_contents->GetURL()); |
| 1965 | 1965 |
| 1966 // Stop the test server, and then try to save the page. If cache validation | 1966 // Stop the test server, and then try to save the page. If cache validation |
| 1967 // is not bypassed then this will fail since the server is no longer | 1967 // is not bypassed then this will fail since the server is no longer |
| 1968 // reachable. This will also fail if it tries to be retrieved via "GET" | 1968 // reachable. This will also fail if it tries to be retrieved via "GET" |
| 1969 // rather than "POST". | 1969 // rather than "POST". |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2074 "zip_file_not_found.zip", | 2074 "zip_file_not_found.zip", |
| 2075 DOWNLOAD_NAVIGATE, | 2075 DOWNLOAD_NAVIGATE, |
| 2076 DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED, | 2076 DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED, |
| 2077 false | 2077 false |
| 2078 }; | 2078 }; |
| 2079 | 2079 |
| 2080 // Do initial setup. | 2080 // Do initial setup. |
| 2081 ASSERT_TRUE(InitialSetup(false)); | 2081 ASSERT_TRUE(InitialSetup(false)); |
| 2082 DownloadFileCheckErrors(download_info); | 2082 DownloadFileCheckErrors(download_info); |
| 2083 } | 2083 } |
| OLD | NEW |