Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: chrome/browser/download/save_page_browsertest.cc

Issue 1411253013: ABANDONED CL: Adding a save-page test that uses a custom referrer policy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@referrer-revert-to-default
Patch Set: Reuploading with no dependencies. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/test/data/save_page/b_with_referrer_policy_origin.htm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/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 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 for (;;) { 876 for (;;) {
877 pos = mhtml.find("Content-Type: image/png", pos); 877 pos = mhtml.find("Content-Type: image/png", pos);
878 if (pos == std::string::npos) 878 if (pos == std::string::npos)
879 break; 879 break;
880 count++; 880 count++;
881 pos++; 881 pos++;
882 } 882 }
883 EXPECT_EQ(1, count) << "Verify number of image/png parts in the mhtml output"; 883 EXPECT_EQ(1, count) << "Verify number of image/png parts in the mhtml output";
884 } 884 }
885 885
886 // This is a test for the crash from crbug.com/550289.
887 IN_PROC_BROWSER_TEST_F(SavePageSitePerProcessBrowserTest,
888 ReferrerPolicyOrigin) {
889 GURL url(embedded_test_server()->GetURL(
890 "a.com", "/save_page/b_with_referrer_policy_origin.htm"));
891 ui_test_utils::NavigateToURL(browser(), url);
892
893 base::FilePath full_file_name, dir;
894 SaveCurrentTab(url, content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML, "referrer", 3,
895 &dir, &full_file_name);
896 ASSERT_FALSE(HasFailure());
897
898 EXPECT_TRUE(base::PathExists(full_file_name));
899 EXPECT_TRUE(base::PathExists(dir));
900 EXPECT_TRUE(base::PathExists(dir.AppendASCII("1.css")));
901 EXPECT_TRUE(base::PathExists(dir.AppendASCII("1.png")));
902 }
903
886 } // namespace 904 } // namespace
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/save_page/b_with_referrer_policy_origin.htm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698